@byyuurin/ui 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +15 -11
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.json +12 -0
  4. package/dist/{nuxt.mjs → module.mjs} +7 -6
  5. package/dist/module.mjs.map +1 -0
  6. package/dist/runtime/components/Accordion.vue +20 -31
  7. package/dist/runtime/components/Alert.vue +1 -1
  8. package/dist/runtime/components/App.vue +1 -1
  9. package/dist/runtime/components/Badge.vue +0 -1
  10. package/dist/runtime/components/Button.vue +14 -12
  11. package/dist/runtime/components/ButtonGroup.vue +47 -0
  12. package/dist/runtime/components/Card.vue +9 -6
  13. package/dist/runtime/components/Carousel.vue +310 -0
  14. package/dist/runtime/components/Checkbox.vue +3 -4
  15. package/dist/runtime/components/Chip.vue +9 -4
  16. package/dist/runtime/components/Collapsible.vue +56 -0
  17. package/dist/runtime/components/Drawer.vue +4 -2
  18. package/dist/runtime/components/Input.vue +12 -8
  19. package/dist/runtime/components/InputNumber.vue +167 -0
  20. package/dist/runtime/components/Link.vue +301 -72
  21. package/dist/runtime/components/LinkBase.vue +88 -0
  22. package/dist/runtime/components/Modal.vue +2 -4
  23. package/dist/runtime/components/Pagination.vue +167 -0
  24. package/dist/runtime/components/PinInput.vue +0 -1
  25. package/dist/runtime/components/RadioGroup.vue +0 -1
  26. package/dist/runtime/components/ScrollArea.vue +1 -1
  27. package/dist/runtime/components/Select.vue +9 -5
  28. package/dist/runtime/components/Separator.vue +63 -0
  29. package/dist/runtime/components/Slider.vue +0 -1
  30. package/dist/runtime/components/Switch.vue +4 -6
  31. package/dist/runtime/components/Table.vue +292 -0
  32. package/dist/runtime/components/Tabs.vue +17 -18
  33. package/dist/runtime/components/Textarea.vue +0 -1
  34. package/dist/runtime/components/Toast.vue +21 -10
  35. package/dist/runtime/components/Toaster.vue +4 -39
  36. package/dist/runtime/composables/useButtonGroup.d.ts +13 -0
  37. package/dist/runtime/composables/useButtonGroup.js +14 -0
  38. package/dist/runtime/composables/{useComponentIcons.mjs → useComponentIcons.js} +1 -1
  39. package/dist/runtime/composables/useModal.d.ts +1 -1
  40. package/dist/runtime/composables/{useModal.mjs → useModal.js} +1 -1
  41. package/dist/runtime/composables/useTheme.d.ts +4 -4
  42. package/dist/runtime/composables/{useTheme.mjs → useTheme.js} +4 -4
  43. package/dist/runtime/composables/useToast.d.ts +4 -4
  44. package/dist/runtime/composables/{useToast.mjs → useToast.js} +19 -6
  45. package/dist/runtime/index.d.ts +34 -0
  46. package/dist/runtime/index.js +34 -0
  47. package/dist/runtime/theme/accordion.d.ts +22 -5
  48. package/dist/runtime/theme/{accordion.mjs → accordion.js} +2 -2
  49. package/dist/runtime/theme/alert.d.ts +41 -1
  50. package/dist/runtime/theme/{alert.mjs → alert.js} +4 -4
  51. package/dist/runtime/theme/app.d.ts +8 -0
  52. package/dist/runtime/theme/app.js +18 -0
  53. package/dist/runtime/theme/badge.d.ts +48 -21
  54. package/dist/runtime/theme/{badge.mjs → badge.js} +5 -2
  55. package/dist/runtime/theme/button-group.d.ts +66 -0
  56. package/dist/runtime/theme/button-group.js +42 -0
  57. package/dist/runtime/theme/button.d.ts +68 -111
  58. package/dist/runtime/theme/button.js +164 -0
  59. package/dist/runtime/theme/card.d.ts +38 -19
  60. package/dist/runtime/theme/card.js +37 -0
  61. package/dist/runtime/theme/carousel.d.ts +113 -0
  62. package/dist/runtime/theme/carousel.js +43 -0
  63. package/dist/runtime/theme/checkbox.d.ts +4 -1
  64. package/dist/runtime/theme/{checkbox.mjs → checkbox.js} +7 -4
  65. package/dist/runtime/theme/chip.d.ts +56 -12
  66. package/dist/runtime/theme/{chip.mjs → chip.js} +10 -7
  67. package/dist/runtime/theme/collapsible.d.ts +38 -0
  68. package/dist/runtime/theme/collapsible.js +10 -0
  69. package/dist/runtime/theme/drawer.d.ts +71 -33
  70. package/dist/runtime/theme/{drawer.mjs → drawer.js} +33 -22
  71. package/dist/runtime/theme/index.d.ts +31 -24
  72. package/dist/runtime/theme/index.js +31 -0
  73. package/dist/runtime/theme/input-number.d.ts +135 -0
  74. package/dist/runtime/theme/input-number.js +92 -0
  75. package/dist/runtime/theme/input.d.ts +94 -111
  76. package/dist/runtime/theme/input.js +151 -0
  77. package/dist/runtime/theme/link.d.ts +14 -1
  78. package/dist/runtime/theme/{link.mjs → link.js} +1 -1
  79. package/dist/runtime/theme/modal.d.ts +33 -7
  80. package/dist/runtime/theme/{modal.mjs → modal.js} +8 -10
  81. package/dist/runtime/theme/pagination.d.ts +56 -0
  82. package/dist/runtime/theme/pagination.js +13 -0
  83. package/dist/runtime/theme/pinInput.d.ts +45 -42
  84. package/dist/runtime/theme/{pinInput.mjs → pinInput.js} +14 -11
  85. package/dist/runtime/theme/popover.d.ts +16 -5
  86. package/dist/runtime/theme/{radioGroup.d.ts → radio-group.d.ts} +4 -1
  87. package/dist/runtime/theme/{radioGroup.mjs → radio-group.js} +3 -0
  88. package/dist/runtime/theme/scroll-area.d.ts +73 -0
  89. package/dist/runtime/theme/{scrollArea.mjs → scroll-area.js} +2 -2
  90. package/dist/runtime/theme/select.d.ts +95 -99
  91. package/dist/runtime/theme/{select.mjs → select.js} +22 -17
  92. package/dist/runtime/theme/separator.d.ts +95 -0
  93. package/dist/runtime/theme/separator.js +53 -0
  94. package/dist/runtime/theme/slider.d.ts +4 -1
  95. package/dist/runtime/theme/{slider.mjs → slider.js} +6 -3
  96. package/dist/runtime/theme/switch.d.ts +4 -1
  97. package/dist/runtime/theme/{switch.mjs → switch.js} +5 -2
  98. package/dist/runtime/theme/table.d.ts +89 -0
  99. package/dist/runtime/theme/table.js +35 -0
  100. package/dist/runtime/theme/tabs.d.ts +72 -52
  101. package/dist/runtime/theme/{tabs.mjs → tabs.js} +15 -12
  102. package/dist/runtime/theme/textarea.d.ts +46 -37
  103. package/dist/runtime/theme/{textarea.mjs → textarea.js} +14 -11
  104. package/dist/runtime/theme/toast.d.ts +45 -7
  105. package/dist/runtime/theme/{toast.mjs → toast.js} +12 -7
  106. package/dist/runtime/theme/toaster.d.ts +89 -25
  107. package/dist/runtime/theme/{toaster.mjs → toaster.js} +5 -0
  108. package/dist/runtime/theme/tooltip.d.ts +20 -7
  109. package/dist/runtime/theme/{tooltip.mjs → tooltip.js} +2 -2
  110. package/dist/runtime/types/components.d.ts +7 -1
  111. package/dist/runtime/types/index.d.ts +4 -4
  112. package/dist/runtime/types/index.js +2 -0
  113. package/dist/runtime/types/utils.d.ts +1 -1
  114. package/dist/runtime/utils/index.d.ts +3 -3
  115. package/dist/runtime/utils/{index.mjs → index.js} +3 -3
  116. package/dist/runtime/utils/link.d.ts +22 -7
  117. package/dist/runtime/utils/link.js +30 -0
  118. package/dist/runtime/utils/styler.d.ts +2 -2
  119. package/dist/runtime/vue/stubs.d.ts +9 -0
  120. package/dist/runtime/vue/stubs.js +16 -0
  121. package/dist/shared/ui.d1728164.mjs +4 -0
  122. package/dist/shared/ui.d1728164.mjs.map +1 -0
  123. package/dist/types.d.mts +1 -0
  124. package/dist/types.d.ts +1 -0
  125. package/dist/{unocss-preset.d.ts → unocss.d.mts} +10 -15
  126. package/dist/{unocss-preset.d.mts → unocss.d.ts} +10 -15
  127. package/dist/{unocss-preset.mjs → unocss.mjs} +53 -21
  128. package/dist/unocss.mjs.map +1 -0
  129. package/dist/unplugin.d.mts +4 -3
  130. package/dist/unplugin.d.ts +4 -3
  131. package/dist/unplugin.mjs +49 -5
  132. package/dist/unplugin.mjs.map +1 -1
  133. package/dist/vite.d.mts +1 -1
  134. package/dist/vite.d.ts +1 -1
  135. package/dist/vite.mjs +7 -5
  136. package/dist/vite.mjs.map +1 -1
  137. package/package.json +59 -45
  138. package/dist/index.d.ts +0 -26
  139. package/dist/index.mjs +0 -26
  140. package/dist/nuxt.mjs.map +0 -1
  141. package/dist/runtime/theme/app.mjs +0 -10
  142. package/dist/runtime/theme/button.mjs +0 -143
  143. package/dist/runtime/theme/card.mjs +0 -14
  144. package/dist/runtime/theme/index.mjs +0 -24
  145. package/dist/runtime/theme/input.mjs +0 -146
  146. package/dist/runtime/theme/scrollArea.d.ts +0 -51
  147. package/dist/runtime/types/index.mjs +0 -2
  148. package/dist/runtime/utils/link.mjs +0 -4
  149. package/dist/shared/ui.CzDyI29e.mjs +0 -8
  150. package/dist/shared/ui.CzDyI29e.mjs.map +0 -1
  151. package/dist/unocss-preset.mjs.map +0 -1
  152. /package/{LICENSE.md → LICENSE} +0 -0
  153. /package/dist/{nuxt.d.mts → module.d.mts} +0 -0
  154. /package/dist/{nuxt.d.ts → module.d.ts} +0 -0
  155. /package/dist/runtime/composables/{defineInjection.mjs → defineInjection.js} +0 -0
  156. /package/dist/runtime/theme/{popover.mjs → popover.js} +0 -0
  157. /package/dist/runtime/types/{components.mjs → components.js} +0 -0
  158. /package/dist/runtime/types/{utils.mjs → utils.js} +0 -0
  159. /package/dist/runtime/utils/{extend-theme.mjs → extend-theme.js} +0 -0
  160. /package/dist/runtime/utils/{styler.mjs → styler.js} +0 -0
