Skip to content

Commit

Permalink
docs: updated API section
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Dec 26, 2022
1 parent f0f0e56 commit 0312606
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
9 changes: 6 additions & 3 deletions docs/components/Api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ const propsHeader = Object.keys(props.api.props[0])
>
<span
class="font-semibold text-[hsla(var(--a-typography-title-color),var(--a-typography-title-opacity))]"
>{{ prop.name }}</span>
<span class="text-[hsla(var(--a-base-color),var(--a-text-emphasis-light-opacity))]"> : {{ prop.type }}</span>
<span class="text-[hsla(var(--a-base-color),var(--a-text-emphasis-light-opacity))]"> = {{ prop.default }}</span>
>{{ prop.name.replace('?', '') }}</span>
<span class="text-[hsla(var(--a-base-color),var(--a-text-emphasis-light-opacity))]"> : {{ prop.type.replace(/\s*\| (undefined)$/, '') }}</span>
<span
v-if="prop.default !== 'unknown'"
class="text-[hsla(var(--a-base-color),var(--a-text-emphasis-light-opacity))]"
> = {{ prop.default }}</span>
<div
class="!children-[p]-m-0"
v-html="prop.description"
Expand Down
9 changes: 9 additions & 0 deletions docs/guide/components/badge.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<script lang="ts" setup>
import api from '@anu/component-meta/ABadge.json';
</script>

# Badge

<!-- 馃憠 Default -->
Expand Down Expand Up @@ -111,3 +115,8 @@ You can use font-size utility to adjust the size of badge.
:::

::::

<!-- 馃憠 API -->
## API

<Api :api="api"></Api>
48 changes: 48 additions & 0 deletions packages/anu-vue/src/components/base-input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,71 @@ import { disabled, readonly, spacing } from '@/composables/useProps'

// TODO: Provide a way to apply classes on root. Later you can target input container & wrapper.
export const baseInputProps = {
/**
* Component spacing
*/
spacing,

/**
* Input wrapper classes
*/
// 鈩癸笍 If we want any type need to set `propName: { type: null }`. Using `propName: null` will omit (disable) the prop.
inputWrapperClasses: { type: null },

/**
* Input classes
*/
// 鈩癸笍 If we want any type need to set `propName: { type: null }`. Using `propName: null` will omit (disable) the prop.
inputClasses: { type: null },

/**
* Input container classes
*/
inputContainerAttrs: Object as PropType<HTMLAttributes>,

/**
* Add hint below the form component
*/
hint: String,

/**
* Error text to render. This will replace hint text if provided.
*/
error: String,

/**
* Label of the form component
*/
label: String,

/**
* Prepend icon
*/
prependIcon: String,

/**
* Append icon
*/
appendIcon: String,

/**
* Prepend icon inside input
*/
prependInnerIcon: String,

/**
* Append icon inside input
*/
appendInnerIcon: String,

/**
* Set component in disabled state
*/
disabled,

/**
* Set component in readonly mode
*/
readonly,
}

Expand Down
4 changes: 2 additions & 2 deletions packages/anu-vue/src/components/typography/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export const typographyProps = {
text: configurable,

/**
* Tag to use for title of the card
* Tag to use for title of the component
*/
titleTag: {
type: String,
default: 'span',
},

/**
* Tag to use for subtitle of the card
* Tag to use for subtitle of the component
*/
subtitleTag: {
type: String,
Expand Down

0 comments on commit 0312606

Please sign in to comment.