@byyuurin/ui 0.0.4 → 0.0.6
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.
- package/README.md +23 -29
- package/dist/index.d.ts +28 -2
- package/dist/index.mjs +28 -2
- package/dist/nuxt.d.mts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.mjs +15 -10
- package/dist/nuxt.mjs.map +1 -0
- package/dist/runtime/components/Accordion.vue +1 -1
- package/dist/runtime/components/Alert.vue +120 -0
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/Badge.vue +70 -0
- package/dist/runtime/components/Button.vue +7 -3
- package/dist/runtime/components/ButtonGroup.vue +47 -0
- package/dist/runtime/components/Card.vue +4 -4
- package/dist/runtime/components/Carousel.vue +310 -0
- package/dist/runtime/components/Checkbox.vue +1 -2
- package/dist/runtime/components/Chip.vue +64 -0
- package/dist/runtime/components/Drawer.vue +2 -2
- package/dist/runtime/components/Input.vue +10 -5
- package/dist/runtime/components/Link.vue +1 -1
- package/dist/runtime/components/Modal.vue +4 -5
- package/dist/runtime/components/Pagination.vue +167 -0
- package/dist/runtime/components/PinInput.vue +85 -0
- package/dist/runtime/components/Popover.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue +1 -2
- package/dist/runtime/components/ScrollArea.vue +2 -2
- package/dist/runtime/components/Select.vue +7 -2
- package/dist/runtime/components/Slider.vue +96 -0
- package/dist/runtime/components/Switch.vue +2 -4
- package/dist/runtime/components/Tabs.vue +1 -2
- package/dist/runtime/components/Textarea.vue +2 -4
- package/dist/runtime/components/Toast.vue +21 -10
- package/dist/runtime/components/Toaster.vue +5 -5
- package/dist/runtime/components/Tooltip.vue +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +13 -0
- package/dist/runtime/composables/useButtonGroup.mjs +14 -0
- package/dist/runtime/composables/useTheme.d.ts +2 -2
- package/dist/runtime/composables/useTheme.mjs +1 -1
- package/dist/runtime/composables/useToast.d.ts +4 -4
- package/dist/runtime/composables/useToast.mjs +19 -6
- package/dist/runtime/theme/accordion.d.ts +17 -0
- package/dist/runtime/theme/accordion.mjs +24 -21
- package/dist/runtime/theme/alert.d.ts +125 -0
- package/dist/runtime/theme/alert.mjs +47 -0
- package/dist/runtime/theme/app.d.ts +5 -0
- package/dist/runtime/theme/app.mjs +7 -1
- package/dist/runtime/theme/badge.d.ts +82 -0
- package/dist/runtime/theme/badge.mjs +92 -0
- package/dist/runtime/theme/button-group.d.ts +66 -0
- package/dist/runtime/theme/button-group.mjs +42 -0
- package/dist/runtime/theme/button.d.ts +15 -1
- package/dist/runtime/theme/button.mjs +135 -119
- package/dist/runtime/theme/card.d.ts +21 -2
- package/dist/runtime/theme/card.mjs +12 -9
- package/dist/runtime/theme/carousel.d.ts +113 -0
- package/dist/runtime/theme/carousel.mjs +43 -0
- package/dist/runtime/theme/checkbox.d.ts +3 -0
- package/dist/runtime/theme/checkbox.mjs +47 -41
- package/dist/runtime/theme/chip.d.ts +67 -0
- package/dist/runtime/theme/chip.mjs +68 -0
- package/dist/runtime/theme/drawer.d.ts +38 -0
- package/dist/runtime/theme/drawer.mjs +69 -66
- package/dist/runtime/theme/index.d.ts +10 -2
- package/dist/runtime/theme/index.mjs +10 -2
- package/dist/runtime/theme/input.d.ts +41 -22
- package/dist/runtime/theme/input.mjs +139 -121
- package/dist/runtime/theme/link.d.ts +14 -1
- package/dist/runtime/theme/link.mjs +23 -20
- package/dist/runtime/theme/modal.d.ts +3 -0
- package/dist/runtime/theme/modal.mjs +53 -47
- package/dist/runtime/theme/pagination.d.ts +56 -0
- package/dist/runtime/theme/pagination.mjs +13 -0
- package/dist/runtime/theme/pinInput.d.ts +100 -0
- package/dist/runtime/theme/pinInput.mjs +111 -0
- package/dist/runtime/theme/popover.d.ts +11 -0
- package/dist/runtime/theme/popover.mjs +11 -8
- package/dist/runtime/theme/{radioGroup.d.ts → radio-group.d.ts} +3 -0
- package/dist/runtime/theme/radio-group.mjs +61 -0
- package/dist/runtime/theme/{scrollArea.d.ts → scroll-area.d.ts} +22 -0
- package/dist/runtime/theme/scroll-area.mjs +33 -0
- package/dist/runtime/theme/select.d.ts +16 -2
- package/dist/runtime/theme/select.mjs +160 -142
- package/dist/runtime/theme/slider.d.ts +76 -0
- package/dist/runtime/theme/slider.mjs +52 -0
- package/dist/runtime/theme/switch.d.ts +3 -0
- package/dist/runtime/theme/switch.mjs +69 -63
- package/dist/runtime/theme/tabs.d.ts +15 -2
- package/dist/runtime/theme/tabs.mjs +134 -112
- package/dist/runtime/theme/textarea.d.ts +8 -2
- package/dist/runtime/theme/textarea.mjs +105 -89
- package/dist/runtime/theme/toast.d.ts +44 -6
- package/dist/runtime/theme/toast.mjs +30 -22
- package/dist/runtime/theme/toaster.d.ts +51 -2
- package/dist/runtime/theme/toaster.mjs +88 -80
- package/dist/runtime/theme/tooltip.d.ts +13 -0
- package/dist/runtime/theme/tooltip.mjs +9 -6
- package/dist/runtime/types/components.d.ts +27 -20
- package/dist/runtime/types/components.mjs +27 -0
- package/dist/runtime/types/index.d.ts +1 -3
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/utils/extend-theme.mjs +1 -1
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/styler.d.ts +2 -2
- package/dist/shared/ui.D4zm1r0C.mjs +4 -0
- package/dist/shared/ui.D4zm1r0C.mjs.map +1 -0
- package/dist/{unocss-preset.d.mts → unocss.d.mts} +4 -4
- package/dist/{unocss-preset.d.ts → unocss.d.ts} +4 -4
- package/dist/{unocss-preset.mjs → unocss.mjs} +58 -36
- package/dist/unocss.mjs.map +1 -0
- package/dist/unplugin.d.mts +26 -0
- package/dist/unplugin.d.ts +26 -0
- package/dist/unplugin.mjs +72 -0
- package/dist/unplugin.mjs.map +1 -0
- package/dist/vite.d.mts +10 -0
- package/dist/vite.d.ts +10 -0
- package/dist/vite.mjs +14 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +46 -26
- package/dist/resolver.d.mts +0 -13
- package/dist/resolver.d.ts +0 -13
- package/dist/resolver.mjs +0 -21
- package/dist/runtime/components/index.d.ts +0 -20
- package/dist/runtime/components/index.mjs +0 -20
- package/dist/runtime/composables/index.d.ts +0 -5
- package/dist/runtime/composables/index.mjs +0 -5
- package/dist/runtime/theme/radioGroup.mjs +0 -55
- package/dist/runtime/theme/scrollArea.mjs +0 -30
- package/dist/shared/ui.Cmq14xN9.mjs +0 -25
- /package/{LICENSE.md → LICENSE} +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
|
|
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,6 +42,9 @@ 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
50
|
c1: '#ffffff', // optional
|
|
@@ -50,44 +52,38 @@ export default defineConfig({
|
|
|
50
52
|
c3: '#e5e6e6', // optional
|
|
51
53
|
}),
|
|
52
54
|
],
|
|
53
|
-
content: {
|
|
54
|
-
pipeline: {
|
|
55
|
-
include: [
|
|
56
|
-
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
57
|
-
/\/(?:theme).*\.(ts|m?js)($|\?)/,
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
55
|
})
|
|
62
56
|
```
|
|
63
57
|
|
|
58
|
+
New Rules
|
|
59
|
+
|
|
60
|
+
- `ui-[color]`
|
|
61
|
+
- `bg-solid-[color]`
|
|
62
|
+
- `bg-solid-[color]/[opacity]`
|
|
63
|
+
|
|
64
64
|
### Vite
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
67
|
// vite.config.ts
|
|
68
68
|
|
|
69
|
-
import
|
|
69
|
+
import UI from '@byyuurin/ui/vite'
|
|
70
70
|
import Vue from '@vitejs/plugin-vue'
|
|
71
71
|
import UnoCSS from 'unocss/vite'
|
|
72
|
-
import AutoImport from 'unplugin-auto-import/vite'
|
|
73
|
-
import VueComponents from 'unplugin-vue-components/vite'
|
|
74
72
|
import { defineConfig } from 'vite'
|
|
75
73
|
|
|
76
74
|
export default defineConfig({
|
|
77
75
|
plugins: [
|
|
78
76
|
UnoCSS(),
|
|
79
77
|
Vue(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
dts: 'src/typed-imports.d.ts',
|
|
90
|
-
imports: ['vue'],
|
|
78
|
+
UI({
|
|
79
|
+
prefix: 'U', // optional
|
|
80
|
+
autoImport: {
|
|
81
|
+
dts: 'src/typed-imports.d.ts',
|
|
82
|
+
imports: ['vue'],
|
|
83
|
+
},
|
|
84
|
+
components: {
|
|
85
|
+
dts: 'src/typed-components.d.ts',
|
|
86
|
+
},
|
|
91
87
|
}),
|
|
92
88
|
],
|
|
93
89
|
})
|
|
@@ -122,7 +118,7 @@ export default defineNuxtConfig({
|
|
|
122
118
|
|
|
123
119
|
## License
|
|
124
120
|
|
|
125
|
-
[MIT](./LICENSE) License © 2024-PRESENT [Yuurin](https://github.com/
|
|
121
|
+
[MIT](./LICENSE) License © 2024-PRESENT [Yuurin](https://github.com/byyuurin)
|
|
126
122
|
|
|
127
123
|
<!-- Badges -->
|
|
128
124
|
|
|
@@ -132,7 +128,5 @@ export default defineNuxtConfig({
|
|
|
132
128
|
[npm-downloads-href]: https://npmjs.com/package/@byyuurin/ui
|
|
133
129
|
[bundle-src]: https://img.shields.io/bundlephobia/minzip/@byyuurin/ui?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
|
134
130
|
[bundle-href]: https://bundlephobia.com/result?p=@byyuurin/ui
|
|
135
|
-
[license-src]: https://img.shields.io/github/license/byyuurin
|
|
136
|
-
[license-href]: https://github.com/byyuurin
|
|
137
|
-
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
|
138
|
-
[jsdocs-href]: https://www.jsdocs.io/package/@byyuurin/ui
|
|
131
|
+
[license-src]: https://img.shields.io/github/license/byyuurin/ui.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
132
|
+
[license-href]: https://github.com/byyuurin/ui/blob/main/LICENSE
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { default as Accordion } from './runtime/components/Accordion.vue';
|
|
2
|
+
export { default as Alert } from './runtime/components/Alert.vue';
|
|
3
|
+
export { default as App } from './runtime/components/App.vue';
|
|
4
|
+
export { default as Badge } from './runtime/components/Badge.vue';
|
|
5
|
+
export { default as Button } from './runtime/components/Button.vue';
|
|
6
|
+
export { default as ButtonGroup } from './runtime/components/ButtonGroup.vue';
|
|
7
|
+
export { default as Card } from './runtime/components/Card.vue';
|
|
8
|
+
export { default as Carousel } from './runtime/components/Carousel.vue';
|
|
9
|
+
export { default as Checkbox } from './runtime/components/Checkbox.vue';
|
|
10
|
+
export { default as Chip } from './runtime/components/Chip.vue';
|
|
11
|
+
export { default as Drawer } from './runtime/components/Drawer.vue';
|
|
12
|
+
export { default as Input } from './runtime/components/Input.vue';
|
|
13
|
+
export { default as Link } from './runtime/components/Link.vue';
|
|
14
|
+
export { default as Modal } from './runtime/components/Modal.vue';
|
|
15
|
+
export { default as ModalProvider } from './runtime/components/ModalProvider.vue';
|
|
16
|
+
export { default as Pagination } from './runtime/components/Pagination.vue';
|
|
17
|
+
export { default as PinInput } from './runtime/components/PinInput.vue';
|
|
18
|
+
export { default as Popover } from './runtime/components/Popover.vue';
|
|
19
|
+
export { default as RadioGroup } from './runtime/components/RadioGroup.vue';
|
|
20
|
+
export { default as ScrollArea } from './runtime/components/ScrollArea.vue';
|
|
21
|
+
export { default as Select } from './runtime/components/Select.vue';
|
|
22
|
+
export { default as Slider } from './runtime/components/Slider.vue';
|
|
23
|
+
export { default as Switch } from './runtime/components/Switch.vue';
|
|
24
|
+
export { default as Tabs } from './runtime/components/Tabs.vue';
|
|
25
|
+
export { default as Textarea } from './runtime/components/Textarea.vue';
|
|
26
|
+
export { default as Toast } from './runtime/components/Toast.vue';
|
|
27
|
+
export { default as Toaster } from './runtime/components/Toaster.vue';
|
|
28
|
+
export { default as Tooltip } from './runtime/components/Tooltip.vue';
|
|
3
29
|
export * from './runtime/types';
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { default as Accordion } from "./runtime/components/Accordion.vue";
|
|
2
|
+
export { default as Alert } from "./runtime/components/Alert.vue";
|
|
3
|
+
export { default as App } from "./runtime/components/App.vue";
|
|
4
|
+
export { default as Badge } from "./runtime/components/Badge.vue";
|
|
5
|
+
export { default as Button } from "./runtime/components/Button.vue";
|
|
6
|
+
export { default as ButtonGroup } from "./runtime/components/ButtonGroup.vue";
|
|
7
|
+
export { default as Card } from "./runtime/components/Card.vue";
|
|
8
|
+
export { default as Carousel } from "./runtime/components/Carousel.vue";
|
|
9
|
+
export { default as Checkbox } from "./runtime/components/Checkbox.vue";
|
|
10
|
+
export { default as Chip } from "./runtime/components/Chip.vue";
|
|
11
|
+
export { default as Drawer } from "./runtime/components/Drawer.vue";
|
|
12
|
+
export { default as Input } from "./runtime/components/Input.vue";
|
|
13
|
+
export { default as Link } from "./runtime/components/Link.vue";
|
|
14
|
+
export { default as Modal } from "./runtime/components/Modal.vue";
|
|
15
|
+
export { default as ModalProvider } from "./runtime/components/ModalProvider.vue";
|
|
16
|
+
export { default as Pagination } from "./runtime/components/Pagination.vue";
|
|
17
|
+
export { default as PinInput } from "./runtime/components/PinInput.vue";
|
|
18
|
+
export { default as Popover } from "./runtime/components/Popover.vue";
|
|
19
|
+
export { default as RadioGroup } from "./runtime/components/RadioGroup.vue";
|
|
20
|
+
export { default as ScrollArea } from "./runtime/components/ScrollArea.vue";
|
|
21
|
+
export { default as Select } from "./runtime/components/Select.vue";
|
|
22
|
+
export { default as Slider } from "./runtime/components/Slider.vue";
|
|
23
|
+
export { default as Switch } from "./runtime/components/Switch.vue";
|
|
24
|
+
export { default as Tabs } from "./runtime/components/Tabs.vue";
|
|
25
|
+
export { default as Textarea } from "./runtime/components/Textarea.vue";
|
|
26
|
+
export { default as Toast } from "./runtime/components/Toast.vue";
|
|
27
|
+
export { default as Toaster } from "./runtime/components/Toaster.vue";
|
|
28
|
+
export { default as Tooltip } from "./runtime/components/Tooltip.vue";
|
|
3
29
|
export * from "./runtime/types/index.mjs";
|
package/dist/nuxt.d.mts
CHANGED
package/dist/nuxt.d.ts
CHANGED
package/dist/nuxt.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineNuxtModule, useLogger,
|
|
2
|
-
import { p as packageName
|
|
1
|
+
import { defineNuxtModule, useLogger, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
import { p as packageName } from './shared/ui.D4zm1r0C.mjs';
|
|
3
3
|
|
|
4
4
|
const nuxt = defineNuxtModule({
|
|
5
5
|
meta: {
|
|
@@ -10,22 +10,27 @@ const nuxt = defineNuxtModule({
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
defaults: {
|
|
13
|
-
prefix: ""
|
|
13
|
+
prefix: "U"
|
|
14
14
|
},
|
|
15
15
|
setup(options, nuxt) {
|
|
16
16
|
const logger = useLogger(packageName);
|
|
17
|
+
const { resolve } = createResolver(import.meta.url);
|
|
17
18
|
if (!nuxt.options.modules.includes("@unocss/nuxt")) {
|
|
18
19
|
logger.error(`\`${packageName}\` requires the \`@unocss/nuxt\` module to be installed.`);
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
nuxt.options.vite.optimizeDeps ??= {};
|
|
23
|
+
nuxt.options.vite.optimizeDeps.include ??= [];
|
|
24
|
+
nuxt.options.vite.optimizeDeps.include.push(`${packageName}/unocss`);
|
|
25
|
+
nuxt.options.alias["#ui"] = resolve("./runtime");
|
|
26
|
+
addComponentsDir({
|
|
27
|
+
path: resolve("./runtime/components"),
|
|
28
|
+
prefix: options.prefix,
|
|
29
|
+
pathPrefix: false
|
|
30
|
+
});
|
|
31
|
+
addImportsDir(resolve("./runtime/composables"));
|
|
28
32
|
}
|
|
29
33
|
});
|
|
30
34
|
|
|
31
35
|
export { nuxt as default };
|
|
36
|
+
//# sourceMappingURL=nuxt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt.mjs","sources":["../src/nuxt.ts"],"sourcesContent":["import { addComponentsDir, addImportsDir, createResolver, defineNuxtModule, useLogger } from '@nuxt/kit'\r\nimport type {} from '@nuxt/schema' // Mandatory to avoid a bug when building\r\nimport { packageName } from './shared'\r\n\r\nexport interface ModuleOptions {\r\n /**\r\n * prefix for components used in templates\r\n *\r\n * @default \"U\"\r\n */\r\n prefix?: string\r\n}\r\n\r\nexport default defineNuxtModule<ModuleOptions>({\r\n meta: {\r\n name: packageName,\r\n configKey: 'ui',\r\n compatibility: {\r\n nuxt: '>=3.13.1',\r\n },\r\n },\r\n defaults: {\r\n prefix: 'U',\r\n },\r\n setup(options, nuxt) {\r\n const logger = useLogger(packageName)\r\n const { resolve } = createResolver(import.meta.url)\r\n\r\n // Make sure the UnoCSS Nuxt module is installed\r\n if (!nuxt.options.modules.includes('@unocss/nuxt')) {\r\n logger.error(`\\`${packageName}\\` requires the \\`@unocss/nuxt\\` module to be installed.`)\r\n return\r\n }\r\n\r\n nuxt.options.vite.optimizeDeps ??= {}\r\n nuxt.options.vite.optimizeDeps.include ??= []\r\n nuxt.options.vite.optimizeDeps.include.push(`${packageName}/unocss`)\r\n\r\n nuxt.options.alias['#ui'] = resolve('./runtime')\r\n\r\n addComponentsDir({\r\n path: resolve('./runtime/components'),\r\n prefix: options.prefix,\r\n pathPrefix: false,\r\n })\r\n\r\n addImportsDir(resolve('./runtime/composables'))\r\n },\r\n})\r\n"],"names":[],"mappings":";;;AAaA,aAAe,gBAAgC,CAAA;AAAA,EAC7C,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,WAAA;AAAA,IACN,SAAW,EAAA,IAAA;AAAA,IACX,aAAe,EAAA;AAAA,MACb,IAAM,EAAA;AAAA;AACR,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,KAAA,CAAM,SAAS,IAAM,EAAA;AACnB,IAAM,MAAA,MAAA,GAAS,UAAU,WAAW,CAAA;AACpC,IAAA,MAAM,EAAE,OAAA,EAAY,GAAA,cAAA,CAAe,YAAY,GAAG,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;AACvF,MAAA;AAAA;AAGF,IAAK,IAAA,CAAA,OAAA,CAAQ,IAAK,CAAA,YAAA,KAAiB,EAAC;AACpC,IAAA,IAAA,CAAK,OAAQ,CAAA,IAAA,CAAK,YAAa,CAAA,OAAA,KAAY,EAAC;AAC5C,IAAA,IAAA,CAAK,QAAQ,IAAK,CAAA,YAAA,CAAa,QAAQ,IAAK,CAAA,CAAA,EAAG,WAAW,CAAS,OAAA,CAAA,CAAA;AAEnE,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA,CAAM,KAAK,CAAA,GAAI,QAAQ,WAAW,CAAA;AAE/C,IAAiB,gBAAA,CAAA;AAAA,MACf,IAAA,EAAM,QAAQ,sBAAsB,CAAA;AAAA,MACpC,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,UAAY,EAAA;AAAA,KACb,CAAA;AAED,IAAc,aAAA,CAAA,OAAA,CAAQ,uBAAuB,CAAC,CAAA;AAAA;AAElD,CAAC,CAAA;;;;"}
|
|
@@ -36,7 +36,7 @@ export interface AccordionProps<T> extends ComponentAttrs<typeof accordion>, Pic
|
|
|
36
36
|
import { reactivePick } from '@vueuse/core'
|
|
37
37
|
import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, useForwardPropsEmits } from 'reka-ui'
|
|
38
38
|
import { computed } from 'vue'
|
|
39
|
-
import { useTheme } from '../composables'
|
|
39
|
+
import { useTheme } from '../composables/useTheme'
|
|
40
40
|
import { get } from '../utils'
|
|
41
41
|
|
|
42
42
|
const props = withDefaults(defineProps<AccordionProps<T>>(), {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from '@byyuurin/ui-kit'
|
|
3
|
+
import type { PrimitiveProps } from 'reka-ui'
|
|
4
|
+
import type { alert } from '../theme'
|
|
5
|
+
import type { ButtonProps, ComponentAttrs } from '../types'
|
|
6
|
+
|
|
7
|
+
type AlertVariants = VariantProps<typeof alert>
|
|
8
|
+
|
|
9
|
+
export interface AlertProps extends ComponentAttrs<typeof alert>, Pick<PrimitiveProps, 'as'> {
|
|
10
|
+
title?: string
|
|
11
|
+
description?: string
|
|
12
|
+
icon?: string
|
|
13
|
+
variant?: AlertVariants['variant']
|
|
14
|
+
orientation?: AlertVariants['orientation']
|
|
15
|
+
/**
|
|
16
|
+
* Display a list of actions:
|
|
17
|
+
* - under the title and description when orientation is `vertical`
|
|
18
|
+
* - next to the close button when orientation is `horizontal`
|
|
19
|
+
*/
|
|
20
|
+
actions?: ButtonProps[]
|
|
21
|
+
/**
|
|
22
|
+
* Display a close button to dismiss the alert.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
close?: ButtonProps | boolean
|
|
26
|
+
/**
|
|
27
|
+
* The icon displayed in the close button.
|
|
28
|
+
* @default app.icons.close
|
|
29
|
+
*/
|
|
30
|
+
closeIcon?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AlertEmits {
|
|
34
|
+
(event: 'update:open', value: boolean): void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AlertSlots {
|
|
38
|
+
prepend?: (props?: {}) => any
|
|
39
|
+
title?: (props?: {}) => any
|
|
40
|
+
description?: (props?: {}) => any
|
|
41
|
+
actions?: (props?: {}) => any
|
|
42
|
+
close?: (props: { ui: ComponentAttrs<typeof alert>['ui'] }) => any
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { Primitive } from 'reka-ui'
|
|
48
|
+
import { computed } from 'vue'
|
|
49
|
+
import { useTheme } from '../composables/useTheme'
|
|
50
|
+
import Button from './Button.vue'
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(defineProps<AlertProps>(), {
|
|
53
|
+
variant: 'solid',
|
|
54
|
+
orientation: 'vertical',
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const emit = defineEmits<AlertEmits>()
|
|
58
|
+
const slots = defineSlots<AlertSlots>()
|
|
59
|
+
|
|
60
|
+
const { theme, createStyler } = useTheme()
|
|
61
|
+
const style = computed(() => {
|
|
62
|
+
const styler = createStyler(theme.value.alert)
|
|
63
|
+
return styler({
|
|
64
|
+
...props,
|
|
65
|
+
title: !!props.title || !!slots.title,
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<Primitive
|
|
72
|
+
:as="props.as"
|
|
73
|
+
:data-orientation="props.orientation"
|
|
74
|
+
:class="style.root({ class: [props.class, props.ui?.root] })"
|
|
75
|
+
>
|
|
76
|
+
<slot name="prepend">
|
|
77
|
+
<i v-if="props.icon" :class="style.icon({ class: [props.icon, props.ui?.icon] })"></i>
|
|
78
|
+
</slot>
|
|
79
|
+
|
|
80
|
+
<div :class="style.wrapper({ class: props.ui?.wrapper })">
|
|
81
|
+
<div v-if="props.title || slots.title" :class="style.title({ class: props.ui?.title })">
|
|
82
|
+
<slot name="title">
|
|
83
|
+
{{ props.title }}
|
|
84
|
+
</slot>
|
|
85
|
+
</div>
|
|
86
|
+
<div v-if="props.description || slots.description" :class="style.description({ class: props.ui?.description })">
|
|
87
|
+
<slot name="description">
|
|
88
|
+
{{ props.description }}
|
|
89
|
+
</slot>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div v-if="props.orientation === 'vertical' && props.actions?.length" :class="style.actions({ class: props.ui?.actions })">
|
|
93
|
+
<slot name="actions">
|
|
94
|
+
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
95
|
+
</slot>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div v-if="(props.orientation === 'horizontal' && props.actions?.length) || props.close" :class="style.actions({ class: props.ui?.actions, orientation: 'horizontal' })">
|
|
100
|
+
<template v-if="props.orientation === 'horizontal' && props.actions?.length">
|
|
101
|
+
<slot name="actions">
|
|
102
|
+
<Button v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
103
|
+
</slot>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<slot name="close" :ui="props.ui">
|
|
107
|
+
<Button
|
|
108
|
+
v-if="props.close"
|
|
109
|
+
:icon="props.closeIcon || theme.app.icons.close"
|
|
110
|
+
size="md"
|
|
111
|
+
variant="link"
|
|
112
|
+
aria-label="Close"
|
|
113
|
+
v-bind="typeof props.close === 'object' ? props.close : undefined"
|
|
114
|
+
:class="style.close({ class: props.ui?.close })"
|
|
115
|
+
@click="emit('update:open', false)"
|
|
116
|
+
/>
|
|
117
|
+
</slot>
|
|
118
|
+
</div>
|
|
119
|
+
</Primitive>
|
|
120
|
+
</template>
|
|
@@ -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'> {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from '@byyuurin/ui-kit'
|
|
3
|
+
import type { PrimitiveProps } from 'reka-ui'
|
|
4
|
+
import type { badge } from '../theme'
|
|
5
|
+
import type { ComponentAttrs } from '../types'
|
|
6
|
+
|
|
7
|
+
type BadgeVariants = VariantProps<typeof badge>
|
|
8
|
+
|
|
9
|
+
export interface BadgeProps extends ComponentAttrs<typeof badge>, Pick<PrimitiveProps, 'as'> {
|
|
10
|
+
text?: string | number
|
|
11
|
+
size?: BadgeVariants['size']
|
|
12
|
+
position?: BadgeVariants['position']
|
|
13
|
+
show?: boolean
|
|
14
|
+
/** When `true`, keep the badge inside the component for rounded elements. */
|
|
15
|
+
inset?: boolean
|
|
16
|
+
/** When `true`, render the badge relatively to the parent. */
|
|
17
|
+
standalone?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BadgeEmits {
|
|
21
|
+
(e: 'update:show', payload: boolean): void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BadgeSlots {
|
|
25
|
+
default?: (props?: {}) => any
|
|
26
|
+
content?: (props?: {}) => any
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import { Primitive, Slot } from 'reka-ui'
|
|
32
|
+
import { computed } from 'vue'
|
|
33
|
+
import { useTheme } from '../composables/useTheme'
|
|
34
|
+
|
|
35
|
+
defineOptions({
|
|
36
|
+
inheritAttrs: false,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(defineProps<BadgeProps>(), {
|
|
40
|
+
position: 'top-right',
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
defineEmits<BadgeEmits>()
|
|
44
|
+
defineSlots<BadgeSlots>()
|
|
45
|
+
|
|
46
|
+
const show = defineModel<boolean>('show', { default: true })
|
|
47
|
+
|
|
48
|
+
const { theme, createStyler } = useTheme()
|
|
49
|
+
const style = computed(() => {
|
|
50
|
+
const styler = createStyler(theme.value.badge)
|
|
51
|
+
return styler(props)
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<Primitive
|
|
57
|
+
:as="props.as"
|
|
58
|
+
:class="style.root({ class: [props.class, props.ui?.root] })"
|
|
59
|
+
>
|
|
60
|
+
<Slot v-bind="$attrs">
|
|
61
|
+
<slot></slot>
|
|
62
|
+
</Slot>
|
|
63
|
+
|
|
64
|
+
<span v-if="show" :class="style.base({ class: props.ui?.base })">
|
|
65
|
+
<slot name="content">
|
|
66
|
+
{{ props.text }}
|
|
67
|
+
</slot>
|
|
68
|
+
</span>
|
|
69
|
+
</Primitive>
|
|
70
|
+
</template>
|
|
@@ -28,17 +28,19 @@ export interface ButtonProps extends Omit<ComponentAttrs<typeof button>, 'ui'>,
|
|
|
28
28
|
|
|
29
29
|
<script lang="ts" setup>
|
|
30
30
|
import { computed } from 'vue'
|
|
31
|
-
import {
|
|
31
|
+
import { useButtonGroup } from '../composables/useButtonGroup'
|
|
32
|
+
import { useComponentIcons } from '../composables/useComponentIcons'
|
|
33
|
+
import { useTheme } from '../composables/useTheme'
|
|
32
34
|
import { omit, pickLinkProps } from '../utils'
|
|
33
35
|
import Link from './Link.vue'
|
|
34
36
|
|
|
35
37
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
36
38
|
variant: 'solid',
|
|
37
|
-
size: 'md',
|
|
38
39
|
})
|
|
39
40
|
|
|
40
41
|
const slots = defineSlots<ButtonSlots>()
|
|
41
42
|
|
|
43
|
+
const { size, orientation } = useButtonGroup(props)
|
|
42
44
|
const { isPrefix, isSuffix, prefixIconName, suffixIconName } = useComponentIcons(
|
|
43
45
|
computed(() => ({ ...props, loading: props.loading })),
|
|
44
46
|
)
|
|
@@ -51,6 +53,8 @@ const style = computed(() => {
|
|
|
51
53
|
const styler = createStyler(theme.value.button)
|
|
52
54
|
return styler({
|
|
53
55
|
...props,
|
|
56
|
+
size: size.value,
|
|
57
|
+
groupOrientation: orientation.value,
|
|
54
58
|
prefix: isPrefix.value,
|
|
55
59
|
suffix: isSuffix.value,
|
|
56
60
|
class: [
|
|
@@ -77,7 +81,7 @@ const style = computed(() => {
|
|
|
77
81
|
></i>
|
|
78
82
|
</slot>
|
|
79
83
|
<span
|
|
80
|
-
v-if="
|
|
84
|
+
v-if="props.label || slots.default"
|
|
81
85
|
:class="style.label({ class: props.ui?.label })"
|
|
82
86
|
>
|
|
83
87
|
<slot>{{ label }}</slot>
|
|
@@ -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>
|
|
@@ -22,7 +22,7 @@ export interface CardSlots {
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
23
|
import { Primitive } from 'reka-ui'
|
|
24
24
|
import { computed } from 'vue'
|
|
25
|
-
import { useTheme } from '../composables'
|
|
25
|
+
import { useTheme } from '../composables/useTheme'
|
|
26
26
|
|
|
27
27
|
const props = withDefaults(defineProps<CardProps>(), {})
|
|
28
28
|
const slots = defineSlots<CardSlots>()
|
|
@@ -38,12 +38,12 @@ const style = computed(() => {
|
|
|
38
38
|
<Primitive :as="props.as" :class="style.root({ class: [props.class, props.ui?.root] })">
|
|
39
39
|
<slot name="content">
|
|
40
40
|
<div
|
|
41
|
-
v-if="slots.header ||
|
|
41
|
+
v-if="slots.header || props.title || slots.title || props.description || slots.description "
|
|
42
42
|
:class="style.header({ class: props.ui?.header })"
|
|
43
43
|
>
|
|
44
44
|
<slot name="header">
|
|
45
45
|
<Primitive
|
|
46
|
-
v-if="
|
|
46
|
+
v-if="props.title || slots.title"
|
|
47
47
|
:as="slots.title ? undefined : 'h2'"
|
|
48
48
|
:class="style.title({ class: props.ui?.title })"
|
|
49
49
|
>
|
|
@@ -52,7 +52,7 @@ const style = computed(() => {
|
|
|
52
52
|
</slot>
|
|
53
53
|
</Primitive>
|
|
54
54
|
<Primitive
|
|
55
|
-
v-if="
|
|
55
|
+
v-if="props.description || slots.description"
|
|
56
56
|
:as="slots.description ? undefined : 'p'"
|
|
57
57
|
:as-child="!!slots.description"
|
|
58
58
|
:class="style.description({ class: props.ui?.description })"
|