package/README.md CHANGED
@@ -5,7 +5,6 @@ A collection of Vue.js components for my projects.
5
5
  [![npm version][npm-version-src]][npm-version-href]
6
6
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
7
7
  [![bundle][bundle-src]][bundle-href]
8
- [![JSDocs][jsdocs-src]][jsdocs-href]
9
8
  [![License][license-src]][license-href]
10
9
 
11
10
  ## Preview
@@ -30,7 +29,7 @@ pnpm i -D @iconify-json/[the-collection-you-want]
30
29
 
31
30
  ```ts
32
31
  // uno.config.ts
33
- import ui from '@byyuurin/ui/unocss-preset'
32
+ import { preset as ui } from '@byyuurin/ui/unocss'
34
33
  import { defineConfig, presetIcons, presetUno } from 'unocss'
35
34
 
36
35
  export default defineConfig({
@@ -43,16 +42,24 @@ export default defineConfig({
43
42
  radius: '0rem', // optional
44
43
  radiusBox: '0rem', // optional
45
44
  radiusButton: '0rem', // optional
45
+ radiusCheckbox: '0rem', // optional
46
+ radiusRadio: '0rem', // optional
47
+ radiusSwitch: '0rem', // optional
46
48
  radiusTabs: '0rem', // optional
47
49
  cb: '#1f2937', // optional
48
- c1: '#ffffff', // optional
49
- c2: '#f2f2f2', // optional
50
- c3: '#e5e6e6', // optional
50
+ cp: '#1f2937', // optional
51
+ cx: '#ffffff', // optional
51
52
  }),
52
53
  ],
53
54
  })
54
55
  ```
