Skip to content

Commit

Permalink
refactor: props, emits and readme formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr0zy07 committed Dec 19, 2023
1 parent 3c83b41 commit fa11427
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 39 deletions.
2 changes: 1 addition & 1 deletion packages/components/aspect-ratio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Displays content within a desired ratio.
$ pnpm add @oku-ui/aspect-ratio
```

[Documentation](https://oku-ui.com/primitives/components/aspect-ratio)
[Documentation](https://oku-ui.com/primitives/components/aspect-ratio)
8 changes: 2 additions & 6 deletions packages/components/aspect-ratio/src/aspect-ratio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import type { AspectRatioNativeElement } from './props'
const aspectRatio = defineComponent({
name: ASPECT_RATIO_NAME,
inheritAttrs: false,
props: {
...aspectRatioProps.props,
},
emit: {
...aspectRatioProps.emits,
},
props: aspectRatioProps.props,
emit: aspectRatioProps.emits,
setup(props, { attrs, slots }) {
const {
ratio,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/avatar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ An image element with a fallback for representing the user.
$ pnpm add @oku-ui/avatar
```

[Documentation](https://oku-ui.com/primitives/components/avatar)
[Documentation](https://oku-ui.com/primitives/components/avatar)
4 changes: 1 addition & 3 deletions packages/components/avatar/src/avatar-fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const avatarFallback = defineComponent({
...avatarFallbackProps.props,
...scopeAvatarProps,
},
emit: {
...avatarFallbackProps.emits,
},
emit: avatarFallbackProps.emits,
setup(props, { attrs, slots }) {
const {
scopeOkuAvatar,
Expand Down
4 changes: 1 addition & 3 deletions packages/components/avatar/src/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const avatar = defineComponent({
...avatarProps.props,
...scopeAvatarProps,
},
emit: {
...avatarProps.emits,
},
emit: avatarProps.emits,
setup(props, { attrs, slots }) {
const {
scopeOkuAvatar,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ A control that allows the user to toggle between checked and not checked.
$ pnpm add @oku-ui/checkbox
```

[Documentation](https://oku-ui.com/primitives/components/checkbox)
[Documentation](https://oku-ui.com/primitives/components/checkbox)
8 changes: 2 additions & 6 deletions packages/components/checkbox/src/bubble-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import type { BubbleInputNativeElement } from './props'
const bubbleInput = defineComponent({
name: CHECKBOX_BUBBLE_INPUT_NAME,
inheritAttrs: false,
props: {
...bubbleInputProps.props,
},
emits: {
...bubbleInputProps.emits,
},
props: bubbleInputProps.props,
emits: bubbleInputProps.emits,
setup(props, { attrs }) {
const {
checked,
Expand Down
4 changes: 1 addition & 3 deletions packages/components/checkbox/src/checkbox-indicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const checkboxIndicator = defineComponent({
...checkboxIndicatorProps.props,
...scopeCheckboxProps,
},
emits: {
...checkboxIndicatorProps.emits,
},
emits: checkboxIndicatorProps.emits,
setup(props, { attrs, slots }) {
const {
scopeOkuCheckbox,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/label/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Renders an accessible label associated with controls.
$ pnpm add @oku-ui/label
```

[Documentation](https://oku-ui.com/primitives/components/label)
[Documentation](https://oku-ui.com/primitives/components/label)
10 changes: 3 additions & 7 deletions packages/components/label/src/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ import type { LabelEmits, LabelNativeElement } from './props'
const label = defineComponent({
name: LABEL_NAME,
inheritAttrs: false,
props: {
...labelProps.props,
},
emits: {
...labelProps.emits,
},
props: labelProps.props,
emits: labelProps.emits,
setup(props, { attrs, slots, emit }) {
const forwardedRef = useForwardRef()
const emits = useListeners(['onMousedown'])
const emits = useListeners()

return () => h(Primitive.label, {
...mergeProps(attrs, emits),
Expand Down
2 changes: 1 addition & 1 deletion packages/components/separator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Visually or semantically separates content.
$ pnpm add @oku-ui/separator
```

[Documentation](https://oku-ui.com/primitives/components/separator)
[Documentation](https://oku-ui.com/primitives/components/separator)
4 changes: 1 addition & 3 deletions packages/components/separator/src/separator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import type { SeparatorNativeElement } from './props'
const separator = defineComponent({
name: SEPARATOR_NAME,
inheritAttrs: false,
props: {
...separatorProps.props,
},
props: separatorProps.props,
emits: separatorProps.emits,
setup(props, { attrs }) {
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/toggle-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ A set of two-state buttons that can be toggled on or off.
$ pnpm add @oku-ui/toggle-group
```

[Documentation](https://oku-ui.com/primitives/components/toggle-group)
[Documentation](https://oku-ui.com/primitives/components/toggle-group)
2 changes: 1 addition & 1 deletion packages/components/toggle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ A two-state button that can be either on or off.
$ pnpm add @oku-ui/toggle
```

[Documentation](https://oku-ui.com/primitives/components/toggle)
[Documentation](https://oku-ui.com/primitives/components/toggle)
2 changes: 1 addition & 1 deletion packages/components/toolbar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ A container for grouping a set of controls, such as buttons, toggle groups or dr
$ pnpm add @oku-ui/toolbar
```

[Documentation](https://oku-ui.com/primitives/components/toolbar)
[Documentation](https://oku-ui.com/primitives/components/toolbar)

0 comments on commit fa11427

Please sign in to comment.