55
56
 
57
+ New Rules
58
+
59
+ - `ui-[color]`
60
+ - `bg-soft-[color]`
61
+ - `bg-soft-[color]/[mix-ratio]`
62
+
56
63
  ### Vite
57
64
 
58
65
  ```ts
@@ -62,7 +69,6 @@ import UI from '@byyuurin/ui/vite'
62
69
  import Vue from '@vitejs/plugin-vue'
63
70
  import UnoCSS from 'unocss/vite'
64
71
  import { defineConfig } from 'vite'
65
- import Inspect from 'vite-plugin-inspect'
66
72
 
67
73
  export default defineConfig({
68
74
  plugins: [
@@ -111,7 +117,7 @@ export default defineNuxtConfig({
111
117
 
112
118
  ## License
113
119
 
114
- [MIT](./LICENSE) License © 2024-PRESENT [Yuurin](https://github.com/byyurin)
120
+ [MIT](./LICENSE) License © 2024-PRESENT [Yuurin](https://github.com/byyuurin)
115
121
 
116
122
  <!-- Badges -->
117
123
 
@@ -121,7 +127,5 @@ export default defineNuxtConfig({
121
127
  [npm-downloads-href]: https://npmjs.com/package/@byyuurin/ui
122
128
  [bundle-src]: https://img.shields.io/bundlephobia/minzip/@byyuurin/ui?style=flat&colorA=080f12&colorB=1fa669&label=minzip
123
129
  [bundle-href]: https://bundlephobia.com/result?p=@byyuurin/ui
124
- [license-src]: https://img.shields.io/github/license/byyuurin/@byyuurin/ui.svg?style=flat&colorA=080f12&colorB=1fa669
125
- [license-href]: https://github.com/byyuurin/@byyuurin/ui/blob/main/LICENSE
126
- [jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
127
- [jsdocs-href]: https://www.jsdocs.io/package/@byyuurin/ui
130
+ [license-src]: https://img.shields.io/github/license/byyuurin/ui.svg?style=flat&colorA=080f12&colorB=1fa669
131
+ [license-href]: https://github.com/byyuurin/ui/blob/main/LICENSE
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@byyuurin/ui",
3
+ "configKey": "ui",
4
+ "compatibility": {
5
+ "nuxt": ">=3.13.1"
6
+ },
7
+ "version": "0.0.7",
8
+ "builder": {
9
+ "@nuxt/module-builder": "0.8.4",
10
+ "unbuild": "2.0.0"
11
+ }
12
+ }
@@ -1,9 +1,7 @@
1
1
  import { defineNuxtModule, useLogger, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
- import { p as packageName } from './shared/ui.CzDyI29e.mjs';
3
- import 'node:url';
4
- import 'pathe';
2
+ import { p as packageName } from './shared/ui.d1728164.mjs';
5
3
 
6
- const nuxt = defineNuxtModule({
4
+ const module = defineNuxtModule({
7
5
  meta: {
8
6
  name: packageName,
9
7
  configKey: "ui",
@@ -21,6 +19,9 @@ const nuxt = defineNuxtModule({
21
19
  logger.error(`\`${packageName}\` requires the \`@unocss/nuxt\` module to be installed.`);
22
20
  return;
23
21
  }
22
+ nuxt.options.vite.optimizeDeps ??= {};
23
+ nuxt.options.vite.optimizeDeps.include ??= [];
24
+ nuxt.options.vite.optimizeDeps.include.push(`${packageName}/unocss`);
24
25
  nuxt.options.alias["#ui"] = resolve("./runtime");
25
26
  addComponentsDir({
26
27
  path: resolve("./runtime/components"),
@@ -31,5 +32,5 @@ const nuxt = defineNuxtModule({
31
32
  }
32
33
  });
33
34
 
34
- export { nuxt as default };
35
- //# sourceMappingURL=nuxt.mjs.map
35
+ export { module as default };
36
+ //# sourceMappingURL=module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.mjs","sources":["../src/module.ts"],"sourcesContent":["import { addComponentsDir, addImportsDir, createResolver, defineNuxtModule, useLogger } from '@nuxt/kit'\nimport { packageName } from './shared'\n\nexport interface ModuleOptions {\n /**\n * prefix for components used in templates\n *\n * @default \"U\"\n */\n prefix?: string\n}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: packageName,\n configKey: 'ui',\n compatibility: {\n nuxt: '>=3.13.1',\n },\n },\n defaults: {\n prefix: 'U',\n },\n setup(options, nuxt) {\n const logger = useLogger(packageName)\n const { resolve } = createResolver(import.meta.url)\n\n // Make sure the UnoCSS Nuxt module is installed\n if (!nuxt.options.modules.includes('@unocss/nuxt')) {\n logger.error(`\\`${packageName}\\` requires the \\`@unocss/nuxt\\` module to be installed.`)\n return\n }\n\n nuxt.options.vite.optimizeDeps ??= {}\n nuxt.options.vite.optimizeDeps.include ??= []\n nuxt.options.vite.optimizeDeps.include.push(`${packageName}/unocss`)\n\n nuxt.options.alias['#ui'] = resolve('./runtime')\n\n addComponentsDir({\n path: resolve('./runtime/components'),\n prefix: options.prefix,\n pathPrefix: false,\n })\n\n addImportsDir(resolve('./runtime/composables'))\n },\n})\n"],"names":[],"mappings":";;;AAYA,eAAe,gBAAgC,CAAA;AAAA,EAC7C,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,WAAA;AAAA,IACN,SAAW,EAAA,IAAA;AAAA,IACX,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,UAAA;AAAA,KACR;AAAA,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,MAAQ,EAAA,GAAA;AAAA,GACV;AAAA,EACA,KAAA,CAAM,SAAS,IAAM,EAAA;AACnB,IAAM,MAAA,MAAA,GAAS,UAAU,WAAW,CAAA,CAAA;AACpC,IAAA,MAAM,EAAE,OAAA,EAAY,GAAA,cAAA,CAAe,YAAY,GAAG,CAAA,CAAA;AAGlD,IAAA,IAAI,CAAC,IAAK,CAAA,OAAA,CAAQ,OAAQ,CAAA,QAAA,CAAS,cAAc,CAAG,EAAA;AAClD,MAAO,MAAA,CAAA,KAAA,CAAM,CAAK,EAAA,EAAA,WAAW,CAA0D,wDAAA,CAAA,CAAA,CAAA;AACvF,MAAA,OAAA;AAAA,KACF;AAEA,IAAK,IAAA,CAAA,OAAA,CAAQ,IAAK,CAAA,YAAA,KAAiB,EAAC,CAAA;AACpC,IAAA,IAAA,CAAK,OAAQ,CAAA,IAAA,CAAK,YAAa,CAAA,OAAA,KAAY,EAAC,CAAA;AAC5C,IAAA,IAAA,CAAK,QAAQ,IAAK,CAAA,YAAA,CAAa,QAAQ,IAAK,CAAA,CAAA,EAAG,WAAW,CAAS,OAAA,CAAA,CAAA,CAAA;AAEnE,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA,CAAM,KAAK,CAAA,GAAI,QAAQ,WAAW,CAAA,CAAA;AAE/C,IAAiB,gBAAA,CAAA;AAAA,MACf,IAAA,EAAM,QAAQ,sBAAsB,CAAA;AAAA,MACpC,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,UAAY,EAAA,KAAA;AAAA,KACb,CAAA,CAAA;AAED,IAAc,aAAA,CAAA,OAAA,CAAQ,uBAAuB,CAAC,CAAA,CAAA;AAAA,GAChD;AACF,CAAC,CAAA;;;;"}
@@ -1,12 +1,12 @@
1
1
  <script lang="ts">
2
- import type { AccordionRootEmits, AccordionRootProps, PrimitiveProps } from 'reka-ui'
2
+ import type { AccordionRootEmits, AccordionRootProps } from 'reka-ui'
3
3
  import type { accordion } from '../theme'
4
- import type { ComponentAttrs, DynamicSlots } from '../types'
4
+ import type { ComponentAttrs } from '../types'
5
5
 
6
6
  export interface AccordionItem {
7
7
  label?: string
8
8
  icon?: string
9
- trailingIcon?: string
9
+ suffixIcon?: string
10
10
  slot?: string
11
11
  content?: string
12
12
  /** A unique value for the accordion item. Defaults to the index. */
@@ -20,14 +20,19 @@ type SlotProps<T> = (props: { item: T, index: number, open: boolean }) => any
20
20
 
21
21
  export type AccordionSlots<T extends { slot?: string }> = {
22
22
  default?: SlotProps<T>
23
- icon?: SlotProps<T>
23
+ prefix?: SlotProps<T>
24
+ suffix?: SlotProps<T>
24
25
  content?: SlotProps<T>
25
26
  body?: SlotProps<T>
26
- } & DynamicSlots<T, SlotProps<T>>
27
+ } & Record<string, SlotProps<T>>
27
28
 
28
- export interface AccordionProps<T> extends ComponentAttrs<typeof accordion>, Pick<AccordionRootProps, 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled' | 'unmountOnHide'> {
29
- as?: PrimitiveProps['as']
29
+ export interface AccordionProps<T> extends ComponentAttrs<typeof accordion>, Pick<AccordionRootProps, 'as' | 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled' | 'unmountOnHide'> {
30
30
  items?: T[]
31
+ /**
32
+ * The icon displayed on the right side of the trigger.
33
+ * @default app.icons.down
34
+ */
35
+ suffixIcon?: string
31
36
  labelKey?: string
32
37
  }
33
38
  </script>
@@ -44,11 +49,11 @@ const props = withDefaults(defineProps<AccordionProps<T>>(), {
44
49
  collapsible: true,
45
50
  unmountOnHide: true,
46
51
  labelKey: 'label',
47
- items: () => [],
48
52
  })
49
- const slots = defineSlots<AccordionSlots<T>>()
50
53
 
51
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'collapsible', 'defaultValue', 'disabled', 'modelValue', 'type', 'unmountOnHide'))
54
+ const emit = defineEmits<AccordionEmits>()
55
+ const slots = defineSlots<AccordionSlots<T>>()
56
+ const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'collapsible', 'defaultValue', 'disabled', 'modelValue', 'type', 'unmountOnHide'), emit)
52
57
 
53
58
  const { theme, createStyler } = useTheme()
54
59
  const style = computed(() => {
@@ -69,16 +74,16 @@ const style = computed(() => {
69
74
  >
70
75
  <AccordionHeader :class="style.header({ class: props.ui?.header })">
71
76
  <AccordionTrigger :class="style.trigger({ class: props.ui?.trigger, disabled: item.disabled })">
72
- <slot name="icon" v-bind="{ item, index, open }">
73
- <i v-if="item.icon" :class="style.icon({ class: [item.icon, props.ui?.icon] })"></i>
77
+ <slot name="prefix" v-bind="{ item, index, open }">
78
+ <span v-if="item.icon" :class="style.prefixIcon({ class: [item.icon, props.ui?.prefixIcon] })"></span>
74
79
  </slot>
75
80
 
76
81
  <span v-if="get(item, props.labelKey) || slots.default" :class="style.label({ class: props.ui?.label })">
77
82
  <slot v-bind="{ item, index, open }">{{ get(item, props.labelKey) }}</slot>
78
83
  </span>
79
84
 
80
- <slot name="trailing-icon" v-bind="{ item, index, open }">
81
- <i v-if="item.trailingIcon" :class="style.icon({ class: [item.trailingIcon, props.ui?.trailingIcon] })"></i>
85
+ <slot name="suffix" v-bind="{ item, index, open }">
86
+ <span :class="style.suffixIcon({ class: [item.suffixIcon || props.suffixIcon || theme.app.icons.down, props.ui?.suffixIcon] })"></span>
82
87
  </slot>
83
88
  </AccordionTrigger>
84
89
  </AccordionHeader>
@@ -100,21 +105,5 @@ const style = computed(() => {
100
105
  </template>
101
106
 
102
107
  <style>
103
- @keyframes accordion-up {
104
- from {
105
- height: var(--reka-accordion-content-height);
106
- }
107
- to {
108
- height: 0;
109
- }
110
- }
111
-
112
- @keyframes accordion-down {
113
- from {
114
- height: 0;
115
- }
116
- to {
117
- height: var(--reka-accordion-content-height);
118
- }
119
- }
108
+ @keyframes accordion-up{0%{height:var(--reka-accordion-content-height)}to{height:0}}@keyframes accordion-down{0%{height:0}to{height:var(--reka-accordion-content-height)}}
120
109
  </style>
@@ -74,7 +74,7 @@ const style = computed(() => {
74
74
  :class="style.root({ class: [props.class, props.ui?.root] })"
75
75
  >
76
76
  <slot name="prepend">
77
- <i v-if="props.icon" :class="style.icon({ class: [props.icon, props.ui?.icon] })"></i>
77
+ <span v-if="props.icon" :class="style.icon({ class: [props.icon, props.ui?.icon] })"></span>
78
78
  </slot>
79
79
 
80
80
  <div :class="style.wrapper({ class: props.ui?.wrapper })">
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
+ import type { UserConfig } from '@unocss/core'
2
3
  import type { ConfigProviderProps, TooltipProviderProps } from 'reka-ui'
3
- import type { UserConfig } from 'unocss'
4
4
  import type { ThemeExtension, ToasterProps } from '../types'
5
5
 
6
6
  export interface AppProps extends Omit<ConfigProviderProps, 'useId' | 'dir' | 'locale'> {
@@ -37,7 +37,6 @@ defineOptions({
37
37
  })
38
38
 
39
39
  const props = withDefaults(defineProps<BadgeProps>(), {
40
- size: 'md',
41
40
  position: 'top-right',
42
41
  })
43
42
 
@@ -12,9 +12,8 @@ export interface ButtonSlots {
12
12
  }
13
13
 
14
14
  type ButtonVariants = VariantProps<typeof button>
15
- type UIOptions = ComponentAttrs<typeof button>['ui'] & LinkProps['ui']
16
15
 
17
- export interface ButtonProps extends Omit<ComponentAttrs<typeof button>, 'ui'>, UseComponentIconsProps, Omit<LinkProps, 'ui' | 'raw'> {
16
+ export interface ButtonProps extends ComponentAttrs<typeof button>, UseComponentIconsProps, Omit<LinkProps, 'raw' | 'custom'> {
18
17
  icon?: string
19
18
  label?: string
20
19
  variant?: ButtonVariants['variant']
@@ -22,12 +21,13 @@ export interface ButtonProps extends Omit<ComponentAttrs<typeof button>, 'ui'>,
22
21
  loading?: boolean
23
22
  active?: boolean
24
23
  disabled?: boolean
25
- ui?: UIOptions
26
24
  }
27
25
  </script>
28
26
 
29
27
  <script lang="ts" setup>
28
+ import { useForwardProps } from 'reka-ui'
30
29
  import { computed } from 'vue'
30
+ import { useButtonGroup } from '../composables/useButtonGroup'
31
31
  import { useComponentIcons } from '../composables/useComponentIcons'
32
32
  import { useTheme } from '../composables/useTheme'
33
33
  import { omit, pickLinkProps } from '../utils'
@@ -35,16 +35,16 @@ import Link from './Link.vue'
35
35
 
36
36
  const props = withDefaults(defineProps<ButtonProps>(), {
37
37
  variant: 'solid',
38
- size: 'md',
39
38
  })
40
39
 
41
40
  const slots = defineSlots<ButtonSlots>()
42
41
 
42
+ const { size, orientation } = useButtonGroup(props)
43
43
  const { isPrefix, isSuffix, prefixIconName, suffixIconName } = useComponentIcons(
44
44
  computed(() => ({ ...props, loading: props.loading })),
45
45
  )
46
46
 
47
- const linkProps = pickLinkProps(props)
47
+ const linkProps = useForwardProps(pickLinkProps(props))
48
48
 
49
49
  const { theme, createStyler } = useTheme()
50
50
 
@@ -52,12 +52,14 @@ const style = computed(() => {
52
52
  const styler = createStyler(theme.value.button)
53
53
  return styler({
54
54
  ...props,
55
+ size: size.value,
56
+ groupOrientation: orientation.value,
55
57
  prefix: isPrefix.value,
56
58
  suffix: isSuffix.value,
57
59
  class: [
58
60
  props.class,
59
- props.active ? props.ui?.active : props.ui?.inactive,
60
- props.disabled ? props.ui?.disabled : undefined,
61
+ props.active ? props.activeClass : props.inactiveClass,
62
+ props.disabled ? props.disableClass : undefined,
61
63
  ],
62
64
  })
63
65
  })
@@ -68,14 +70,14 @@ const style = computed(() => {
68
70
  :class="style.base({ class: [props.class, props.ui?.base] })"
69
71
  :type="props.type"
70
72
  :disabled="props.disabled || props.loading"
71
- v-bind="omit(linkProps, ['type', 'disabled'])"
73
+ v-bind="omit(linkProps, ['type', 'disabled', 'activeClass', 'inactiveClass', 'disableClass'])"
72
74
  raw
73
75
  >
74
76
  <slot name="prefix">
75
- <i
77
+ <span
76
78
  v-if="isPrefix && prefixIconName"
77
79
  :class="style.prefixIcon({ class: [prefixIconName, props.ui?.prefixIcon] })"
78
- ></i>
80
+ ></span>
79
81
  </slot>
80
82
  <span
81
83
  v-if="props.label || slots.default"
@@ -84,10 +86,10 @@ const style = computed(() => {
84
86
  <slot>{{ label }}</slot>
85
87
  </span>
86
88
  <slot name="suffix">
87
- <i
89
+ <span
88
90
  v-if="isSuffix && suffixIconName"
89
91
  :class="style.suffixIcon({ class: [suffixIconName, props.ui?.suffixIcon] })"
90
- ></i>
92
+ ></span>
91
93
  </slot>
92
94
  </Link>
93
95
  </template>
@@ -0,0 +1,47 @@
1
+ <script lang="ts">
2
+ import type { VariantProps } from '@byyuurin/ui-kit'
3
+ import type { PrimitiveProps } from 'reka-ui'
4
+ import type { buttonGroup } from '../theme'
5
+ import type { ComponentAttrs } from '../types'
6
+
7
+ type ButtonGroupVariant = VariantProps<typeof buttonGroup>
8
+
9
+ export interface ButtonGroupProps extends Omit<ComponentAttrs<typeof buttonGroup>, 'ui'>, Pick<PrimitiveProps, 'as'> {
10
+ size?: ButtonGroupVariant['size']
11
+ orientation?: ButtonGroupVariant['orientation']
12
+ }
13
+
14
+ export interface ButtonGroupSlots {
15
+ default?: (props?: any) => any
16
+ }
17
+ </script>
18
+
19
+ <script setup lang="ts">
20
+ import { Primitive } from 'reka-ui'
21
+ import { computed } from 'vue'
22
+ import { provideButtonGroup } from '../composables/useButtonGroup'
23
+ import { useTheme } from '../composables/useTheme'
24
+
25
+ const props = withDefaults(defineProps<ButtonGroupProps>(), {
26
+ orientation: 'horizontal',
27
+ })
28
+
29
+ defineSlots<ButtonGroupSlots>()
30
+
31
+ provideButtonGroup(computed(() => ({
32
+ size: props.size,
33
+ orientation: props.orientation,
34
+ })))
35
+
36
+ const { theme, createStyler } = useTheme()
37
+ const style = computed(() => {
38
+ const styler = createStyler(theme.value.buttonGroup)
39
+ return styler(props)
40
+ })
41
+ </script>
42
+
43
+ <template>
44
+ <Primitive :as="props.as" :class="style">
45
+ <slot></slot>
46
+ </Primitive>
47
+ </template>
@@ -1,14 +1,9 @@
1
1
  <script lang="ts">
2
+ import type { VariantProps } from '@byyuurin/ui-kit'
2
3
  import type { PrimitiveProps } from 'reka-ui'
3
4
  import type { card } from '../theme'
4
5
  import type { ComponentAttrs } from '../types'
5
6
 
6
- export interface CardProps extends ComponentAttrs<typeof card> {
7
- as?: PrimitiveProps['as']
8
- title?: string
9
- description?: string
10
- }
11
-
12
7
  export interface CardSlots {
13
8
  default?: (props?: {}) => any
14
9
  content?: (props?: {}) => any
@@ -17,6 +12,14 @@ export interface CardSlots {
17
12
  description?: (props?: any) => any
18
13
  footer?: (props?: {}) => any
19
14
  }
15
+
16
+ type CardVariants = VariantProps<typeof card>
17
+ export interface CardProps extends ComponentAttrs<typeof card> {
18
+ as?: PrimitiveProps['as']
19
+ variant?: CardVariants['variant']
20
+ title?: string
21
+ description?: string
22
+ }
20
23
  </script>
21
24
 
22
25
  <script setup lang="ts">