@nuxt/ui 3.0.0-alpha.8 → 3.0.0-beta.1
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/.nuxt/ui/accordion.ts +2 -2
- package/.nuxt/ui/alert.ts +122 -95
- package/.nuxt/ui/avatar-group.ts +14 -2
- package/.nuxt/ui/avatar.ts +16 -4
- package/.nuxt/ui/badge.ts +139 -93
- package/.nuxt/ui/breadcrumb.ts +5 -5
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +167 -136
- package/.nuxt/ui/calendar.ts +103 -0
- package/.nuxt/ui/card.ts +27 -1
- package/.nuxt/ui/carousel.ts +9 -7
- package/.nuxt/ui/checkbox.ts +45 -27
- package/.nuxt/ui/chip.ts +44 -15
- package/.nuxt/ui/color-picker.ts +47 -0
- package/.nuxt/ui/command-palette.ts +28 -18
- package/.nuxt/ui/container.ts +1 -1
- package/.nuxt/ui/context-menu.ts +64 -46
- package/.nuxt/ui/drawer.ts +83 -15
- package/.nuxt/ui/dropdown-menu.ts +65 -47
- package/.nuxt/ui/form-field.ts +15 -7
- package/.nuxt/ui/index.ts +7 -1
- package/.nuxt/ui/input-menu.ts +150 -116
- package/.nuxt/ui/input-number.ts +235 -0
- package/.nuxt/ui/input.ts +111 -76
- package/.nuxt/ui/kbd.ts +18 -6
- package/.nuxt/ui/link.ts +3 -3
- package/.nuxt/ui/modal.ts +8 -7
- package/.nuxt/ui/navigation-menu.ts +244 -131
- package/.nuxt/ui/pin-input.ts +171 -0
- package/.nuxt/ui/popover.ts +2 -2
- package/.nuxt/ui/progress.ts +111 -72
- package/.nuxt/ui/radio-group.ts +45 -22
- package/.nuxt/ui/select-menu.ts +127 -96
- package/.nuxt/ui/select.ts +120 -84
- package/.nuxt/ui/separator.ts +60 -31
- package/.nuxt/ui/skeleton.ts +1 -1
- package/.nuxt/ui/slideover.ts +17 -9
- package/.nuxt/ui/slider.ts +61 -38
- package/.nuxt/ui/stepper.ts +202 -0
- package/.nuxt/ui/switch.ts +40 -22
- package/.nuxt/ui/table.ts +49 -31
- package/.nuxt/ui/tabs.ts +101 -73
- package/.nuxt/ui/textarea.ts +111 -76
- package/.nuxt/ui/toast.ts +53 -33
- package/.nuxt/ui/toaster.ts +31 -15
- package/.nuxt/ui/tooltip.ts +2 -2
- package/.nuxt/ui/tree.ts +154 -0
- package/.nuxt/ui.css +92 -0
- package/README.md +69 -18
- package/cli/commands/{init.mjs → make/component.mjs} +16 -4
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +2 -2
- package/cli/package.json +2 -2
- package/cli/templates.mjs +62 -12
- package/cli/utils.mjs +14 -0
- package/dist/module.cjs +9 -170
- package/dist/module.d.cts +5 -15
- package/dist/module.d.mts +5 -15
- package/dist/module.d.ts +5 -15
- package/dist/module.json +2 -2
- package/dist/module.mjs +12 -167
- package/dist/runtime/components/Accordion.vue +8 -39
- package/dist/runtime/components/Alert.vue +25 -21
- package/dist/runtime/components/App.vue +15 -15
- package/dist/runtime/components/Avatar.vue +33 -21
- package/dist/runtime/components/AvatarGroup.vue +5 -7
- package/dist/runtime/components/Badge.vue +10 -8
- package/dist/runtime/components/Breadcrumb.vue +13 -34
- package/dist/runtime/components/Button.vue +5 -8
- package/dist/runtime/components/ButtonGroup.vue +5 -7
- package/dist/runtime/components/Calendar.vue +194 -0
- package/dist/runtime/components/Card.vue +10 -9
- package/dist/runtime/components/Carousel.vue +26 -17
- package/dist/runtime/components/Checkbox.vue +32 -38
- package/dist/runtime/components/Chip.vue +6 -8
- package/dist/runtime/components/Collapsible.vue +10 -11
- package/dist/runtime/components/ColorPicker.vue +297 -0
- package/dist/runtime/components/CommandPalette.vue +114 -98
- package/dist/runtime/components/Container.vue +4 -7
- package/dist/runtime/components/ContextMenu.vue +16 -69
- package/dist/runtime/components/ContextMenuContent.vue +14 -10
- package/dist/runtime/components/Drawer.vue +23 -12
- package/dist/runtime/components/DropdownMenu.vue +18 -59
- package/dist/runtime/components/DropdownMenuContent.vue +14 -10
- package/dist/runtime/components/Form.vue +78 -49
- package/dist/runtime/components/FormField.vue +28 -15
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +15 -7
- package/dist/runtime/components/InputMenu.vue +133 -66
- package/dist/runtime/components/InputNumber.vue +197 -0
- package/dist/runtime/components/Kbd.vue +5 -6
- package/dist/runtime/components/Link.vue +24 -13
- package/dist/runtime/components/LinkBase.vue +1 -1
- package/dist/runtime/components/Modal.vue +56 -34
- package/dist/runtime/components/NavigationMenu.vue +129 -112
- package/dist/runtime/components/OverlayProvider.vue +28 -0
- package/dist/runtime/components/Pagination.vue +18 -14
- package/dist/runtime/components/PinInput.vue +95 -0
- package/dist/runtime/components/Popover.vue +28 -14
- package/dist/runtime/components/Progress.vue +28 -12
- package/dist/runtime/components/RadioGroup.vue +9 -12
- package/dist/runtime/components/Select.vue +61 -35
- package/dist/runtime/components/SelectMenu.vue +201 -130
- package/dist/runtime/components/Separator.vue +6 -5
- package/dist/runtime/components/Skeleton.vue +4 -7
- package/dist/runtime/components/Slideover.vue +56 -33
- package/dist/runtime/components/Slider.vue +8 -7
- package/dist/runtime/components/Stepper.vue +170 -0
- package/dist/runtime/components/Switch.vue +19 -23
- package/dist/runtime/components/Table.vue +157 -32
- package/dist/runtime/components/Tabs.vue +12 -31
- package/dist/runtime/components/Textarea.vue +18 -9
- package/dist/runtime/components/Toast.vue +39 -25
- package/dist/runtime/components/Toaster.vue +31 -24
- package/dist/runtime/components/Tooltip.vue +9 -12
- package/dist/runtime/components/Tree.vue +196 -0
- package/dist/runtime/composables/defineLocale.d.ts +9 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +2 -2
- package/dist/runtime/composables/useFormField.d.ts +11 -4
- package/dist/runtime/composables/useFormField.js +19 -9
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/composables/useOverlay.d.ts +30 -0
- package/dist/runtime/composables/useOverlay.js +70 -0
- package/dist/runtime/composables/useToast.d.ts +4 -3
- package/dist/runtime/composables/useToast.js +20 -6
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/keyframes.css +1 -1
- package/dist/runtime/locale/ar.d.ts +2 -0
- package/dist/runtime/locale/ar.js +55 -0
- package/dist/runtime/locale/az.d.ts +2 -0
- package/dist/runtime/locale/az.js +54 -0
- package/dist/runtime/locale/bn.d.ts +2 -0
- package/dist/runtime/locale/bn.js +54 -0
- package/dist/runtime/locale/cs.d.ts +2 -0
- package/dist/runtime/locale/cs.js +54 -0
- package/dist/runtime/locale/da.d.ts +2 -0
- package/dist/runtime/locale/da.js +54 -0
- package/dist/runtime/locale/de.d.ts +2 -0
- package/dist/runtime/locale/de.js +54 -0
- package/dist/runtime/locale/el.d.ts +2 -0
- package/dist/runtime/locale/el.js +54 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +54 -0
- package/dist/runtime/locale/es.d.ts +2 -0
- package/dist/runtime/locale/es.js +54 -0
- package/dist/runtime/locale/et.d.ts +2 -0
- package/dist/runtime/locale/et.js +54 -0
- package/dist/runtime/locale/fa_ir.d.ts +2 -0
- package/dist/runtime/locale/fa_ir.js +55 -0
- package/dist/runtime/locale/fi.d.ts +2 -0
- package/dist/runtime/locale/fi.js +54 -0
- package/dist/runtime/locale/fr.d.ts +2 -0
- package/dist/runtime/locale/fr.js +54 -0
- package/dist/runtime/locale/he.d.ts +2 -0
- package/dist/runtime/locale/he.js +53 -0
- package/dist/runtime/locale/hi.d.ts +2 -0
- package/dist/runtime/locale/hi.js +54 -0
- package/dist/runtime/locale/hu.d.ts +2 -0
- package/dist/runtime/locale/hu.js +54 -0
- package/dist/runtime/locale/id.d.ts +2 -0
- package/dist/runtime/locale/id.js +54 -0
- package/dist/runtime/locale/index.d.ts +34 -0
- package/dist/runtime/locale/index.js +34 -0
- package/dist/runtime/locale/it.d.ts +2 -0
- package/dist/runtime/locale/it.js +54 -0
- package/dist/runtime/locale/ja.d.ts +2 -0
- package/dist/runtime/locale/ja.js +54 -0
- package/dist/runtime/locale/km.d.ts +2 -0
- package/dist/runtime/locale/km.js +54 -0
- package/dist/runtime/locale/ko.d.ts +2 -0
- package/dist/runtime/locale/ko.js +54 -0
- package/dist/runtime/locale/nb_no.d.ts +2 -0
- package/dist/runtime/locale/nb_no.js +54 -0
- package/dist/runtime/locale/nl.d.ts +2 -0
- package/dist/runtime/locale/nl.js +54 -0
- package/dist/runtime/locale/pl.d.ts +2 -0
- package/dist/runtime/locale/pl.js +54 -0
- package/dist/runtime/locale/pt.d.ts +2 -0
- package/dist/runtime/locale/pt.js +54 -0
- package/dist/runtime/locale/pt_br.d.ts +2 -0
- package/dist/runtime/locale/pt_br.js +54 -0
- package/dist/runtime/locale/ru.d.ts +2 -0
- package/dist/runtime/locale/ru.js +54 -0
- package/dist/runtime/locale/sk.d.ts +2 -0
- package/dist/runtime/locale/sk.js +54 -0
- package/dist/runtime/locale/sv.d.ts +2 -0
- package/dist/runtime/locale/sv.js +54 -0
- package/dist/runtime/locale/th.d.ts +2 -0
- package/dist/runtime/locale/th.js +54 -0
- package/dist/runtime/locale/tr.d.ts +2 -0
- package/dist/runtime/locale/tr.js +54 -0
- package/dist/runtime/locale/uk.d.ts +2 -0
- package/dist/runtime/locale/uk.js +54 -0
- package/dist/runtime/locale/vi.d.ts +2 -0
- package/dist/runtime/locale/vi.js +54 -0
- package/dist/runtime/locale/zh_cn.d.ts +2 -0
- package/dist/runtime/locale/zh_cn.js +54 -0
- package/dist/runtime/locale/zh_tw.d.ts +2 -0
- package/dist/runtime/locale/zh_tw.js +54 -0
- package/dist/runtime/plugins/colors.js +8 -5
- package/dist/runtime/types/form.d.ts +29 -15
- package/dist/runtime/types/form.js +2 -2
- package/dist/runtime/types/index.d.ts +8 -0
- package/dist/runtime/types/index.js +8 -0
- package/dist/runtime/types/locale.d.ts +56 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/utils.d.ts +7 -3
- package/dist/runtime/utils/form.d.ts +5 -9
- package/dist/runtime/utils/form.js +113 -50
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +15 -2
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/components/Icon.vue +2 -2
- package/dist/runtime/vue/components/Link.vue +87 -23
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +2 -0
- package/dist/runtime/vue/plugins/head.d.ts +1 -1
- package/dist/runtime/vue/plugins/head.js +3 -3
- package/dist/runtime/vue/stubs.d.ts +19 -0
- package/dist/runtime/vue/stubs.js +37 -0
- package/dist/shared/{ui.BufKhDiD.mjs → ui.DSPu6Y8j.mjs} +1071 -409
- package/dist/shared/{ui.BU7wzH0D.cjs → ui.DfK2RX6G.cjs} +1074 -409
- package/dist/unplugin.cjs +62 -26
- package/dist/unplugin.d.cts +17 -3
- package/dist/unplugin.d.mts +17 -3
- package/dist/unplugin.d.ts +17 -3
- package/dist/unplugin.mjs +61 -25
- package/dist/vite.cjs +3 -2
- package/dist/vite.d.cts +2 -0
- package/dist/vite.d.mts +2 -0
- package/dist/vite.d.ts +2 -0
- package/dist/vite.mjs +3 -2
- package/package.json +110 -67
- package/dist/chunks/component-meta.cjs +0 -73264
- package/dist/chunks/component-meta.mjs +0 -73262
- package/dist/client/devtools/200.html +0 -1
- package/dist/client/devtools/404.html +0 -1
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
- package/dist/client/devtools/_nuxt/Bj9hdafK.js +0 -1
- package/dist/client/devtools/_nuxt/DM3_wAgz.js +0 -62
- package/dist/client/devtools/_nuxt/builds/latest.json +0 -1
- package/dist/client/devtools/_nuxt/builds/meta/e6b425f7-b919-4014-915b-0ea07c316790.json +0 -1
- package/dist/client/devtools/_nuxt/entry.DaJP-ZMB.css +0 -24
- package/dist/client/devtools/_nuxt/error-404.B0Nmv3fV.css +0 -1
- package/dist/client/devtools/_nuxt/error-500.C8fgTxVz.css +0 -1
- package/dist/client/devtools/_nuxt/hKiujHsR.js +0 -1
- package/dist/client/devtools/favicon.svg +0 -1
- package/dist/client/devtools/index.html +0 -1
- package/dist/devtools/runtime/DevtoolsRenderer.vue +0 -53
- package/dist/devtools/runtime/examples/AvatarGroupExample.vue +0 -7
- package/dist/devtools/runtime/examples/ButtonGroupExample.vue +0 -8
- package/dist/devtools/runtime/examples/CardExample.vue +0 -13
- package/dist/devtools/runtime/examples/CarouselExample.vue +0 -13
- package/dist/devtools/runtime/examples/ChipExample.vue +0 -5
- package/dist/devtools/runtime/examples/CollapsibleExample.vue +0 -8
- package/dist/devtools/runtime/examples/CommandPaletteExample.vue +0 -29
- package/dist/devtools/runtime/examples/ContainerExample.vue +0 -5
- package/dist/devtools/runtime/examples/ContextMenuExample.vue +0 -5
- package/dist/devtools/runtime/examples/DrawerExample.vue +0 -8
- package/dist/devtools/runtime/examples/DropdownMenuExample.vue +0 -5
- package/dist/devtools/runtime/examples/FormExample.vue +0 -30
- package/dist/devtools/runtime/examples/FormFieldExample.vue +0 -5
- package/dist/devtools/runtime/examples/LinkExample.vue +0 -5
- package/dist/devtools/runtime/examples/ModalExample.vue +0 -8
- package/dist/devtools/runtime/examples/PopoverExample.vue +0 -8
- package/dist/devtools/runtime/examples/SkeletonExample.vue +0 -3
- package/dist/devtools/runtime/examples/SlideoverExample.vue +0 -8
- package/dist/devtools/runtime/examples/ToasterExample.vue +0 -11
- package/dist/devtools/runtime/examples/TooltipExample.vue +0 -5
- package/dist/runtime/components/ModalProvider.vue +0 -12
- package/dist/runtime/components/SlideoverProvider.vue +0 -12
- package/dist/runtime/composables/extendDevtoolsMeta.d.ts +0 -7
- package/dist/runtime/composables/extendDevtoolsMeta.js +0 -2
- package/dist/runtime/composables/useModal.d.ts +0 -17
- package/dist/runtime/composables/useModal.js +0 -46
- package/dist/runtime/composables/useSlideover.d.ts +0 -17
- package/dist/runtime/composables/useSlideover.js +0 -46
- package/dist/runtime/plugins/modal.d.ts +0 -2
- package/dist/runtime/plugins/modal.js +0 -10
- package/dist/runtime/plugins/slideover.d.ts +0 -2
- package/dist/runtime/plugins/slideover.js +0 -10
|
@@ -3,21 +3,26 @@ import 'node:url';
|
|
|
3
3
|
import { kebabCase } from 'scule';
|
|
4
4
|
import { addTypeTemplate, addTemplate } from '@nuxt/kit';
|
|
5
5
|
import { defuFn, defu } from 'defu';
|
|
6
|
+
import colors from 'tailwindcss/colors';
|
|
6
7
|
|
|
7
8
|
const icons = {
|
|
9
|
+
arrowLeft: "i-lucide-arrow-left",
|
|
10
|
+
arrowRight: "i-lucide-arrow-right",
|
|
11
|
+
check: "i-lucide-check",
|
|
8
12
|
chevronDoubleLeft: "i-lucide-chevrons-left",
|
|
9
13
|
chevronDoubleRight: "i-lucide-chevrons-right",
|
|
10
14
|
chevronDown: "i-lucide-chevron-down",
|
|
11
15
|
chevronLeft: "i-lucide-chevron-left",
|
|
12
16
|
chevronRight: "i-lucide-chevron-right",
|
|
13
|
-
|
|
14
|
-
arrowRight: "i-lucide-arrow-right",
|
|
15
|
-
check: "i-lucide-check",
|
|
17
|
+
chevronUp: "i-lucide-chevron-up",
|
|
16
18
|
close: "i-lucide-x",
|
|
17
19
|
ellipsis: "i-lucide-ellipsis",
|
|
18
20
|
external: "i-lucide-arrow-up-right",
|
|
19
|
-
|
|
21
|
+
folder: "i-lucide-folder",
|
|
22
|
+
folderOpen: "i-lucide-folder-open",
|
|
23
|
+
loading: "i-lucide-refresh-cw",
|
|
20
24
|
minus: "i-lucide-minus",
|
|
25
|
+
plus: "i-lucide-plus",
|
|
21
26
|
search: "i-lucide-search"
|
|
22
27
|
};
|
|
23
28
|
|
|
@@ -38,11 +43,8 @@ const defaultOptions = {
|
|
|
38
43
|
fonts: true,
|
|
39
44
|
colorMode: true,
|
|
40
45
|
theme: {
|
|
41
|
-
colors:
|
|
46
|
+
colors: undefined,
|
|
42
47
|
transitions: true
|
|
43
|
-
},
|
|
44
|
-
devtools: {
|
|
45
|
-
enabled: true
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
const resolveColors = (colors) => {
|
|
@@ -52,9 +54,9 @@ const resolveColors = (colors) => {
|
|
|
52
54
|
const accordion = {
|
|
53
55
|
slots: {
|
|
54
56
|
root: "w-full",
|
|
55
|
-
item: "border-b border-
|
|
57
|
+
item: "border-b border-(--ui-border) last:border-b-0",
|
|
56
58
|
header: "flex",
|
|
57
|
-
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-
|
|
59
|
+
trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-(--ui-primary) min-w-0",
|
|
58
60
|
content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
|
|
59
61
|
body: "text-sm pb-3.5",
|
|
60
62
|
leadingIcon: "shrink-0 size-5",
|
|
@@ -73,14 +75,14 @@ const accordion = {
|
|
|
73
75
|
const alert = (options) => ({
|
|
74
76
|
slots: {
|
|
75
77
|
root: "relative overflow-hidden w-full rounded-[calc(var(--ui-radius)*2)] p-4 flex gap-2.5",
|
|
76
|
-
wrapper: "min-w-0 flex-1 flex flex-col
|
|
78
|
+
wrapper: "min-w-0 flex-1 flex flex-col",
|
|
77
79
|
title: "text-sm font-medium",
|
|
78
80
|
description: "text-sm opacity-90",
|
|
79
81
|
icon: "shrink-0 size-5",
|
|
80
82
|
avatar: "shrink-0",
|
|
81
83
|
avatarSize: "2xl",
|
|
82
|
-
actions: "flex gap-1.5 shrink-0",
|
|
83
|
-
close: "p-0
|
|
84
|
+
actions: "flex flex-wrap gap-1.5 shrink-0",
|
|
85
|
+
close: "p-0"
|
|
84
86
|
},
|
|
85
87
|
variants: {
|
|
86
88
|
color: {
|
|
@@ -93,14 +95,19 @@ const alert = (options) => ({
|
|
|
93
95
|
soft: "",
|
|
94
96
|
subtle: ""
|
|
95
97
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
root: "items-start",
|
|
99
|
-
actions: "items-start mt-1"
|
|
100
|
-
},
|
|
101
|
-
false: {
|
|
98
|
+
orientation: {
|
|
99
|
+
horizontal: {
|
|
102
100
|
root: "items-center",
|
|
103
101
|
actions: "items-center"
|
|
102
|
+
},
|
|
103
|
+
vertical: {
|
|
104
|
+
root: "items-start",
|
|
105
|
+
actions: "items-start mt-2.5"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
title: {
|
|
109
|
+
true: {
|
|
110
|
+
description: "mt-1"
|
|
104
111
|
}
|
|
105
112
|
}
|
|
106
113
|
},
|
|
@@ -108,49 +115,49 @@ const alert = (options) => ({
|
|
|
108
115
|
color,
|
|
109
116
|
variant: "solid",
|
|
110
117
|
class: {
|
|
111
|
-
root: `bg-
|
|
118
|
+
root: `bg-(--ui-${color}) text-(--ui-bg)`
|
|
112
119
|
}
|
|
113
120
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
114
121
|
color,
|
|
115
122
|
variant: "outline",
|
|
116
123
|
class: {
|
|
117
|
-
root: `text-
|
|
124
|
+
root: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
118
125
|
}
|
|
119
126
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
120
127
|
color,
|
|
121
128
|
variant: "soft",
|
|
122
129
|
class: {
|
|
123
|
-
root: `bg-
|
|
130
|
+
root: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
|
124
131
|
}
|
|
125
132
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
126
133
|
color,
|
|
127
134
|
variant: "subtle",
|
|
128
135
|
class: {
|
|
129
|
-
root: `bg-
|
|
136
|
+
root: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
130
137
|
}
|
|
131
138
|
})), {
|
|
132
139
|
color: "neutral",
|
|
133
140
|
variant: "solid",
|
|
134
141
|
class: {
|
|
135
|
-
root: "text-
|
|
142
|
+
root: "text-(--ui-bg) bg-(--ui-bg-inverted)"
|
|
136
143
|
}
|
|
137
144
|
}, {
|
|
138
145
|
color: "neutral",
|
|
139
146
|
variant: "outline",
|
|
140
147
|
class: {
|
|
141
|
-
root: "text-
|
|
148
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border)"
|
|
142
149
|
}
|
|
143
150
|
}, {
|
|
144
151
|
color: "neutral",
|
|
145
152
|
variant: "soft",
|
|
146
153
|
class: {
|
|
147
|
-
root: "text-
|
|
154
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50"
|
|
148
155
|
}
|
|
149
156
|
}, {
|
|
150
157
|
color: "neutral",
|
|
151
158
|
variant: "subtle",
|
|
152
159
|
class: {
|
|
153
|
-
root: "text-
|
|
160
|
+
root: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50 ring ring-inset ring-(--ui-border-accented)"
|
|
154
161
|
}
|
|
155
162
|
}],
|
|
156
163
|
defaultVariants: {
|
|
@@ -161,10 +168,10 @@ const alert = (options) => ({
|
|
|
161
168
|
|
|
162
169
|
const avatar = {
|
|
163
170
|
slots: {
|
|
164
|
-
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-
|
|
171
|
+
root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-(--ui-bg-elevated)",
|
|
165
172
|
image: "h-full w-full rounded-[inherit] object-cover",
|
|
166
|
-
fallback: "font-medium leading-none text-
|
|
167
|
-
icon: "text-
|
|
173
|
+
fallback: "font-medium leading-none text-(--ui-text-muted) truncate",
|
|
174
|
+
icon: "text-(--ui-text-muted) shrink-0"
|
|
168
175
|
},
|
|
169
176
|
variants: {
|
|
170
177
|
size: {
|
|
@@ -205,7 +212,7 @@ const avatar = {
|
|
|
205
212
|
const avatarGroup = {
|
|
206
213
|
slots: {
|
|
207
214
|
root: "inline-flex flex-row-reverse justify-end",
|
|
208
|
-
base: "relative rounded-full ring-
|
|
215
|
+
base: "relative rounded-full ring-(--ui-bg) first:me-0"
|
|
209
216
|
},
|
|
210
217
|
variants: {
|
|
211
218
|
size: {
|
|
@@ -243,9 +250,44 @@ const avatarGroup = {
|
|
|
243
250
|
}
|
|
244
251
|
};
|
|
245
252
|
|
|
253
|
+
const buttonGroupVariant = {
|
|
254
|
+
buttonGroup: {
|
|
255
|
+
horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
|
|
256
|
+
vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const buttonGroupVariantWithRoot = {
|
|
260
|
+
buttonGroup: {
|
|
261
|
+
horizontal: {
|
|
262
|
+
root: "group",
|
|
263
|
+
base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
|
|
264
|
+
},
|
|
265
|
+
vertical: {
|
|
266
|
+
root: "group",
|
|
267
|
+
base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const buttonGroup = {
|
|
272
|
+
base: "relative",
|
|
273
|
+
variants: {
|
|
274
|
+
size: {
|
|
275
|
+
xs: "",
|
|
276
|
+
sm: "",
|
|
277
|
+
md: "",
|
|
278
|
+
lg: "",
|
|
279
|
+
xl: ""
|
|
280
|
+
},
|
|
281
|
+
orientation: {
|
|
282
|
+
horizontal: "inline-flex -space-x-px",
|
|
283
|
+
vertical: "flex flex-col -space-y-px"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
246
288
|
const badge = (options) => ({
|
|
247
289
|
slots: {
|
|
248
|
-
base: "
|
|
290
|
+
base: "font-medium inline-flex items-center",
|
|
249
291
|
label: "truncate",
|
|
250
292
|
leadingIcon: "shrink-0",
|
|
251
293
|
leadingAvatar: "shrink-0",
|
|
@@ -253,6 +295,7 @@ const badge = (options) => ({
|
|
|
253
295
|
trailingIcon: "shrink-0"
|
|
254
296
|
},
|
|
255
297
|
variants: {
|
|
298
|
+
...buttonGroupVariant,
|
|
256
299
|
color: {
|
|
257
300
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
258
301
|
neutral: ""
|
|
@@ -264,58 +307,70 @@ const badge = (options) => ({
|
|
|
264
307
|
subtle: ""
|
|
265
308
|
},
|
|
266
309
|
size: {
|
|
310
|
+
xs: {
|
|
311
|
+
base: "text-[8px]/3 px-1 py-0.5 gap-1 rounded-[calc(var(--ui-radius))]",
|
|
312
|
+
leadingIcon: "size-3",
|
|
313
|
+
leadingAvatarSize: "3xs",
|
|
314
|
+
trailingIcon: "size-3"
|
|
315
|
+
},
|
|
267
316
|
sm: {
|
|
268
|
-
base: "text-
|
|
269
|
-
leadingIcon: "size-
|
|
317
|
+
base: "text-[10px]/3 px-1.5 py-1 gap-1 rounded-[calc(var(--ui-radius))]",
|
|
318
|
+
leadingIcon: "size-3",
|
|
270
319
|
leadingAvatarSize: "3xs",
|
|
271
|
-
trailingIcon: "size-
|
|
320
|
+
trailingIcon: "size-3"
|
|
272
321
|
},
|
|
273
322
|
md: {
|
|
274
|
-
base: "text-xs px-2 py-1 gap-1",
|
|
323
|
+
base: "text-xs px-2 py-1 gap-1 rounded-[calc(var(--ui-radius)*1.5)]",
|
|
275
324
|
leadingIcon: "size-4",
|
|
276
325
|
leadingAvatarSize: "3xs",
|
|
277
326
|
trailingIcon: "size-4"
|
|
278
327
|
},
|
|
279
328
|
lg: {
|
|
280
|
-
base: "text-sm px-2 py-1 gap-1.5",
|
|
329
|
+
base: "text-sm px-2 py-1 gap-1.5 rounded-[calc(var(--ui-radius)*1.5)]",
|
|
281
330
|
leadingIcon: "size-5",
|
|
282
331
|
leadingAvatarSize: "2xs",
|
|
283
332
|
trailingIcon: "size-5"
|
|
333
|
+
},
|
|
334
|
+
xl: {
|
|
335
|
+
base: "text-base px-2.5 py-1 gap-1.5 rounded-[calc(var(--ui-radius)*1.5)]",
|
|
336
|
+
leadingIcon: "size-6",
|
|
337
|
+
leadingAvatarSize: "2xs",
|
|
338
|
+
trailingIcon: "size-6"
|
|
284
339
|
}
|
|
285
340
|
}
|
|
286
341
|
},
|
|
287
342
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
288
343
|
color,
|
|
289
344
|
variant: "solid",
|
|
290
|
-
class: `bg-
|
|
345
|
+
class: `bg-(--ui-${color}) text-(--ui-bg)`
|
|
291
346
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
292
347
|
color,
|
|
293
348
|
variant: "outline",
|
|
294
|
-
class: `text-
|
|
349
|
+
class: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/50`
|
|
295
350
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
296
351
|
color,
|
|
297
352
|
variant: "soft",
|
|
298
|
-
class: `bg-
|
|
353
|
+
class: `bg-(--ui-${color})/10 text-(--ui-${color})`
|
|
299
354
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
300
355
|
color,
|
|
301
356
|
variant: "subtle",
|
|
302
|
-
class: `bg-
|
|
357
|
+
class: `bg-(--ui-${color})/10 text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25`
|
|
303
358
|
})), {
|
|
304
359
|
color: "neutral",
|
|
305
360
|
variant: "solid",
|
|
306
|
-
class: "text-
|
|
361
|
+
class: "text-(--ui-bg) bg-(--ui-bg-inverted)"
|
|
307
362
|
}, {
|
|
308
363
|
color: "neutral",
|
|
309
364
|
variant: "outline",
|
|
310
|
-
class: "ring ring-inset ring-
|
|
365
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg)"
|
|
311
366
|
}, {
|
|
312
367
|
color: "neutral",
|
|
313
368
|
variant: "soft",
|
|
314
|
-
class: "text-
|
|
369
|
+
class: "text-(--ui-text) bg-(--ui-bg-elevated)"
|
|
315
370
|
}, {
|
|
316
371
|
color: "neutral",
|
|
317
372
|
variant: "subtle",
|
|
318
|
-
class: "ring ring-inset ring-
|
|
373
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg-elevated)"
|
|
319
374
|
}],
|
|
320
375
|
defaultVariants: {
|
|
321
376
|
color: "primary",
|
|
@@ -329,21 +384,21 @@ const breadcrumb = (options) => ({
|
|
|
329
384
|
root: "relative min-w-0",
|
|
330
385
|
list: "flex items-center gap-1.5",
|
|
331
386
|
item: "flex min-w-0",
|
|
332
|
-
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-
|
|
387
|
+
link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-(--ui-primary)",
|
|
333
388
|
linkLeadingIcon: "shrink-0 size-5",
|
|
334
389
|
linkLeadingAvatar: "shrink-0",
|
|
335
390
|
linkLeadingAvatarSize: "2xs",
|
|
336
391
|
linkLabel: "truncate",
|
|
337
392
|
separator: "flex",
|
|
338
|
-
separatorIcon: "shrink-0 size-5 text-
|
|
393
|
+
separatorIcon: "shrink-0 size-5 text-(--ui-text-muted)"
|
|
339
394
|
},
|
|
340
395
|
variants: {
|
|
341
396
|
active: {
|
|
342
397
|
true: {
|
|
343
|
-
link: "text-
|
|
398
|
+
link: "text-(--ui-primary) font-semibold"
|
|
344
399
|
},
|
|
345
400
|
false: {
|
|
346
|
-
link: "text-
|
|
401
|
+
link: "text-(--ui-text-muted) font-medium"
|
|
347
402
|
}
|
|
348
403
|
},
|
|
349
404
|
disabled: {
|
|
@@ -360,49 +415,14 @@ const breadcrumb = (options) => ({
|
|
|
360
415
|
active: false,
|
|
361
416
|
to: true,
|
|
362
417
|
class: {
|
|
363
|
-
link: ["hover:text-
|
|
418
|
+
link: ["hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
364
419
|
}
|
|
365
420
|
}]
|
|
366
421
|
});
|
|
367
422
|
|
|
368
|
-
const buttonGroupVariant = {
|
|
369
|
-
buttonGroup: {
|
|
370
|
-
horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
|
|
371
|
-
vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
const buttonGroupVariantWithRoot = {
|
|
375
|
-
buttonGroup: {
|
|
376
|
-
horizontal: {
|
|
377
|
-
root: "group",
|
|
378
|
-
base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
|
|
379
|
-
},
|
|
380
|
-
vertical: {
|
|
381
|
-
root: "group",
|
|
382
|
-
base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
const buttonGroup = {
|
|
387
|
-
base: "relative",
|
|
388
|
-
variants: {
|
|
389
|
-
size: {
|
|
390
|
-
xs: "",
|
|
391
|
-
sm: "",
|
|
392
|
-
md: "",
|
|
393
|
-
lg: "",
|
|
394
|
-
xl: ""
|
|
395
|
-
},
|
|
396
|
-
orientation: {
|
|
397
|
-
horizontal: "inline-flex -space-x-px",
|
|
398
|
-
vertical: "flex flex-col -space-y-px"
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
423
|
const button = (options) => ({
|
|
404
424
|
slots: {
|
|
405
|
-
base: ["rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center focus:outline-
|
|
425
|
+
base: ["rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center focus:outline-hidden disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
406
426
|
label: "truncate",
|
|
407
427
|
leadingIcon: "shrink-0",
|
|
408
428
|
leadingAvatar: "shrink-0",
|
|
@@ -458,7 +478,6 @@ const button = (options) => ({
|
|
|
458
478
|
block: {
|
|
459
479
|
true: {
|
|
460
480
|
base: "w-full justify-center",
|
|
461
|
-
leadingAvatarSize: "xs",
|
|
462
481
|
trailingIcon: "ms-auto"
|
|
463
482
|
}
|
|
464
483
|
},
|
|
@@ -478,51 +497,51 @@ const button = (options) => ({
|
|
|
478
497
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
479
498
|
color,
|
|
480
499
|
variant: "solid",
|
|
481
|
-
class: `text-
|
|
500
|
+
class: `text-(--ui-bg) bg-(--ui-${color}) hover:bg-(--ui-${color})/75 disabled:bg-(--ui-${color}) aria-disabled:bg-(--ui-${color}) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-${color})`
|
|
482
501
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
483
502
|
color,
|
|
484
503
|
variant: "outline",
|
|
485
|
-
class: `ring ring-inset ring-
|
|
504
|
+
class: `ring ring-inset ring-(--ui-${color})/50 text-(--ui-${color}) hover:bg-(--ui-${color})/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-(--ui-${color})`
|
|
486
505
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
487
506
|
color,
|
|
488
507
|
variant: "soft",
|
|
489
|
-
class: `text-
|
|
508
|
+
class: `text-(--ui-${color}) bg-(--ui-${color})/10 hover:bg-(--ui-${color})/15 focus-visible:bg-(--ui-${color})/15 disabled:bg-(--ui-${color})/10 aria-disabled:bg-(--ui-${color})/10`
|
|
490
509
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
491
510
|
color,
|
|
492
511
|
variant: "subtle",
|
|
493
|
-
class: `text-
|
|
512
|
+
class: `text-(--ui-${color}) ring ring-inset ring-(--ui-${color})/25 bg-(--ui-${color})/10 hover:bg-(--ui-${color})/15 disabled:bg-(--ui-${color})/10 aria-disabled:bg-(--ui-${color})/10 focus-visible:ring-2 focus-visible:ring-(--ui-${color})`
|
|
494
513
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
495
514
|
color,
|
|
496
515
|
variant: "ghost",
|
|
497
|
-
class: `text-
|
|
516
|
+
class: `text-(--ui-${color}) hover:bg-(--ui-${color})/10 focus-visible:bg-(--ui-${color})/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
|
|
498
517
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
499
518
|
color,
|
|
500
519
|
variant: "link",
|
|
501
|
-
class: `text-
|
|
520
|
+
class: `text-(--ui-${color}) hover:text-(--ui-${color})/75 disabled:text-(--ui-${color}) aria-disabled:text-(--ui-${color}) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
502
521
|
})), {
|
|
503
522
|
color: "neutral",
|
|
504
523
|
variant: "solid",
|
|
505
|
-
class: "text-
|
|
524
|
+
class: "text-(--ui-bg) bg-(--ui-bg-inverted) hover:bg-(--ui-bg-inverted)/90 disabled:bg-(--ui-bg-inverted) aria-disabled:bg-(--ui-bg-inverted) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-border-inverted)"
|
|
506
525
|
}, {
|
|
507
526
|
color: "neutral",
|
|
508
527
|
variant: "outline",
|
|
509
|
-
class: "ring ring-inset ring-
|
|
528
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg) hover:bg-(--ui-bg-elevated) disabled:bg-(--ui-bg) aria-disabled:bg-(--ui-bg) focus-visible:ring-2 focus-visible:ring-(--ui-border-inverted)"
|
|
510
529
|
}, {
|
|
511
530
|
color: "neutral",
|
|
512
531
|
variant: "soft",
|
|
513
|
-
class: "text-
|
|
532
|
+
class: "text-(--ui-text) bg-(--ui-bg-elevated) hover:bg-(--ui-bg-accented)/75 focus-visible:bg-(--ui-bg-accented)/75 disabled:bg-(--ui-bg-elevated) aria-disabled:bg-(--ui-bg-elevated)"
|
|
514
533
|
}, {
|
|
515
534
|
color: "neutral",
|
|
516
535
|
variant: "subtle",
|
|
517
|
-
class: "ring ring-inset ring-
|
|
536
|
+
class: "ring ring-inset ring-(--ui-border-accented) text-(--ui-text) bg-(--ui-bg-elevated) hover:bg-(--ui-bg-accented)/75 disabled:bg-(--ui-bg-elevated) aria-disabled:bg-(--ui-bg-elevated) focus-visible:ring-2 focus-visible:ring-(--ui-border-inverted)"
|
|
518
537
|
}, {
|
|
519
538
|
color: "neutral",
|
|
520
539
|
variant: "ghost",
|
|
521
|
-
class: "text-
|
|
540
|
+
class: "text-(--ui-text) hover:bg-(--ui-bg-elevated) focus-visible:bg-(--ui-bg-elevated) hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
|
|
522
541
|
}, {
|
|
523
542
|
color: "neutral",
|
|
524
543
|
variant: "link",
|
|
525
|
-
class: "text-
|
|
544
|
+
class: "text-(--ui-text-muted) hover:text-(--ui-text) disabled:text-(--ui-text-muted) aria-disabled:text-(--ui-text-muted) focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-(--ui-border-inverted)"
|
|
526
545
|
}, {
|
|
527
546
|
size: "xs",
|
|
528
547
|
square: true,
|
|
@@ -564,12 +583,94 @@ const button = (options) => ({
|
|
|
564
583
|
}
|
|
565
584
|
});
|
|
566
585
|
|
|
586
|
+
const calendar = (options) => ({
|
|
587
|
+
slots: {
|
|
588
|
+
root: "",
|
|
589
|
+
header: "flex items-center justify-between",
|
|
590
|
+
body: "flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0",
|
|
591
|
+
heading: "text-center font-medium truncate mx-auto",
|
|
592
|
+
grid: "w-full border-collapse select-none space-y-1 focus:outline-none",
|
|
593
|
+
gridRow: "grid grid-cols-7",
|
|
594
|
+
gridWeekDaysRow: "mb-1 grid w-full grid-cols-7",
|
|
595
|
+
gridBody: "grid",
|
|
596
|
+
headCell: "rounded-[calc(var(--ui-radius)*1.5)]",
|
|
597
|
+
cell: "relative text-center",
|
|
598
|
+
cellTrigger: ["m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-(--ui-text-muted) data-unavailable:line-through data-unavailable:text-(--ui-text-muted) data-unavailable:pointer-events-none data-[selected]:text-(--ui-bg) data-today:font-semibold", options.theme.transitions && "transition"]
|
|
599
|
+
},
|
|
600
|
+
variants: {
|
|
601
|
+
color: {
|
|
602
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
603
|
+
headCell: `text-(--ui-${color})`,
|
|
604
|
+
cellTrigger: `focus-visible:ring-(--ui-${color}) data-[selected]:bg-(--ui-${color}) data-today:not-data-[selected]:text-(--ui-${color}) data-[highlighted]:bg-(--ui-${color})/20 hover:not-data-[selected]:bg-(--ui-${color})/20`
|
|
605
|
+
}])),
|
|
606
|
+
neutral: {
|
|
607
|
+
headCell: "text-(--ui-bg-inverted)",
|
|
608
|
+
cellTrigger: "focus-visible:ring-(--ui-border-inverted) data-[selected]:bg-(--ui-bg-inverted) data-today:not-data-[selected]:text-(--ui-bg-inverted) data-[highlighted]:bg-(--ui-bg-inverted)/20 hover:not-data-[selected]:bg-(--ui-bg-inverted)/10"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
size: {
|
|
612
|
+
xs: {
|
|
613
|
+
heading: "text-xs",
|
|
614
|
+
cell: "text-xs",
|
|
615
|
+
headCell: "text-[10px]",
|
|
616
|
+
cellTrigger: "size-7",
|
|
617
|
+
body: "space-y-2 pt-2"
|
|
618
|
+
},
|
|
619
|
+
sm: {
|
|
620
|
+
heading: "text-xs",
|
|
621
|
+
headCell: "text-xs",
|
|
622
|
+
cell: "text-xs",
|
|
623
|
+
cellTrigger: "size-7"
|
|
624
|
+
},
|
|
625
|
+
md: {
|
|
626
|
+
heading: "text-sm",
|
|
627
|
+
headCell: "text-xs",
|
|
628
|
+
cell: "text-sm",
|
|
629
|
+
cellTrigger: "size-8"
|
|
630
|
+
},
|
|
631
|
+
lg: {
|
|
632
|
+
heading: "text-md",
|
|
633
|
+
headCell: "text-md",
|
|
634
|
+
cellTrigger: "size-9 text-md"
|
|
635
|
+
},
|
|
636
|
+
xl: {
|
|
637
|
+
heading: "text-lg",
|
|
638
|
+
headCell: "text-lg",
|
|
639
|
+
cellTrigger: "size-10 text-lg"
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
defaultVariants: {
|
|
644
|
+
size: "md",
|
|
645
|
+
color: "primary"
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
567
649
|
const card = {
|
|
568
650
|
slots: {
|
|
569
|
-
root: "
|
|
651
|
+
root: "rounded-[calc(var(--ui-radius)*2)]",
|
|
570
652
|
header: "p-4 sm:px-6",
|
|
571
653
|
body: "p-4 sm:p-6",
|
|
572
654
|
footer: "p-4 sm:px-6"
|
|
655
|
+
},
|
|
656
|
+
variants: {
|
|
657
|
+
variant: {
|
|
658
|
+
solid: {
|
|
659
|
+
root: "bg-(--ui-bg-inverted) text-(--ui-bg)"
|
|
660
|
+
},
|
|
661
|
+
outline: {
|
|
662
|
+
root: "bg-(--ui-bg) ring ring-(--ui-border) divide-y divide-(--ui-border)"
|
|
663
|
+
},
|
|
664
|
+
soft: {
|
|
665
|
+
root: "bg-(--ui-bg-elevated)/50 divide-y divide-(--ui-border)"
|
|
666
|
+
},
|
|
667
|
+
subtle: {
|
|
668
|
+
root: "bg-(--ui-bg-elevated)/50 ring ring-(--ui-border) divide-y divide-(--ui-border)"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
defaultVariants: {
|
|
673
|
+
variant: "outline"
|
|
573
674
|
}
|
|
574
675
|
};
|
|
575
676
|
|
|
@@ -584,15 +685,15 @@ const carousel = (options) => ({
|
|
|
584
685
|
prev: "absolute rounded-full",
|
|
585
686
|
next: "absolute rounded-full",
|
|
586
687
|
dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
|
|
587
|
-
dot: ["cursor-pointer size-3 bg-
|
|
688
|
+
dot: ["cursor-pointer size-3 bg-(--ui-border-accented) rounded-full", options.theme.transitions && "transition"]
|
|
588
689
|
},
|
|
589
690
|
variants: {
|
|
590
691
|
orientation: {
|
|
591
692
|
vertical: {
|
|
592
693
|
container: "flex-col -mt-4",
|
|
593
694
|
item: "pt-4",
|
|
594
|
-
prev: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
595
|
-
next: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"
|
|
695
|
+
prev: "-top-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90",
|
|
696
|
+
next: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90"
|
|
596
697
|
},
|
|
597
698
|
horizontal: {
|
|
598
699
|
container: "flex-row -ms-4",
|
|
@@ -603,29 +704,26 @@ const carousel = (options) => ({
|
|
|
603
704
|
},
|
|
604
705
|
active: {
|
|
605
706
|
true: {
|
|
606
|
-
dot: "bg-
|
|
707
|
+
dot: "bg-(--ui-border-inverted)"
|
|
607
708
|
}
|
|
608
709
|
}
|
|
609
|
-
},
|
|
610
|
-
defaultVariants: {
|
|
611
|
-
orientation: "horizontal"
|
|
612
710
|
}
|
|
613
711
|
});
|
|
614
712
|
|
|
615
713
|
const checkbox = (options) => ({
|
|
616
714
|
slots: {
|
|
617
715
|
root: "relative flex items-start",
|
|
618
|
-
base: "shrink-0 flex items-center justify-center rounded-
|
|
716
|
+
base: "shrink-0 flex items-center justify-center rounded-(--ui-radius) text-(--ui-bg) ring ring-inset ring-(--ui-border-accented) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
619
717
|
container: "flex items-center",
|
|
620
718
|
wrapper: "ms-2",
|
|
621
719
|
icon: "shrink-0 size-full",
|
|
622
|
-
label: "block font-medium text-
|
|
623
|
-
description: "text-
|
|
720
|
+
label: "block font-medium text-(--ui-text)",
|
|
721
|
+
description: "text-(--ui-text-muted)"
|
|
624
722
|
},
|
|
625
723
|
variants: {
|
|
626
724
|
color: {
|
|
627
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-
|
|
628
|
-
neutral: "focus-visible:outline-
|
|
725
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-(--ui-${color})`])),
|
|
726
|
+
neutral: "focus-visible:outline-(--ui-border-inverted)"
|
|
629
727
|
},
|
|
630
728
|
size: {
|
|
631
729
|
xs: {
|
|
@@ -656,7 +754,7 @@ const checkbox = (options) => ({
|
|
|
656
754
|
},
|
|
657
755
|
required: {
|
|
658
756
|
true: {
|
|
659
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
757
|
+
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
660
758
|
}
|
|
661
759
|
},
|
|
662
760
|
disabled: {
|
|
@@ -673,11 +771,11 @@ const checkbox = (options) => ({
|
|
|
673
771
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
674
772
|
color,
|
|
675
773
|
checked: true,
|
|
676
|
-
class: `ring-2 ring-
|
|
774
|
+
class: `ring-2 ring-(--ui-${color}) bg-(--ui-${color})`
|
|
677
775
|
})), {
|
|
678
776
|
color: "neutral",
|
|
679
777
|
checked: true,
|
|
680
|
-
class: "ring-2 ring-
|
|
778
|
+
class: "ring-2 ring-(--ui-border-inverted) bg-(--ui-bg-inverted)"
|
|
681
779
|
}],
|
|
682
780
|
defaultVariants: {
|
|
683
781
|
size: "md",
|
|
@@ -688,12 +786,12 @@ const checkbox = (options) => ({
|
|
|
688
786
|
const chip = (options) => ({
|
|
689
787
|
slots: {
|
|
690
788
|
root: "relative inline-flex items-center justify-center shrink-0",
|
|
691
|
-
base: "rounded-full ring ring-
|
|
789
|
+
base: "rounded-full ring ring-(--ui-bg) flex items-center justify-center text-(--ui-bg) font-medium whitespace-nowrap"
|
|
692
790
|
},
|
|
693
791
|
variants: {
|
|
694
792
|
color: {
|
|
695
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-
|
|
696
|
-
neutral: "bg-
|
|
793
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-(--ui-${color})`])),
|
|
794
|
+
neutral: "bg-(--ui-text-muted)"
|
|
697
795
|
},
|
|
698
796
|
size: {
|
|
699
797
|
"3xs": "h-[4px] min-w-[4px] text-[4px]",
|
|
@@ -750,33 +848,83 @@ const collapsible = {
|
|
|
750
848
|
}
|
|
751
849
|
};
|
|
752
850
|
|
|
851
|
+
const colorPicker = {
|
|
852
|
+
slots: {
|
|
853
|
+
root: "data-[disabled]:opacity-75",
|
|
854
|
+
picker: "flex gap-4",
|
|
855
|
+
selector: "rounded-[calc(var(--ui-radius)*1.5)]",
|
|
856
|
+
selectorBackground: "w-full h-full relative rounded-[calc(var(--ui-radius)*1.2)]",
|
|
857
|
+
selectorThumb: "-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-(--color-white) rounded-full cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
858
|
+
track: "w-[8px] relative rounded-[calc(var(--ui-radius)*1.5)]",
|
|
859
|
+
trackThumb: "absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-(--color-white) cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
860
|
+
},
|
|
861
|
+
variants: {
|
|
862
|
+
size: {
|
|
863
|
+
xs: {
|
|
864
|
+
selector: "w-38 h-38",
|
|
865
|
+
track: "h-38"
|
|
866
|
+
},
|
|
867
|
+
sm: {
|
|
868
|
+
selector: "w-40 h-40",
|
|
869
|
+
track: "h-40"
|
|
870
|
+
},
|
|
871
|
+
md: {
|
|
872
|
+
selector: "w-42 h-42",
|
|
873
|
+
track: "h-42"
|
|
874
|
+
},
|
|
875
|
+
lg: {
|
|
876
|
+
selector: "w-44 h-44",
|
|
877
|
+
track: "h-44"
|
|
878
|
+
},
|
|
879
|
+
xl: {
|
|
880
|
+
selector: "w-46 h-46",
|
|
881
|
+
track: "h-46"
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
compoundVariants: [],
|
|
886
|
+
defaultVariants: {
|
|
887
|
+
size: "md"
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
|
|
753
891
|
const commandPalette = (options) => ({
|
|
754
892
|
slots: {
|
|
755
|
-
root: "flex flex-col min-h-0 min-w-0 divide-y divide-
|
|
893
|
+
root: "flex flex-col min-h-0 min-w-0 divide-y divide-(--ui-border)",
|
|
756
894
|
input: "[&>input]:h-12",
|
|
757
895
|
close: "",
|
|
758
|
-
content: "relative overflow-hidden",
|
|
759
|
-
viewport: "divide-y divide-
|
|
896
|
+
content: "relative overflow-hidden flex flex-col",
|
|
897
|
+
viewport: "relative divide-y divide-(--ui-border) scroll-py-1 overflow-y-auto flex-1 focus:outline-none",
|
|
760
898
|
group: "p-1 isolate",
|
|
761
|
-
empty: "py-6 text-center text-sm text-
|
|
762
|
-
label: "px-2 py-1.5 text-xs font-semibold text-
|
|
763
|
-
item:
|
|
764
|
-
itemLeadingIcon:
|
|
899
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)",
|
|
900
|
+
label: "px-2 py-1.5 text-xs font-semibold text-(--ui-text-highlighted)",
|
|
901
|
+
item: "group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
902
|
+
itemLeadingIcon: "shrink-0 size-5",
|
|
765
903
|
itemLeadingAvatar: "shrink-0",
|
|
766
904
|
itemLeadingAvatarSize: "2xs",
|
|
767
905
|
itemLeadingChip: "shrink-0 size-5",
|
|
768
906
|
itemLeadingChipSize: "md",
|
|
769
907
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
770
908
|
itemTrailingIcon: "shrink-0 size-5",
|
|
771
|
-
itemTrailingHighlightedIcon: "shrink-0 size-5 text-
|
|
909
|
+
itemTrailingHighlightedIcon: "shrink-0 size-5 text-(--ui-text-dimmed) hidden group-data-highlighted:inline-flex",
|
|
772
910
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
|
|
773
911
|
itemTrailingKbdsSize: "md",
|
|
774
|
-
itemLabel: "truncate space-x-1 rtl:space-x-reverse",
|
|
775
|
-
itemLabelBase: "text-
|
|
776
|
-
itemLabelPrefix: "text-
|
|
777
|
-
itemLabelSuffix: "text-
|
|
912
|
+
itemLabel: "truncate space-x-1 rtl:space-x-reverse text-(--ui-text-dimmed)",
|
|
913
|
+
itemLabelBase: "text-(--ui-text-highlighted) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)",
|
|
914
|
+
itemLabelPrefix: "text-(--ui-text)",
|
|
915
|
+
itemLabelSuffix: "text-(--ui-text-dimmed) [&>mark]:text-(--ui-bg) [&>mark]:bg-(--ui-primary)"
|
|
778
916
|
},
|
|
779
917
|
variants: {
|
|
918
|
+
active: {
|
|
919
|
+
true: {
|
|
920
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
921
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
922
|
+
},
|
|
923
|
+
false: {
|
|
924
|
+
item: ["text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
925
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
926
|
+
}
|
|
927
|
+
},
|
|
780
928
|
loading: {
|
|
781
929
|
true: {
|
|
782
930
|
itemLeadingIcon: "animate-spin"
|
|
@@ -786,25 +934,25 @@ const commandPalette = (options) => ({
|
|
|
786
934
|
});
|
|
787
935
|
|
|
788
936
|
const container = {
|
|
789
|
-
base: "max-w-
|
|
937
|
+
base: "max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8"
|
|
790
938
|
};
|
|
791
939
|
|
|
792
940
|
const contextMenu = (options) => ({
|
|
793
941
|
slots: {
|
|
794
|
-
content: "min-w-32 bg-
|
|
942
|
+
content: "min-w-32 bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) divide-y divide-(--ui-border) overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
795
943
|
group: "p-1 isolate",
|
|
796
|
-
label: "w-full flex items-center font-semibold text-
|
|
797
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
944
|
+
label: "w-full flex items-center font-semibold text-(--ui-text-highlighted)",
|
|
945
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
798
946
|
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
799
947
|
itemLeadingIcon: "shrink-0",
|
|
800
948
|
itemLeadingAvatar: "shrink-0",
|
|
801
949
|
itemLeadingAvatarSize: "",
|
|
802
|
-
itemTrailing: "ms-auto inline-flex",
|
|
950
|
+
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
803
951
|
itemTrailingIcon: "shrink-0",
|
|
804
952
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
805
953
|
itemTrailingKbdsSize: "",
|
|
806
954
|
itemLabel: "truncate",
|
|
807
|
-
itemLabelExternalIcon: "inline-block size-3 align-top text-
|
|
955
|
+
itemLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)"
|
|
808
956
|
},
|
|
809
957
|
variants: {
|
|
810
958
|
color: {
|
|
@@ -813,12 +961,12 @@ const contextMenu = (options) => ({
|
|
|
813
961
|
},
|
|
814
962
|
active: {
|
|
815
963
|
true: {
|
|
816
|
-
item: "text-
|
|
817
|
-
itemLeadingIcon: "text-
|
|
964
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
965
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
818
966
|
},
|
|
819
967
|
false: {
|
|
820
|
-
item: ["text-
|
|
821
|
-
itemLeadingIcon: ["text-
|
|
968
|
+
item: ["text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-[state=open]:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50 data-[state=open]:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
969
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
822
970
|
}
|
|
823
971
|
},
|
|
824
972
|
loading: {
|
|
@@ -878,15 +1026,15 @@ const contextMenu = (options) => ({
|
|
|
878
1026
|
color,
|
|
879
1027
|
active: false,
|
|
880
1028
|
class: {
|
|
881
|
-
item: `text-
|
|
882
|
-
itemLeadingIcon: `text-
|
|
1029
|
+
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
|
1030
|
+
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
883
1031
|
}
|
|
884
1032
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
885
1033
|
color,
|
|
886
1034
|
active: true,
|
|
887
1035
|
class: {
|
|
888
|
-
item: `text-
|
|
889
|
-
itemLeadingIcon: `text-
|
|
1036
|
+
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
|
1037
|
+
itemLeadingIcon: `text-(--ui-${color})`
|
|
890
1038
|
}
|
|
891
1039
|
}))],
|
|
892
1040
|
defaultVariants: {
|
|
@@ -896,68 +1044,121 @@ const contextMenu = (options) => ({
|
|
|
896
1044
|
|
|
897
1045
|
const drawer = {
|
|
898
1046
|
slots: {
|
|
899
|
-
overlay: "fixed inset-0 bg-
|
|
900
|
-
content: "fixed bg-
|
|
901
|
-
handle: "shrink-0 rounded-full bg-
|
|
1047
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
1048
|
+
content: "fixed bg-(--ui-bg) ring ring-(--ui-border) flex focus:outline-none",
|
|
1049
|
+
handle: "shrink-0 rounded-full bg-(--ui-bg-accented)",
|
|
902
1050
|
container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
|
|
903
1051
|
header: "",
|
|
904
|
-
title: "text-
|
|
905
|
-
description: "mt-1 text-
|
|
1052
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
1053
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
906
1054
|
body: "flex-1",
|
|
907
1055
|
footer: "flex flex-col gap-1.5"
|
|
908
1056
|
},
|
|
909
1057
|
variants: {
|
|
910
1058
|
direction: {
|
|
911
1059
|
top: {
|
|
912
|
-
content: "
|
|
1060
|
+
content: "mb-24 flex-col-reverse",
|
|
913
1061
|
handle: "mb-4"
|
|
914
1062
|
},
|
|
915
1063
|
right: {
|
|
916
|
-
content: "
|
|
1064
|
+
content: "flex-row",
|
|
917
1065
|
handle: "ml-4"
|
|
918
1066
|
},
|
|
919
1067
|
bottom: {
|
|
920
|
-
content: "
|
|
1068
|
+
content: "mt-24 flex-col",
|
|
921
1069
|
handle: "mt-4"
|
|
922
1070
|
},
|
|
923
1071
|
left: {
|
|
924
|
-
content: "
|
|
1072
|
+
content: "flex-row-reverse",
|
|
925
1073
|
handle: "mr-4"
|
|
926
1074
|
}
|
|
1075
|
+
},
|
|
1076
|
+
inset: {
|
|
1077
|
+
true: {
|
|
1078
|
+
content: "rounded-[calc(var(--ui-radius)*2)] after:hidden"
|
|
1079
|
+
}
|
|
927
1080
|
}
|
|
928
1081
|
},
|
|
929
1082
|
compoundVariants: [{
|
|
930
1083
|
direction: ["top", "bottom"],
|
|
931
1084
|
class: {
|
|
932
|
-
content: "
|
|
1085
|
+
content: "h-auto max-h-[96%]",
|
|
933
1086
|
handle: "w-12 h-1.5 mx-auto"
|
|
934
1087
|
}
|
|
935
1088
|
}, {
|
|
936
1089
|
direction: ["right", "left"],
|
|
937
1090
|
class: {
|
|
938
|
-
content: "
|
|
1091
|
+
content: "w-auto max-w-[calc(100%-2rem)]",
|
|
939
1092
|
handle: "h-12 w-1.5 mt-auto mb-auto"
|
|
940
1093
|
}
|
|
1094
|
+
}, {
|
|
1095
|
+
direction: "top",
|
|
1096
|
+
inset: true,
|
|
1097
|
+
class: {
|
|
1098
|
+
content: "inset-x-4 top-4"
|
|
1099
|
+
}
|
|
1100
|
+
}, {
|
|
1101
|
+
direction: "top",
|
|
1102
|
+
inset: false,
|
|
1103
|
+
class: {
|
|
1104
|
+
content: "inset-x-0 top-0 rounded-b-[calc(var(--ui-radius)*2)]"
|
|
1105
|
+
}
|
|
1106
|
+
}, {
|
|
1107
|
+
direction: "bottom",
|
|
1108
|
+
inset: true,
|
|
1109
|
+
class: {
|
|
1110
|
+
content: "inset-x-4 bottom-4"
|
|
1111
|
+
}
|
|
1112
|
+
}, {
|
|
1113
|
+
direction: "bottom",
|
|
1114
|
+
inset: false,
|
|
1115
|
+
class: {
|
|
1116
|
+
content: "inset-x-0 bottom-0 rounded-t-[calc(var(--ui-radius)*2)]"
|
|
1117
|
+
}
|
|
1118
|
+
}, {
|
|
1119
|
+
direction: "left",
|
|
1120
|
+
inset: true,
|
|
1121
|
+
class: {
|
|
1122
|
+
content: "inset-y-4 left-4"
|
|
1123
|
+
}
|
|
1124
|
+
}, {
|
|
1125
|
+
direction: "left",
|
|
1126
|
+
inset: false,
|
|
1127
|
+
class: {
|
|
1128
|
+
content: "inset-y-0 left-0 rounded-r-[calc(var(--ui-radius)*2)]"
|
|
1129
|
+
}
|
|
1130
|
+
}, {
|
|
1131
|
+
direction: "right",
|
|
1132
|
+
inset: true,
|
|
1133
|
+
class: {
|
|
1134
|
+
content: "inset-y-4 right-4"
|
|
1135
|
+
}
|
|
1136
|
+
}, {
|
|
1137
|
+
direction: "right",
|
|
1138
|
+
inset: false,
|
|
1139
|
+
class: {
|
|
1140
|
+
content: "inset-y-0 right-0 rounded-l-[calc(var(--ui-radius)*2)]"
|
|
1141
|
+
}
|
|
941
1142
|
}]
|
|
942
1143
|
};
|
|
943
1144
|
|
|
944
1145
|
const dropdownMenu = (options) => ({
|
|
945
1146
|
slots: {
|
|
946
|
-
content: "min-w-32 bg-
|
|
947
|
-
arrow: "fill-
|
|
1147
|
+
content: "min-w-32 bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) divide-y divide-(--ui-border) overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1148
|
+
arrow: "fill-(--ui-border)",
|
|
948
1149
|
group: "p-1 isolate",
|
|
949
|
-
label: "w-full flex items-center font-semibold text-
|
|
950
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1150
|
+
label: "w-full flex items-center font-semibold text-(--ui-text-highlighted)",
|
|
1151
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
951
1152
|
item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
952
1153
|
itemLeadingIcon: "shrink-0",
|
|
953
1154
|
itemLeadingAvatar: "shrink-0",
|
|
954
1155
|
itemLeadingAvatarSize: "",
|
|
955
|
-
itemTrailing: "ms-auto inline-flex",
|
|
1156
|
+
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
956
1157
|
itemTrailingIcon: "shrink-0",
|
|
957
1158
|
itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
|
|
958
1159
|
itemTrailingKbdsSize: "",
|
|
959
1160
|
itemLabel: "truncate",
|
|
960
|
-
itemLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1161
|
+
itemLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)"
|
|
961
1162
|
},
|
|
962
1163
|
variants: {
|
|
963
1164
|
color: {
|
|
@@ -966,12 +1167,12 @@ const dropdownMenu = (options) => ({
|
|
|
966
1167
|
},
|
|
967
1168
|
active: {
|
|
968
1169
|
true: {
|
|
969
|
-
item: "text-
|
|
970
|
-
itemLeadingIcon: "text-
|
|
1170
|
+
item: "text-(--ui-text-highlighted) before:bg-(--ui-bg-elevated)",
|
|
1171
|
+
itemLeadingIcon: "text-(--ui-text)"
|
|
971
1172
|
},
|
|
972
1173
|
false: {
|
|
973
|
-
item: ["text-
|
|
974
|
-
itemLeadingIcon: ["text-
|
|
1174
|
+
item: ["text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-[state=open]:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50 data-[state=open]:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1175
|
+
itemLeadingIcon: ["text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text) group-data-[state=open]:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
975
1176
|
}
|
|
976
1177
|
},
|
|
977
1178
|
loading: {
|
|
@@ -1031,15 +1232,15 @@ const dropdownMenu = (options) => ({
|
|
|
1031
1232
|
color,
|
|
1032
1233
|
active: false,
|
|
1033
1234
|
class: {
|
|
1034
|
-
item: `text-
|
|
1035
|
-
itemLeadingIcon: `text-
|
|
1235
|
+
item: `text-(--ui-${color}) data-highlighted:text-(--ui-${color}) data-highlighted:before:bg-(--ui-${color})/10 data-[state=open]:before:bg-(--ui-${color})/10`,
|
|
1236
|
+
itemLeadingIcon: `text-(--ui-${color})/75 group-data-highlighted:text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1036
1237
|
}
|
|
1037
1238
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1038
1239
|
color,
|
|
1039
1240
|
active: true,
|
|
1040
1241
|
class: {
|
|
1041
|
-
item: `text-
|
|
1042
|
-
itemLeadingIcon: `text-
|
|
1242
|
+
item: `text-(--ui-${color}) before:bg-(--ui-${color})/10`,
|
|
1243
|
+
itemLeadingIcon: `text-(--ui-${color})`
|
|
1043
1244
|
}
|
|
1044
1245
|
}))],
|
|
1045
1246
|
defaultVariants: {
|
|
@@ -1056,12 +1257,12 @@ const formField = {
|
|
|
1056
1257
|
root: "",
|
|
1057
1258
|
wrapper: "",
|
|
1058
1259
|
labelWrapper: "flex content-center items-center justify-between",
|
|
1059
|
-
label: "block font-medium text-
|
|
1260
|
+
label: "block font-medium text-(--ui-text)",
|
|
1060
1261
|
container: "mt-1 relative",
|
|
1061
|
-
description: "text-
|
|
1062
|
-
error: "mt-2 text-
|
|
1063
|
-
hint: "text-
|
|
1064
|
-
help: "mt-2 text-
|
|
1262
|
+
description: "text-(--ui-text-muted)",
|
|
1263
|
+
error: "mt-2 text-(--ui-error)",
|
|
1264
|
+
hint: "text-(--ui-text-muted)",
|
|
1265
|
+
help: "mt-2 text-(--ui-text-muted)"
|
|
1065
1266
|
},
|
|
1066
1267
|
variants: {
|
|
1067
1268
|
size: {
|
|
@@ -1073,7 +1274,7 @@ const formField = {
|
|
|
1073
1274
|
},
|
|
1074
1275
|
required: {
|
|
1075
1276
|
true: {
|
|
1076
|
-
label: `after:content-['*'] after:ms-0.5 after:text-
|
|
1277
|
+
label: `after:content-['*'] after:ms-0.5 after:text-(--ui-error)`
|
|
1077
1278
|
}
|
|
1078
1279
|
}
|
|
1079
1280
|
},
|
|
@@ -1085,13 +1286,13 @@ const formField = {
|
|
|
1085
1286
|
const input = (options) => ({
|
|
1086
1287
|
slots: {
|
|
1087
1288
|
root: "relative inline-flex items-center",
|
|
1088
|
-
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-
|
|
1289
|
+
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1089
1290
|
leading: "absolute inset-y-0 start-0 flex items-center",
|
|
1090
|
-
leadingIcon: "shrink-0 text-
|
|
1291
|
+
leadingIcon: "shrink-0 text-(--ui-text-dimmed)",
|
|
1091
1292
|
leadingAvatar: "shrink-0",
|
|
1092
1293
|
leadingAvatarSize: "",
|
|
1093
1294
|
trailing: "absolute inset-y-0 end-0 flex items-center",
|
|
1094
|
-
trailingIcon: "shrink-0 text-
|
|
1295
|
+
trailingIcon: "shrink-0 text-(--ui-text-dimmed)"
|
|
1095
1296
|
},
|
|
1096
1297
|
variants: {
|
|
1097
1298
|
...buttonGroupVariantWithRoot,
|
|
@@ -1138,11 +1339,11 @@ const input = (options) => ({
|
|
|
1138
1339
|
}
|
|
1139
1340
|
},
|
|
1140
1341
|
variant: {
|
|
1141
|
-
outline: "text-
|
|
1142
|
-
soft: "text-
|
|
1143
|
-
subtle: "text-
|
|
1144
|
-
ghost: "text-
|
|
1145
|
-
none: "text-
|
|
1342
|
+
outline: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border-accented)",
|
|
1343
|
+
soft: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50 hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-(--ui-bg-elevated)/50",
|
|
1344
|
+
subtle: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated) ring ring-inset ring-(--ui-border-accented)",
|
|
1345
|
+
ghost: "text-(--ui-text-highlighted) bg-transparent hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-transparent dark:disabled:bg-transparent",
|
|
1346
|
+
none: "text-(--ui-text-highlighted) bg-transparent"
|
|
1146
1347
|
},
|
|
1147
1348
|
color: {
|
|
1148
1349
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
@@ -1161,25 +1362,25 @@ const input = (options) => ({
|
|
|
1161
1362
|
true: ""
|
|
1162
1363
|
},
|
|
1163
1364
|
type: {
|
|
1164
|
-
file: "file:me-1.5 file:font-medium file:text-
|
|
1365
|
+
file: "file:me-1.5 file:font-medium file:text-(--ui-text-muted) file:outline-none"
|
|
1165
1366
|
}
|
|
1166
1367
|
},
|
|
1167
1368
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1168
1369
|
color,
|
|
1169
1370
|
variant: ["outline", "subtle"],
|
|
1170
|
-
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1371
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
1171
1372
|
})), ...(options.theme.colors || []).map((color) => ({
|
|
1172
1373
|
color,
|
|
1173
1374
|
highlight: true,
|
|
1174
|
-
class: `ring ring-inset ring-
|
|
1375
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
1175
1376
|
})), {
|
|
1176
1377
|
color: "neutral",
|
|
1177
1378
|
variant: ["outline", "subtle"],
|
|
1178
|
-
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
1379
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
1179
1380
|
}, {
|
|
1180
1381
|
color: "neutral",
|
|
1181
1382
|
highlight: true,
|
|
1182
|
-
class: "ring ring-inset ring-
|
|
1383
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
1183
1384
|
}, {
|
|
1184
1385
|
leading: true,
|
|
1185
1386
|
size: "xs",
|
|
@@ -1246,15 +1447,15 @@ const inputMenu = (options) => {
|
|
|
1246
1447
|
slots: {
|
|
1247
1448
|
base: () => ["rounded-[calc(var(--ui-radius)*1.5)]", options.theme.transitions && "transition-colors"],
|
|
1248
1449
|
trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
|
|
1249
|
-
arrow: "fill-
|
|
1250
|
-
content: "max-h-60 w-
|
|
1251
|
-
viewport: "divide-y divide-
|
|
1450
|
+
arrow: "fill-(--ui-border)",
|
|
1451
|
+
content: "max-h-60 w-(--reka-popper-anchor-width) bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] pointer-events-auto",
|
|
1452
|
+
viewport: "divide-y divide-(--ui-border) scroll-py-1",
|
|
1252
1453
|
group: "p-1 isolate",
|
|
1253
|
-
empty: "py-2 text-center text-sm text-
|
|
1254
|
-
label: "font-semibold text-
|
|
1255
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1256
|
-
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-
|
|
1257
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
1454
|
+
empty: "py-2 text-center text-sm text-(--ui-text-muted)",
|
|
1455
|
+
label: "font-semibold text-(--ui-text-highlighted)",
|
|
1456
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
1457
|
+
item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1458
|
+
itemLeadingIcon: ["shrink-0 text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"],
|
|
1258
1459
|
itemLeadingAvatar: "shrink-0",
|
|
1259
1460
|
itemLeadingAvatarSize: "",
|
|
1260
1461
|
itemLeadingChip: "shrink-0",
|
|
@@ -1262,9 +1463,9 @@ const inputMenu = (options) => {
|
|
|
1262
1463
|
itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
1263
1464
|
itemTrailingIcon: "shrink-0",
|
|
1264
1465
|
itemLabel: "truncate",
|
|
1265
|
-
tagsItem: "px-1.5 py-0.5 rounded-
|
|
1466
|
+
tagsItem: "px-1.5 py-0.5 rounded-(--ui-radius) font-medium inline-flex items-center gap-0.5 ring ring-inset ring-(--ui-border-accented) bg-(--ui-bg-elevated) text-(--ui-text) data-disabled:cursor-not-allowed data-disabled:opacity-75",
|
|
1266
1467
|
tagsItemText: "truncate",
|
|
1267
|
-
tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-
|
|
1468
|
+
tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-(--ui-text-dimmed) hover:text-(--ui-text) hover:bg-(--ui-bg-accented)/75 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
|
|
1268
1469
|
tagsItemDeleteIcon: "",
|
|
1269
1470
|
tagsInput: ""
|
|
1270
1471
|
},
|
|
@@ -1272,11 +1473,10 @@ const inputMenu = (options) => {
|
|
|
1272
1473
|
multiple: {
|
|
1273
1474
|
true: {
|
|
1274
1475
|
root: "flex-wrap",
|
|
1275
|
-
|
|
1276
|
-
tagsInput: "border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1476
|
+
tagsInput: "border-0 bg-transparent placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1277
1477
|
},
|
|
1278
1478
|
false: {
|
|
1279
|
-
base: "w-full border-0 placeholder:text-
|
|
1479
|
+
base: "w-full border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
|
|
1280
1480
|
}
|
|
1281
1481
|
},
|
|
1282
1482
|
size: {
|
|
@@ -1341,23 +1541,133 @@ const inputMenu = (options) => {
|
|
|
1341
1541
|
color,
|
|
1342
1542
|
multiple: true,
|
|
1343
1543
|
variant: ["outline", "subtle"],
|
|
1344
|
-
class: `has-
|
|
1544
|
+
class: `has-focus-visible:ring-2 has-focus-visible:ring-(--ui-${color})`
|
|
1345
1545
|
})), {
|
|
1346
1546
|
color: "neutral",
|
|
1347
1547
|
multiple: true,
|
|
1348
1548
|
variant: ["outline", "subtle"],
|
|
1349
|
-
class: "has-
|
|
1549
|
+
class: "has-focus-visible:ring-2 has-focus-visible:ring-(--ui-border-inverted)"
|
|
1350
1550
|
}]
|
|
1351
1551
|
}, input(options));
|
|
1352
1552
|
};
|
|
1353
1553
|
|
|
1554
|
+
const inputNumber = (options) => {
|
|
1555
|
+
const input$1 = input(options);
|
|
1556
|
+
return {
|
|
1557
|
+
slots: {
|
|
1558
|
+
root: "relative inline-flex items-center",
|
|
1559
|
+
base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1560
|
+
increment: "absolute flex items-center",
|
|
1561
|
+
decrement: "absolute flex items-center"
|
|
1562
|
+
},
|
|
1563
|
+
variants: {
|
|
1564
|
+
color: {
|
|
1565
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
1566
|
+
neutral: ""
|
|
1567
|
+
},
|
|
1568
|
+
size: {
|
|
1569
|
+
xs: "px-2 py-1 text-xs gap-1",
|
|
1570
|
+
sm: "px-2.5 py-1.5 text-xs gap-1.5",
|
|
1571
|
+
md: "px-2.5 py-1.5 text-sm gap-1.5",
|
|
1572
|
+
lg: "px-3 py-2 text-sm gap-2",
|
|
1573
|
+
xl: "px-3 py-2 text-base gap-2"
|
|
1574
|
+
},
|
|
1575
|
+
variant: {
|
|
1576
|
+
...input$1.variants.variant
|
|
1577
|
+
},
|
|
1578
|
+
disabled: {
|
|
1579
|
+
true: {
|
|
1580
|
+
increment: "opacity-75 cursor-not-allowed",
|
|
1581
|
+
decrement: "opacity-75 cursor-not-allowed"
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
orientation: {
|
|
1585
|
+
horizontal: {
|
|
1586
|
+
base: "text-center",
|
|
1587
|
+
increment: "inset-y-0 end-0 pe-1",
|
|
1588
|
+
decrement: "inset-y-0 start-0 ps-1"
|
|
1589
|
+
},
|
|
1590
|
+
vertical: {
|
|
1591
|
+
increment: "top-0 end-0 pe-1 [&>button]:py-0 scale-80",
|
|
1592
|
+
decrement: "bottom-0 end-0 pe-1 [&>button]:py-0 scale-80"
|
|
1593
|
+
}
|
|
1594
|
+
},
|
|
1595
|
+
highlight: {
|
|
1596
|
+
true: ""
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1599
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
1600
|
+
color,
|
|
1601
|
+
variant: ["outline", "subtle"],
|
|
1602
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
1603
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
1604
|
+
color,
|
|
1605
|
+
highlight: true,
|
|
1606
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
1607
|
+
})), {
|
|
1608
|
+
color: "neutral",
|
|
1609
|
+
variant: ["outline", "subtle"],
|
|
1610
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
1611
|
+
}, {
|
|
1612
|
+
color: "neutral",
|
|
1613
|
+
highlight: true,
|
|
1614
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
1615
|
+
}, {
|
|
1616
|
+
orientation: "horizontal",
|
|
1617
|
+
size: "xs",
|
|
1618
|
+
class: "px-7"
|
|
1619
|
+
}, {
|
|
1620
|
+
orientation: "horizontal",
|
|
1621
|
+
size: "sm",
|
|
1622
|
+
class: "px-8"
|
|
1623
|
+
}, {
|
|
1624
|
+
orientation: "horizontal",
|
|
1625
|
+
size: "md",
|
|
1626
|
+
class: "px-9"
|
|
1627
|
+
}, {
|
|
1628
|
+
orientation: "horizontal",
|
|
1629
|
+
size: "lg",
|
|
1630
|
+
class: "px-10"
|
|
1631
|
+
}, {
|
|
1632
|
+
orientation: "horizontal",
|
|
1633
|
+
size: "xl",
|
|
1634
|
+
class: "px-11"
|
|
1635
|
+
}, {
|
|
1636
|
+
orientation: "vertical",
|
|
1637
|
+
size: "xs",
|
|
1638
|
+
class: "pe-7"
|
|
1639
|
+
}, {
|
|
1640
|
+
orientation: "vertical",
|
|
1641
|
+
size: "sm",
|
|
1642
|
+
class: "pe-8"
|
|
1643
|
+
}, {
|
|
1644
|
+
orientation: "vertical",
|
|
1645
|
+
size: "md",
|
|
1646
|
+
class: "pe-9"
|
|
1647
|
+
}, {
|
|
1648
|
+
orientation: "vertical",
|
|
1649
|
+
size: "lg",
|
|
1650
|
+
class: "pe-10"
|
|
1651
|
+
}, {
|
|
1652
|
+
orientation: "vertical",
|
|
1653
|
+
size: "xl",
|
|
1654
|
+
class: "pe-11"
|
|
1655
|
+
}],
|
|
1656
|
+
defaultVariants: {
|
|
1657
|
+
size: "md",
|
|
1658
|
+
color: "primary",
|
|
1659
|
+
variant: "outline"
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1354
1664
|
const kbd = {
|
|
1355
|
-
base: "inline-flex items-center justify-center px-1 rounded-
|
|
1665
|
+
base: "inline-flex items-center justify-center px-1 rounded-(--ui-radius) font-medium font-sans",
|
|
1356
1666
|
variants: {
|
|
1357
1667
|
variant: {
|
|
1358
|
-
solid: "bg-
|
|
1359
|
-
outline: "bg-
|
|
1360
|
-
subtle: "bg-
|
|
1668
|
+
solid: "bg-(--ui-bg-inverted) text-(--ui-bg)",
|
|
1669
|
+
outline: "bg-(--ui-bg) text-(--ui-text-highlighted) ring ring-inset ring-(--ui-border-accented)",
|
|
1670
|
+
subtle: "bg-(--ui-bg-elevated) text-(--ui-text) ring ring-inset ring-(--ui-border-accented)"
|
|
1361
1671
|
},
|
|
1362
1672
|
size: {
|
|
1363
1673
|
sm: "h-4 min-w-[16px] text-[10px]",
|
|
@@ -1372,11 +1682,11 @@ const kbd = {
|
|
|
1372
1682
|
};
|
|
1373
1683
|
|
|
1374
1684
|
const link = (options) => ({
|
|
1375
|
-
base: "focus-visible:outline-
|
|
1685
|
+
base: "focus-visible:outline-(--ui-primary)",
|
|
1376
1686
|
variants: {
|
|
1377
1687
|
active: {
|
|
1378
|
-
true: "text-
|
|
1379
|
-
false: ["text-
|
|
1688
|
+
true: "text-(--ui-primary)",
|
|
1689
|
+
false: ["text-(--ui-text-muted) hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1380
1690
|
},
|
|
1381
1691
|
disabled: {
|
|
1382
1692
|
true: "cursor-not-allowed opacity-75"
|
|
@@ -1386,13 +1696,14 @@ const link = (options) => ({
|
|
|
1386
1696
|
|
|
1387
1697
|
const modal = {
|
|
1388
1698
|
slots: {
|
|
1389
|
-
overlay: "fixed inset-0 bg-
|
|
1390
|
-
content: "fixed
|
|
1391
|
-
header: "
|
|
1392
|
-
|
|
1699
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
1700
|
+
content: "fixed bg-(--ui-bg) divide-y divide-(--ui-border) flex flex-col focus:outline-none",
|
|
1701
|
+
header: "flex items-center gap-1.5 p-4 sm:px-6 min-h-16",
|
|
1702
|
+
wrapper: "",
|
|
1703
|
+
body: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
1393
1704
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
1394
|
-
title: "text-
|
|
1395
|
-
description: "mt-1 text-
|
|
1705
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
1706
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
1396
1707
|
close: "absolute top-4 end-4"
|
|
1397
1708
|
},
|
|
1398
1709
|
variants: {
|
|
@@ -1407,7 +1718,7 @@ const modal = {
|
|
|
1407
1718
|
content: "inset-0"
|
|
1408
1719
|
},
|
|
1409
1720
|
false: {
|
|
1410
|
-
content: "top-
|
|
1721
|
+
content: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-2rem)] max-w-lg max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] rounded-[calc(var(--ui-radius)*2)] shadow-lg ring ring-(--ui-border)"
|
|
1411
1722
|
}
|
|
1412
1723
|
}
|
|
1413
1724
|
}
|
|
@@ -1417,41 +1728,42 @@ const navigationMenu = (options) => ({
|
|
|
1417
1728
|
slots: {
|
|
1418
1729
|
root: "relative flex gap-1.5 [&>div]:min-w-0",
|
|
1419
1730
|
list: "isolate min-w-0",
|
|
1731
|
+
label: "w-full flex items-center gap-1.5 font-semibold text-xs/5 text-(--ui-text-highlighted) px-2.5 py-1.5",
|
|
1420
1732
|
item: "min-w-0",
|
|
1421
1733
|
link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
|
|
1422
1734
|
linkLeadingIcon: "shrink-0 size-5",
|
|
1423
1735
|
linkLeadingAvatar: "shrink-0",
|
|
1424
1736
|
linkLeadingAvatarSize: "2xs",
|
|
1425
|
-
linkTrailing: "ms-auto inline-flex",
|
|
1426
|
-
linkTrailingBadge: "shrink-0
|
|
1737
|
+
linkTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
1738
|
+
linkTrailingBadge: "shrink-0",
|
|
1427
1739
|
linkTrailingBadgeSize: "sm",
|
|
1428
1740
|
linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
|
|
1429
1741
|
linkLabel: "truncate",
|
|
1430
|
-
linkLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1742
|
+
linkLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)",
|
|
1431
1743
|
childList: "",
|
|
1432
1744
|
childItem: "",
|
|
1433
1745
|
childLink: "group size-full px-3 py-2 rounded-[calc(var(--ui-radius)*1.5)] flex items-start gap-2 text-start",
|
|
1434
1746
|
childLinkWrapper: "flex flex-col items-start",
|
|
1435
1747
|
childLinkIcon: "size-5 shrink-0",
|
|
1436
1748
|
childLinkLabel: "font-semibold text-sm relative inline-flex",
|
|
1437
|
-
childLinkLabelExternalIcon: "inline-block size-3 align-top text-
|
|
1438
|
-
childLinkDescription: "text-sm text-
|
|
1439
|
-
separator: "px-2 h-px bg-
|
|
1440
|
-
viewportWrapper: "absolute top-full left-0 flex w-full
|
|
1441
|
-
viewport: "relative overflow-hidden bg-
|
|
1442
|
-
content: "absolute top-0 left-0 w-full
|
|
1443
|
-
indicator: "data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] bottom-0 z-[1] flex h-2.5 items-end justify-center overflow-hidden transition-
|
|
1444
|
-
arrow: "relative top-[50%] size-2.5 rotate-45 border border-
|
|
1749
|
+
childLinkLabelExternalIcon: "inline-block size-3 align-top text-(--ui-text-dimmed)",
|
|
1750
|
+
childLinkDescription: "text-sm text-(--ui-text-muted)",
|
|
1751
|
+
separator: "px-2 h-px bg-(--ui-border)",
|
|
1752
|
+
viewportWrapper: "absolute top-full left-0 flex w-full",
|
|
1753
|
+
viewport: "relative overflow-hidden bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
1754
|
+
content: "absolute top-0 left-0 w-full",
|
|
1755
|
+
indicator: "absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[1] w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",
|
|
1756
|
+
arrow: "relative top-[50%] size-2.5 rotate-45 border border-(--ui-border) bg-(--ui-bg) z-[1] rounded-[calc(var(--ui-radius)/2)]"
|
|
1445
1757
|
},
|
|
1446
1758
|
variants: {
|
|
1447
1759
|
color: {
|
|
1448
1760
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1449
|
-
link: `focus-visible:before:ring-
|
|
1450
|
-
childLink: `focus-visible:outline-
|
|
1761
|
+
link: `focus-visible:before:ring-(--ui-${color})`,
|
|
1762
|
+
childLink: `focus-visible:outline-(--ui-${color})`
|
|
1451
1763
|
}])),
|
|
1452
1764
|
neutral: {
|
|
1453
|
-
link: "focus-visible:before:ring-
|
|
1454
|
-
childLink: "focus-visible:outline-
|
|
1765
|
+
link: "focus-visible:before:ring-(--ui-border-inverted)",
|
|
1766
|
+
childLink: "focus-visible:outline-(--ui-border-inverted)"
|
|
1455
1767
|
}
|
|
1456
1768
|
},
|
|
1457
1769
|
highlightColor: {
|
|
@@ -1464,29 +1776,38 @@ const navigationMenu = (options) => ({
|
|
|
1464
1776
|
},
|
|
1465
1777
|
orientation: {
|
|
1466
1778
|
horizontal: {
|
|
1467
|
-
root: "
|
|
1779
|
+
root: "items-center justify-between",
|
|
1468
1780
|
list: "flex items-center",
|
|
1469
1781
|
item: "py-2",
|
|
1470
1782
|
link: "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
|
|
1471
|
-
childList: "grid
|
|
1783
|
+
childList: "grid p-2"
|
|
1472
1784
|
},
|
|
1473
1785
|
vertical: {
|
|
1474
1786
|
root: "flex-col",
|
|
1475
|
-
link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0"
|
|
1476
|
-
|
|
1477
|
-
|
|
1787
|
+
link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0"
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
contentOrientation: {
|
|
1791
|
+
horizontal: {
|
|
1792
|
+
viewport: "",
|
|
1793
|
+
viewportWrapper: "justify-center",
|
|
1794
|
+
content: "data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]"
|
|
1795
|
+
},
|
|
1796
|
+
vertical: {
|
|
1797
|
+
viewport: "sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)",
|
|
1798
|
+
content: ""
|
|
1478
1799
|
}
|
|
1479
1800
|
},
|
|
1480
1801
|
active: {
|
|
1481
1802
|
true: {
|
|
1482
|
-
childLink: "bg-
|
|
1483
|
-
childLinkIcon: "text-
|
|
1803
|
+
childLink: "bg-(--ui-bg-elevated) text-(--ui-text-highlighted)",
|
|
1804
|
+
childLinkIcon: "text-(--ui-text)"
|
|
1484
1805
|
},
|
|
1485
1806
|
false: {
|
|
1486
|
-
link: "text-
|
|
1487
|
-
linkLeadingIcon: "text-
|
|
1488
|
-
childLink: ["hover:bg-
|
|
1489
|
-
childLinkIcon: ["text-
|
|
1807
|
+
link: "text-(--ui-text-muted)",
|
|
1808
|
+
linkLeadingIcon: "text-(--ui-text-dimmed)",
|
|
1809
|
+
childLink: ["hover:bg-(--ui-bg-elevated)/50 text-(--ui-text) hover:text-(--ui-text-highlighted)", options.theme.transitions && "transition-colors"],
|
|
1810
|
+
childLinkIcon: ["text-(--ui-text-dimmed) group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1490
1811
|
}
|
|
1491
1812
|
},
|
|
1492
1813
|
disabled: {
|
|
@@ -1496,29 +1817,56 @@ const navigationMenu = (options) => ({
|
|
|
1496
1817
|
},
|
|
1497
1818
|
highlight: {
|
|
1498
1819
|
true: ""
|
|
1820
|
+
},
|
|
1821
|
+
level: {
|
|
1822
|
+
true: ""
|
|
1823
|
+
},
|
|
1824
|
+
collapsed: {
|
|
1825
|
+
true: ""
|
|
1499
1826
|
}
|
|
1500
1827
|
},
|
|
1501
1828
|
compoundVariants: [{
|
|
1502
|
-
highlight: true,
|
|
1503
1829
|
orientation: "horizontal",
|
|
1830
|
+
contentOrientation: "horizontal",
|
|
1504
1831
|
class: {
|
|
1505
|
-
|
|
1506
|
-
link: "after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full"
|
|
1832
|
+
childList: "grid-cols-2 gap-2"
|
|
1507
1833
|
}
|
|
1508
1834
|
}, {
|
|
1835
|
+
orientation: "horizontal",
|
|
1836
|
+
contentOrientation: "vertical",
|
|
1837
|
+
class: {
|
|
1838
|
+
childList: "gap-1",
|
|
1839
|
+
content: "w-60"
|
|
1840
|
+
}
|
|
1841
|
+
}, {
|
|
1842
|
+
orientation: "horizontal",
|
|
1509
1843
|
highlight: true,
|
|
1844
|
+
class: {
|
|
1845
|
+
link: ["after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full", options.theme.transitions && "after:transition-colors"]
|
|
1846
|
+
}
|
|
1847
|
+
}, {
|
|
1510
1848
|
orientation: "vertical",
|
|
1849
|
+
highlight: true,
|
|
1850
|
+
level: true,
|
|
1851
|
+
class: {
|
|
1852
|
+
link: ["after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full", options.theme.transitions && "after:transition-colors"]
|
|
1853
|
+
}
|
|
1854
|
+
}, {
|
|
1855
|
+
disabled: false,
|
|
1856
|
+
active: false,
|
|
1857
|
+
variant: "pill",
|
|
1511
1858
|
class: {
|
|
1512
|
-
|
|
1513
|
-
|
|
1859
|
+
link: ["hover:text-(--ui-text-highlighted) hover:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
1860
|
+
linkLeadingIcon: ["group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1514
1861
|
}
|
|
1515
1862
|
}, {
|
|
1516
1863
|
disabled: false,
|
|
1517
1864
|
active: false,
|
|
1518
1865
|
variant: "pill",
|
|
1866
|
+
orientation: "horizontal",
|
|
1519
1867
|
class: {
|
|
1520
|
-
link:
|
|
1521
|
-
linkLeadingIcon:
|
|
1868
|
+
link: "data-[state=open]:text-(--ui-text-highlighted)",
|
|
1869
|
+
linkLeadingIcon: "group-data-[state=open]:text-(--ui-text)"
|
|
1522
1870
|
}
|
|
1523
1871
|
}, {
|
|
1524
1872
|
disabled: false,
|
|
@@ -1526,7 +1874,7 @@ const navigationMenu = (options) => ({
|
|
|
1526
1874
|
highlight: true,
|
|
1527
1875
|
orientation: "horizontal",
|
|
1528
1876
|
class: {
|
|
1529
|
-
link: "data-[state=open]:before:bg-
|
|
1877
|
+
link: "data-[state=open]:before:bg-(--ui-bg-elevated)/50"
|
|
1530
1878
|
}
|
|
1531
1879
|
}, {
|
|
1532
1880
|
disabled: false,
|
|
@@ -1535,75 +1883,99 @@ const navigationMenu = (options) => ({
|
|
|
1535
1883
|
active: false,
|
|
1536
1884
|
orientation: "horizontal",
|
|
1537
1885
|
class: {
|
|
1538
|
-
link: "data-[state=open]:before:bg-
|
|
1886
|
+
link: "data-[state=open]:before:bg-(--ui-bg-elevated)/50"
|
|
1539
1887
|
}
|
|
1540
1888
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1541
1889
|
color,
|
|
1542
1890
|
variant: "pill",
|
|
1543
1891
|
active: true,
|
|
1544
1892
|
class: {
|
|
1545
|
-
link: `text-
|
|
1546
|
-
linkLeadingIcon: `text-[
|
|
1893
|
+
link: `text-(--ui-${color})`,
|
|
1894
|
+
linkLeadingIcon: `text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1547
1895
|
}
|
|
1548
1896
|
})), {
|
|
1549
1897
|
color: "neutral",
|
|
1550
1898
|
variant: "pill",
|
|
1551
1899
|
active: true,
|
|
1552
1900
|
class: {
|
|
1553
|
-
link: "text-
|
|
1554
|
-
linkLeadingIcon: "text-[
|
|
1901
|
+
link: "text-(--ui-text-highlighted)",
|
|
1902
|
+
linkLeadingIcon: "text-(--ui-text-highlighted) group-data-[state=open]:text-(--ui-text-highlighted)"
|
|
1555
1903
|
}
|
|
1556
1904
|
}, {
|
|
1557
1905
|
variant: "pill",
|
|
1558
1906
|
active: true,
|
|
1559
1907
|
highlight: false,
|
|
1560
1908
|
class: {
|
|
1561
|
-
link: "before:bg-
|
|
1909
|
+
link: "before:bg-(--ui-bg-elevated)"
|
|
1562
1910
|
}
|
|
1563
1911
|
}, {
|
|
1564
1912
|
variant: "pill",
|
|
1565
1913
|
active: true,
|
|
1566
1914
|
highlight: true,
|
|
1567
1915
|
class: {
|
|
1568
|
-
link: ["hover:before:bg-
|
|
1916
|
+
link: ["hover:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "before:transition-colors"]
|
|
1569
1917
|
}
|
|
1570
1918
|
}, {
|
|
1571
1919
|
disabled: false,
|
|
1572
1920
|
active: false,
|
|
1573
1921
|
variant: "link",
|
|
1574
1922
|
class: {
|
|
1575
|
-
link: ["hover:text-
|
|
1576
|
-
linkLeadingIcon: ["group-hover:text-
|
|
1923
|
+
link: ["hover:text-(--ui-text-highlighted)", options.theme.transitions && "transition-colors"],
|
|
1924
|
+
linkLeadingIcon: ["group-hover:text-(--ui-text)", options.theme.transitions && "transition-colors"]
|
|
1925
|
+
}
|
|
1926
|
+
}, {
|
|
1927
|
+
disabled: false,
|
|
1928
|
+
active: false,
|
|
1929
|
+
variant: "link",
|
|
1930
|
+
orientation: "horizontal",
|
|
1931
|
+
class: {
|
|
1932
|
+
link: "data-[state=open]:text-(--ui-text-highlighted)",
|
|
1933
|
+
linkLeadingIcon: "group-data-[state=open]:text-(--ui-text)"
|
|
1577
1934
|
}
|
|
1578
1935
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
1579
1936
|
color,
|
|
1580
1937
|
variant: "link",
|
|
1581
1938
|
active: true,
|
|
1582
1939
|
class: {
|
|
1583
|
-
link: `text-
|
|
1584
|
-
linkLeadingIcon: `text-[
|
|
1940
|
+
link: `text-(--ui-${color})`,
|
|
1941
|
+
linkLeadingIcon: `text-(--ui-${color}) group-data-[state=open]:text-(--ui-${color})`
|
|
1585
1942
|
}
|
|
1586
1943
|
})), {
|
|
1587
1944
|
color: "neutral",
|
|
1588
1945
|
variant: "link",
|
|
1589
1946
|
active: true,
|
|
1590
1947
|
class: {
|
|
1591
|
-
link: "text-
|
|
1592
|
-
linkLeadingIcon: "text-[
|
|
1948
|
+
link: "text-(--ui-text-highlighted)",
|
|
1949
|
+
linkLeadingIcon: "text-(--ui-text-highlighted) group-data-[state=open]:text-(--ui-text-highlighted)"
|
|
1593
1950
|
}
|
|
1594
1951
|
}, ...(options.theme.colors || []).map((highlightColor) => ({
|
|
1595
1952
|
highlightColor,
|
|
1596
1953
|
highlight: true,
|
|
1954
|
+
level: true,
|
|
1597
1955
|
active: true,
|
|
1598
1956
|
class: {
|
|
1599
|
-
link: `after:bg-
|
|
1957
|
+
link: `after:bg-(--ui-${highlightColor})`
|
|
1600
1958
|
}
|
|
1601
1959
|
})), {
|
|
1602
1960
|
highlightColor: "neutral",
|
|
1603
1961
|
highlight: true,
|
|
1962
|
+
level: true,
|
|
1604
1963
|
active: true,
|
|
1605
1964
|
class: {
|
|
1606
|
-
link: "after:bg-
|
|
1965
|
+
link: "after:bg-(--ui-bg-inverted)"
|
|
1966
|
+
}
|
|
1967
|
+
}, {
|
|
1968
|
+
orientation: "vertical",
|
|
1969
|
+
collapsed: false,
|
|
1970
|
+
class: {
|
|
1971
|
+
childList: "ms-5 border-s border-(--ui-border)",
|
|
1972
|
+
childItem: "ps-1.5 -ms-px"
|
|
1973
|
+
}
|
|
1974
|
+
}, {
|
|
1975
|
+
orientation: "vertical",
|
|
1976
|
+
collapsed: true,
|
|
1977
|
+
class: {
|
|
1978
|
+
link: "px-1.5"
|
|
1607
1979
|
}
|
|
1608
1980
|
}],
|
|
1609
1981
|
defaultVariants: {
|
|
@@ -1622,19 +1994,81 @@ const pagination = {
|
|
|
1622
1994
|
}
|
|
1623
1995
|
};
|
|
1624
1996
|
|
|
1997
|
+
const pinInput = (options) => ({
|
|
1998
|
+
slots: {
|
|
1999
|
+
root: "relative inline-flex items-center gap-1.5",
|
|
2000
|
+
base: ["rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-(--ui-text-dimmed) text-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"]
|
|
2001
|
+
},
|
|
2002
|
+
variants: {
|
|
2003
|
+
size: {
|
|
2004
|
+
xs: {
|
|
2005
|
+
base: "size-6 text-xs"
|
|
2006
|
+
},
|
|
2007
|
+
sm: {
|
|
2008
|
+
base: "size-7 text-xs"
|
|
2009
|
+
},
|
|
2010
|
+
md: {
|
|
2011
|
+
base: "size-8 text-sm"
|
|
2012
|
+
},
|
|
2013
|
+
lg: {
|
|
2014
|
+
base: "size-9 text-sm"
|
|
2015
|
+
},
|
|
2016
|
+
xl: {
|
|
2017
|
+
base: "size-10 text-base"
|
|
2018
|
+
}
|
|
2019
|
+
},
|
|
2020
|
+
variant: {
|
|
2021
|
+
outline: "text-(--ui-text-highlighted) bg-(--ui-bg) ring ring-inset ring-(--ui-border-accented)",
|
|
2022
|
+
soft: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated)/50 hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-(--ui-bg-elevated)/50",
|
|
2023
|
+
subtle: "text-(--ui-text-highlighted) bg-(--ui-bg-elevated) ring ring-inset ring-(--ui-border-accented)",
|
|
2024
|
+
ghost: "text-(--ui-text-highlighted) bg-transparent hover:bg-(--ui-bg-elevated) focus:bg-(--ui-bg-elevated) disabled:bg-transparent dark:disabled:bg-transparent",
|
|
2025
|
+
none: "text-(--ui-text-highlighted) bg-transparent"
|
|
2026
|
+
},
|
|
2027
|
+
color: {
|
|
2028
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
|
|
2029
|
+
neutral: ""
|
|
2030
|
+
},
|
|
2031
|
+
highlight: {
|
|
2032
|
+
true: ""
|
|
2033
|
+
}
|
|
2034
|
+
},
|
|
2035
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
2036
|
+
color,
|
|
2037
|
+
variant: ["outline", "subtle"],
|
|
2038
|
+
class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
2039
|
+
})), ...(options.theme.colors || []).map((color) => ({
|
|
2040
|
+
color,
|
|
2041
|
+
highlight: true,
|
|
2042
|
+
class: `ring ring-inset ring-(--ui-${color})`
|
|
2043
|
+
})), {
|
|
2044
|
+
color: "neutral",
|
|
2045
|
+
variant: ["outline", "subtle"],
|
|
2046
|
+
class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
2047
|
+
}, {
|
|
2048
|
+
color: "neutral",
|
|
2049
|
+
highlight: true,
|
|
2050
|
+
class: "ring ring-inset ring-(--ui-border-inverted)"
|
|
2051
|
+
}],
|
|
2052
|
+
defaultVariants: {
|
|
2053
|
+
size: "md",
|
|
2054
|
+
color: "primary",
|
|
2055
|
+
variant: "outline"
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2058
|
+
|
|
1625
2059
|
const popover = {
|
|
1626
2060
|
slots: {
|
|
1627
|
-
content: "bg-
|
|
1628
|
-
arrow: "fill-
|
|
2061
|
+
content: "bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] focus:outline-none pointer-events-auto",
|
|
2062
|
+
arrow: "fill-(--ui-border)"
|
|
1629
2063
|
}
|
|
1630
2064
|
};
|
|
1631
2065
|
|
|
1632
2066
|
const progress = (options) => ({
|
|
1633
2067
|
slots: {
|
|
1634
2068
|
root: "gap-2",
|
|
1635
|
-
base: "relative overflow-hidden rounded-full bg-
|
|
2069
|
+
base: "relative overflow-hidden rounded-full bg-(--ui-bg-accented)",
|
|
1636
2070
|
indicator: "rounded-full size-full transition-transform duration-200 ease-out",
|
|
1637
|
-
status: "flex justify-end text-
|
|
2071
|
+
status: "flex justify-end text-(--ui-text-dimmed) transition-[width] duration-200",
|
|
1638
2072
|
steps: "grid items-end",
|
|
1639
2073
|
step: "truncate text-end row-start-1 col-start-1 transition-opacity"
|
|
1640
2074
|
},
|
|
@@ -1647,12 +2081,12 @@ const progress = (options) => ({
|
|
|
1647
2081
|
},
|
|
1648
2082
|
color: {
|
|
1649
2083
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1650
|
-
indicator: `bg-
|
|
1651
|
-
steps: `text-
|
|
2084
|
+
indicator: `bg-(--ui-${color})`,
|
|
2085
|
+
steps: `text-(--ui-${color})`
|
|
1652
2086
|
}])),
|
|
1653
2087
|
neutral: {
|
|
1654
|
-
indicator: "bg-
|
|
1655
|
-
steps: "text-
|
|
2088
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
2089
|
+
steps: "text-(--ui-bg)"
|
|
1656
2090
|
}
|
|
1657
2091
|
},
|
|
1658
2092
|
size: {
|
|
@@ -1690,7 +2124,7 @@ const progress = (options) => ({
|
|
|
1690
2124
|
step: "opacity-100"
|
|
1691
2125
|
},
|
|
1692
2126
|
first: {
|
|
1693
|
-
step: "opacity-100 text-
|
|
2127
|
+
step: "opacity-100 text-(--ui-text-muted)"
|
|
1694
2128
|
},
|
|
1695
2129
|
other: {
|
|
1696
2130
|
step: "opacity-0"
|
|
@@ -1791,7 +2225,7 @@ const progress = (options) => ({
|
|
|
1791
2225
|
orientation: "horizontal",
|
|
1792
2226
|
animation: "carousel",
|
|
1793
2227
|
class: {
|
|
1794
|
-
indicator: "data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite]"
|
|
2228
|
+
indicator: "data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-rtl_2s_ease-in-out_infinite]"
|
|
1795
2229
|
}
|
|
1796
2230
|
}, {
|
|
1797
2231
|
orientation: "vertical",
|
|
@@ -1803,7 +2237,7 @@ const progress = (options) => ({
|
|
|
1803
2237
|
orientation: "horizontal",
|
|
1804
2238
|
animation: "carousel-inverse",
|
|
1805
2239
|
class: {
|
|
1806
|
-
indicator: "data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite]"
|
|
2240
|
+
indicator: "data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite] data-[state=indeterminate]:rtl:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"
|
|
1807
2241
|
}
|
|
1808
2242
|
}, {
|
|
1809
2243
|
orientation: "vertical",
|
|
@@ -1847,24 +2281,24 @@ const radioGroup = (options) => ({
|
|
|
1847
2281
|
slots: {
|
|
1848
2282
|
root: "relative",
|
|
1849
2283
|
fieldset: "flex",
|
|
1850
|
-
legend: "mb-1 block font-medium text-
|
|
2284
|
+
legend: "mb-1 block font-medium text-(--ui-text)",
|
|
1851
2285
|
item: "flex items-start",
|
|
1852
|
-
base: "rounded-full ring ring-inset ring-
|
|
1853
|
-
indicator: "flex items-center justify-center size-full rounded-full after:bg-
|
|
2286
|
+
base: "rounded-full ring ring-inset ring-(--ui-border-accented) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2287
|
+
indicator: "flex items-center justify-center size-full rounded-full after:bg-(--ui-bg) after:rounded-full",
|
|
1854
2288
|
container: "flex items-center",
|
|
1855
2289
|
wrapper: "ms-2",
|
|
1856
|
-
label: "block font-medium text-
|
|
1857
|
-
description: "text-
|
|
2290
|
+
label: "block font-medium text-(--ui-text)",
|
|
2291
|
+
description: "text-(--ui-text-muted)"
|
|
1858
2292
|
},
|
|
1859
2293
|
variants: {
|
|
1860
2294
|
color: {
|
|
1861
2295
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
1862
|
-
base: `focus-visible:outline-
|
|
1863
|
-
indicator: `bg-
|
|
2296
|
+
base: `focus-visible:outline-(--ui-${color})`,
|
|
2297
|
+
indicator: `bg-(--ui-${color})`
|
|
1864
2298
|
}])),
|
|
1865
2299
|
neutral: {
|
|
1866
|
-
base: "focus-visible:outline-
|
|
1867
|
-
indicator: "bg-
|
|
2300
|
+
base: "focus-visible:outline-(--ui-border-inverted)",
|
|
2301
|
+
indicator: "bg-(--ui-bg-inverted)"
|
|
1868
2302
|
}
|
|
1869
2303
|
},
|
|
1870
2304
|
orientation: {
|
|
@@ -1926,7 +2360,7 @@ const radioGroup = (options) => ({
|
|
|
1926
2360
|
},
|
|
1927
2361
|
required: {
|
|
1928
2362
|
true: {
|
|
1929
|
-
legend: "after:content-['*'] after:ms-0.5 after:text-
|
|
2363
|
+
legend: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
1930
2364
|
}
|
|
1931
2365
|
}
|
|
1932
2366
|
},
|
|
@@ -1939,18 +2373,19 @@ const radioGroup = (options) => ({
|
|
|
1939
2373
|
const select = (options) => {
|
|
1940
2374
|
return defuFn({
|
|
1941
2375
|
slots: {
|
|
1942
|
-
root: () =>
|
|
2376
|
+
root: () => undefined,
|
|
1943
2377
|
base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
|
|
1944
|
-
value: "truncate
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2378
|
+
value: "truncate pointer-events-none",
|
|
2379
|
+
placeholder: "truncate text-(--ui-text-dimmed)",
|
|
2380
|
+
arrow: "fill-(--ui-border)",
|
|
2381
|
+
content: "max-h-60 w-(--reka-popper-anchor-width) bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-(--ui-border) overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] pointer-events-auto",
|
|
2382
|
+
viewport: "divide-y divide-(--ui-border) scroll-py-1",
|
|
1948
2383
|
group: "p-1 isolate",
|
|
1949
|
-
empty: "py-2 text-center text-sm text-
|
|
1950
|
-
label: "font-semibold text-
|
|
1951
|
-
separator: "-mx-1 my-1 h-px bg-
|
|
1952
|
-
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-
|
|
1953
|
-
itemLeadingIcon: ["shrink-0 text-
|
|
2384
|
+
empty: "py-2 text-center text-sm text-(--ui-text-muted)",
|
|
2385
|
+
label: "font-semibold text-(--ui-text-highlighted)",
|
|
2386
|
+
separator: "-mx-1 my-1 h-px bg-(--ui-border)",
|
|
2387
|
+
item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"],
|
|
2388
|
+
itemLeadingIcon: ["shrink-0 text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)", options.theme.transitions && "transition-colors"],
|
|
1954
2389
|
itemLeadingAvatar: "shrink-0",
|
|
1955
2390
|
itemLeadingAvatarSize: "",
|
|
1956
2391
|
itemLeadingChip: "shrink-0",
|
|
@@ -2015,28 +2450,8 @@ const select = (options) => {
|
|
|
2015
2450
|
const selectMenu = (options) => {
|
|
2016
2451
|
return defu({
|
|
2017
2452
|
slots: {
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
input: "placeholder:text-[var(--ui-text-dimmed)] border-0 border-b border-[var(--ui-border)] focus:outline-none"
|
|
2021
|
-
},
|
|
2022
|
-
variants: {
|
|
2023
|
-
size: {
|
|
2024
|
-
xs: {
|
|
2025
|
-
input: "text-xs px-2 py-1"
|
|
2026
|
-
},
|
|
2027
|
-
sm: {
|
|
2028
|
-
input: "text-xs px-2.5 py-1.5"
|
|
2029
|
-
},
|
|
2030
|
-
md: {
|
|
2031
|
-
input: "text-sm px-2.5 py-1.5"
|
|
2032
|
-
},
|
|
2033
|
-
lg: {
|
|
2034
|
-
input: "text-sm px-3 py-2"
|
|
2035
|
-
},
|
|
2036
|
-
xl: {
|
|
2037
|
-
input: "text-base px-3 py-2"
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2453
|
+
input: "border-b border-(--ui-border)",
|
|
2454
|
+
focusScope: "flex flex-col min-h-0"
|
|
2040
2455
|
}
|
|
2041
2456
|
}, select(options));
|
|
2042
2457
|
};
|
|
@@ -2045,7 +2460,7 @@ const separator = (options) => ({
|
|
|
2045
2460
|
slots: {
|
|
2046
2461
|
root: "flex items-center align-center text-center",
|
|
2047
2462
|
border: "",
|
|
2048
|
-
container: "font-medium text-
|
|
2463
|
+
container: "font-medium text-(--ui-text) flex",
|
|
2049
2464
|
icon: "shrink-0 size-5",
|
|
2050
2465
|
avatar: "shrink-0",
|
|
2051
2466
|
avatarSize: "2xs",
|
|
@@ -2053,8 +2468,8 @@ const separator = (options) => ({
|
|
|
2053
2468
|
},
|
|
2054
2469
|
variants: {
|
|
2055
2470
|
color: {
|
|
2056
|
-
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-
|
|
2057
|
-
neutral: { border: "border-
|
|
2471
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-(--ui-${color})` }])),
|
|
2472
|
+
neutral: { border: "border-(--ui-border)" }
|
|
2058
2473
|
},
|
|
2059
2474
|
orientation: {
|
|
2060
2475
|
horizontal: {
|
|
@@ -2136,18 +2551,19 @@ const separator = (options) => ({
|
|
|
2136
2551
|
});
|
|
2137
2552
|
|
|
2138
2553
|
const skeleton = {
|
|
2139
|
-
base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-
|
|
2554
|
+
base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-(--ui-bg-elevated)"
|
|
2140
2555
|
};
|
|
2141
2556
|
|
|
2142
2557
|
const slideover = {
|
|
2143
2558
|
slots: {
|
|
2144
|
-
overlay: "fixed inset-0 bg-
|
|
2145
|
-
content: "fixed bg-
|
|
2146
|
-
header: "
|
|
2559
|
+
overlay: "fixed inset-0 bg-(--ui-bg-elevated)/75",
|
|
2560
|
+
content: "fixed bg-(--ui-bg) divide-y divide-(--ui-border) sm:ring ring-(--ui-border) sm:shadow-lg flex flex-col focus:outline-none",
|
|
2561
|
+
header: "flex items-center gap-1.5 p-4 sm:px-6 min-h-16",
|
|
2562
|
+
wrapper: "",
|
|
2147
2563
|
body: "flex-1 overflow-y-auto p-4 sm:p-6",
|
|
2148
2564
|
footer: "flex items-center gap-1.5 p-4 sm:px-6",
|
|
2149
|
-
title: "text-
|
|
2150
|
-
description: "mt-1 text-
|
|
2565
|
+
title: "text-(--ui-text-highlighted) font-semibold",
|
|
2566
|
+
description: "mt-1 text-(--ui-text-muted) text-sm",
|
|
2151
2567
|
close: "absolute top-4 end-4"
|
|
2152
2568
|
},
|
|
2153
2569
|
variants: {
|
|
@@ -2201,19 +2617,19 @@ const slideover = {
|
|
|
2201
2617
|
const slider = (options) => ({
|
|
2202
2618
|
slots: {
|
|
2203
2619
|
root: "relative flex items-center select-none touch-none",
|
|
2204
|
-
track: "relative bg-
|
|
2620
|
+
track: "relative bg-(--ui-bg-accented) overflow-hidden rounded-full grow",
|
|
2205
2621
|
range: "absolute rounded-full",
|
|
2206
|
-
thumb: "rounded-full bg-
|
|
2622
|
+
thumb: "rounded-full bg-(--ui-bg) ring-2 focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
2207
2623
|
},
|
|
2208
2624
|
variants: {
|
|
2209
2625
|
color: {
|
|
2210
2626
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2211
|
-
range: `bg-
|
|
2212
|
-
thumb: `ring-
|
|
2627
|
+
range: `bg-(--ui-${color})`,
|
|
2628
|
+
thumb: `ring-(--ui-${color}) focus-visible:outline-(--ui-${color})/50`
|
|
2213
2629
|
}])),
|
|
2214
2630
|
neutral: {
|
|
2215
|
-
range: "bg-
|
|
2216
|
-
thumb: "ring-
|
|
2631
|
+
range: "bg-(--ui-bg-inverted)",
|
|
2632
|
+
thumb: "ring-(--ui-border-inverted) focus-visible:outline-(--ui-border-inverted)/50"
|
|
2217
2633
|
}
|
|
2218
2634
|
},
|
|
2219
2635
|
size: {
|
|
@@ -2316,26 +2732,150 @@ const slider = (options) => ({
|
|
|
2316
2732
|
}
|
|
2317
2733
|
});
|
|
2318
2734
|
|
|
2735
|
+
const stepper = (options) => ({
|
|
2736
|
+
slots: {
|
|
2737
|
+
root: "flex gap-4",
|
|
2738
|
+
header: "flex",
|
|
2739
|
+
item: "group text-center relative w-full",
|
|
2740
|
+
container: "relative",
|
|
2741
|
+
trigger: "rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:text-(--ui-bg) group-data-[state=active]:text-(--ui-bg) text-(--ui-text-muted) bg-(--ui-bg-elevated) focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
2742
|
+
indicator: "flex items-center justify-center size-full",
|
|
2743
|
+
icon: "shrink-0",
|
|
2744
|
+
separator: "absolute rounded-full group-data-[disabled]:opacity-75 bg-(--ui-border-accented)",
|
|
2745
|
+
wrapper: "",
|
|
2746
|
+
title: "font-medium text-(--ui-text)",
|
|
2747
|
+
description: "text-(--ui-text-muted) text-wrap",
|
|
2748
|
+
content: "size-full"
|
|
2749
|
+
},
|
|
2750
|
+
variants: {
|
|
2751
|
+
orientation: {
|
|
2752
|
+
horizontal: {
|
|
2753
|
+
root: "flex-col",
|
|
2754
|
+
container: "flex justify-center",
|
|
2755
|
+
separator: "top-[calc(50%-2px)] h-0.5",
|
|
2756
|
+
wrapper: "mt-1"
|
|
2757
|
+
},
|
|
2758
|
+
vertical: {
|
|
2759
|
+
header: "flex-col gap-4",
|
|
2760
|
+
item: "flex text-start",
|
|
2761
|
+
separator: "start-[calc(50%-1px)] -bottom-[10px] w-0.5"
|
|
2762
|
+
}
|
|
2763
|
+
},
|
|
2764
|
+
size: {
|
|
2765
|
+
xs: {
|
|
2766
|
+
trigger: "size-6 text-xs",
|
|
2767
|
+
icon: "size-3",
|
|
2768
|
+
title: "text-xs",
|
|
2769
|
+
description: "text-xs",
|
|
2770
|
+
wrapper: "mt-1.5"
|
|
2771
|
+
},
|
|
2772
|
+
sm: {
|
|
2773
|
+
trigger: "size-8 text-sm",
|
|
2774
|
+
icon: "size-4",
|
|
2775
|
+
title: "text-xs",
|
|
2776
|
+
description: "text-xs",
|
|
2777
|
+
wrapper: "mt-2"
|
|
2778
|
+
},
|
|
2779
|
+
md: {
|
|
2780
|
+
trigger: "size-10 text-base",
|
|
2781
|
+
icon: "size-5",
|
|
2782
|
+
title: "text-sm",
|
|
2783
|
+
description: "text-sm",
|
|
2784
|
+
wrapper: "mt-2.5"
|
|
2785
|
+
},
|
|
2786
|
+
lg: {
|
|
2787
|
+
trigger: "size-12 text-lg",
|
|
2788
|
+
icon: "size-6",
|
|
2789
|
+
title: "text-base",
|
|
2790
|
+
description: "text-base",
|
|
2791
|
+
wrapper: "mt-3"
|
|
2792
|
+
},
|
|
2793
|
+
xl: {
|
|
2794
|
+
trigger: "size-14 text-xl",
|
|
2795
|
+
icon: "size-7",
|
|
2796
|
+
title: "text-lg",
|
|
2797
|
+
description: "text-lg",
|
|
2798
|
+
wrapper: "mt-3.5"
|
|
2799
|
+
}
|
|
2800
|
+
},
|
|
2801
|
+
color: {
|
|
2802
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2803
|
+
trigger: `group-data-[state=completed]:bg-(--ui-${color}) group-data-[state=active]:bg-(--ui-${color}) focus-visible:outline-(--ui-${color})`,
|
|
2804
|
+
separator: `group-data-[state=completed]:bg-(--ui-${color})`
|
|
2805
|
+
}])),
|
|
2806
|
+
neutral: {
|
|
2807
|
+
trigger: `group-data-[state=completed]:bg-(--ui-bg-inverted) group-data-[state=active]:bg-(--ui-bg-inverted) focus-visible:outline-(--ui-border-inverted)`,
|
|
2808
|
+
separator: `group-data-[state=completed]:bg-(--ui-bg-inverted)`
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
},
|
|
2812
|
+
compoundVariants: [{
|
|
2813
|
+
orientation: "horizontal",
|
|
2814
|
+
size: "xs",
|
|
2815
|
+
class: { separator: "start-[calc(50%+16px)] end-[calc(-50%+16px)]" }
|
|
2816
|
+
}, {
|
|
2817
|
+
orientation: "horizontal",
|
|
2818
|
+
size: "sm",
|
|
2819
|
+
class: { separator: "start-[calc(50%+20px)] end-[calc(-50%+20px)]" }
|
|
2820
|
+
}, {
|
|
2821
|
+
orientation: "horizontal",
|
|
2822
|
+
size: "md",
|
|
2823
|
+
class: { separator: "start-[calc(50%+28px)] end-[calc(-50%+28px)]" }
|
|
2824
|
+
}, {
|
|
2825
|
+
orientation: "horizontal",
|
|
2826
|
+
size: "lg",
|
|
2827
|
+
class: { separator: "start-[calc(50%+32px)] end-[calc(-50%+32px)]" }
|
|
2828
|
+
}, {
|
|
2829
|
+
orientation: "horizontal",
|
|
2830
|
+
size: "xl",
|
|
2831
|
+
class: { separator: "start-[calc(50%+36px)] end-[calc(-50%+36px)]" }
|
|
2832
|
+
}, {
|
|
2833
|
+
orientation: "vertical",
|
|
2834
|
+
size: "xs",
|
|
2835
|
+
class: { separator: "top-[30px]", item: "gap-1.5" }
|
|
2836
|
+
}, {
|
|
2837
|
+
orientation: "vertical",
|
|
2838
|
+
size: "sm",
|
|
2839
|
+
class: { separator: "top-[38px]", item: "gap-2" }
|
|
2840
|
+
}, {
|
|
2841
|
+
orientation: "vertical",
|
|
2842
|
+
size: "md",
|
|
2843
|
+
class: { separator: "top-[46px]", item: "gap-2.5" }
|
|
2844
|
+
}, {
|
|
2845
|
+
orientation: "vertical",
|
|
2846
|
+
size: "lg",
|
|
2847
|
+
class: { separator: "top-[54px]", item: "gap-3" }
|
|
2848
|
+
}, {
|
|
2849
|
+
orientation: "vertical",
|
|
2850
|
+
size: "xl",
|
|
2851
|
+
class: { separator: "top-[62px]", item: "gap-3.5" }
|
|
2852
|
+
}],
|
|
2853
|
+
defaultVariants: {
|
|
2854
|
+
size: "md",
|
|
2855
|
+
color: "primary"
|
|
2856
|
+
}
|
|
2857
|
+
});
|
|
2858
|
+
|
|
2319
2859
|
const _switch = (options) => ({
|
|
2320
2860
|
slots: {
|
|
2321
2861
|
root: "relative flex items-start",
|
|
2322
|
-
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-
|
|
2862
|
+
base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-(--ui-bg-accented)", options.theme.transitions && "transition-colors duration-200"],
|
|
2323
2863
|
container: "flex items-center",
|
|
2324
|
-
thumb: "group pointer-events-none
|
|
2325
|
-
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-
|
|
2864
|
+
thumb: "group pointer-events-none rounded-full bg-(--ui-bg) shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",
|
|
2865
|
+
icon: ["absolute shrink-0 group-data-[state=unchecked]:text-(--ui-text-dimmed) opacity-0 size-10/12", options.theme.transitions && "transition-[color,opacity] duration-200"],
|
|
2326
2866
|
wrapper: "ms-2",
|
|
2327
|
-
label: "block font-medium text-
|
|
2328
|
-
description: "text-
|
|
2867
|
+
label: "block font-medium text-(--ui-text)",
|
|
2868
|
+
description: "text-(--ui-text-muted)"
|
|
2329
2869
|
},
|
|
2330
2870
|
variants: {
|
|
2331
2871
|
color: {
|
|
2332
2872
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2333
|
-
base: `data-[state=checked]:bg-
|
|
2334
|
-
icon: `group-data-[state=checked]:text-
|
|
2873
|
+
base: `data-[state=checked]:bg-(--ui-${color}) focus-visible:outline-(--ui-${color})`,
|
|
2874
|
+
icon: `group-data-[state=checked]:text-(--ui-${color})`
|
|
2335
2875
|
}])),
|
|
2336
2876
|
neutral: {
|
|
2337
|
-
base: "data-[state=checked]:bg-
|
|
2338
|
-
icon: "group-data-[state=checked]:text-
|
|
2877
|
+
base: "data-[state=checked]:bg-(--ui-bg-inverted) focus-visible:outline-(--ui-border-inverted)",
|
|
2878
|
+
icon: "group-data-[state=checked]:text-(--ui-text-highlighted)"
|
|
2339
2879
|
}
|
|
2340
2880
|
},
|
|
2341
2881
|
size: {
|
|
@@ -2387,7 +2927,7 @@ const _switch = (options) => ({
|
|
|
2387
2927
|
},
|
|
2388
2928
|
required: {
|
|
2389
2929
|
true: {
|
|
2390
|
-
label: "after:content-['*'] after:ms-0.5 after:text-
|
|
2930
|
+
label: "after:content-['*'] after:ms-0.5 after:text-(--ui-error)"
|
|
2391
2931
|
}
|
|
2392
2932
|
},
|
|
2393
2933
|
disabled: {
|
|
@@ -2408,23 +2948,24 @@ const table = (options) => ({
|
|
|
2408
2948
|
slots: {
|
|
2409
2949
|
root: "relative overflow-auto",
|
|
2410
2950
|
base: "min-w-full overflow-clip",
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2951
|
+
caption: "sr-only",
|
|
2952
|
+
thead: "relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-(--ui-border-accented)",
|
|
2953
|
+
tbody: "divide-y divide-(--ui-border) [&>tr]:data-[selectable=true]:hover:bg-(--ui-bg-elevated)/50 [&>tr]:data-[selectable=true]:focus-visible:outline-(--ui-primary)",
|
|
2954
|
+
tr: "data-[selected=true]:bg-(--ui-bg-elevated)/50",
|
|
2955
|
+
th: "px-4 py-3.5 text-sm text-(--ui-text-highlighted) text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
|
|
2956
|
+
td: "p-4 text-sm text-(--ui-text-muted) whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
2957
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)"
|
|
2417
2958
|
},
|
|
2418
2959
|
variants: {
|
|
2419
2960
|
pinned: {
|
|
2420
2961
|
true: {
|
|
2421
|
-
th: "sticky bg-
|
|
2422
|
-
td: "sticky bg-
|
|
2962
|
+
th: "sticky bg-(--ui-bg)/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0",
|
|
2963
|
+
td: "sticky bg-(--ui-bg)/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0"
|
|
2423
2964
|
}
|
|
2424
2965
|
},
|
|
2425
2966
|
sticky: {
|
|
2426
2967
|
true: {
|
|
2427
|
-
thead: "sticky top-0 inset-x-0 bg-
|
|
2968
|
+
thead: "sticky top-0 inset-x-0 bg-(--ui-bg)/75 z-[1] backdrop-blur"
|
|
2428
2969
|
}
|
|
2429
2970
|
},
|
|
2430
2971
|
loading: {
|
|
@@ -2447,25 +2988,25 @@ const table = (options) => ({
|
|
|
2447
2988
|
loading: true,
|
|
2448
2989
|
loadingColor,
|
|
2449
2990
|
class: {
|
|
2450
|
-
thead: `after:bg-
|
|
2991
|
+
thead: `after:bg-(--ui-${loadingColor})`
|
|
2451
2992
|
}
|
|
2452
2993
|
})), {
|
|
2453
2994
|
loading: true,
|
|
2454
2995
|
loadingColor: "neutral",
|
|
2455
2996
|
class: {
|
|
2456
|
-
thead: "after:bg-
|
|
2997
|
+
thead: "after:bg-(--ui-bg-inverted)"
|
|
2457
2998
|
}
|
|
2458
2999
|
}, {
|
|
2459
3000
|
loading: true,
|
|
2460
3001
|
loadingAnimation: "carousel",
|
|
2461
3002
|
class: {
|
|
2462
|
-
thead: "after:animate-[carousel_2s_ease-in-out_infinite]"
|
|
3003
|
+
thead: "after:animate-[carousel_2s_ease-in-out_infinite] rtl:after:animate-[carousel-rtl_2s_ease-in-out_infinite]"
|
|
2463
3004
|
}
|
|
2464
3005
|
}, {
|
|
2465
3006
|
loading: true,
|
|
2466
3007
|
loadingAnimation: "carousel-inverse",
|
|
2467
3008
|
class: {
|
|
2468
|
-
thead: "after:animate-[carousel-inverse_2s_ease-in-out_infinite]"
|
|
3009
|
+
thead: "after:animate-[carousel-inverse_2s_ease-in-out_infinite] rtl:after:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]"
|
|
2469
3010
|
}
|
|
2470
3011
|
}, {
|
|
2471
3012
|
loading: true,
|
|
@@ -2491,7 +3032,7 @@ const tabs = (options) => ({
|
|
|
2491
3032
|
root: "flex items-center gap-2",
|
|
2492
3033
|
list: "relative flex p-1 group",
|
|
2493
3034
|
indicator: "absolute transition-[translate,width] duration-200",
|
|
2494
|
-
trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-
|
|
3035
|
+
trigger: ["group relative inline-flex items-center shrink-0 min-w-0 data-[state=inactive]:text-(--ui-text-muted) hover:data-[state=inactive]:not-disabled:text-(--ui-text) font-medium rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus:outline-hidden", options.theme.transitions && "transition-colors"],
|
|
2495
3036
|
content: "focus:outline-none w-full",
|
|
2496
3037
|
leadingIcon: "shrink-0",
|
|
2497
3038
|
leadingAvatar: "shrink-0",
|
|
@@ -2505,12 +3046,12 @@ const tabs = (options) => ({
|
|
|
2505
3046
|
},
|
|
2506
3047
|
variant: {
|
|
2507
3048
|
pill: {
|
|
2508
|
-
list: "bg-
|
|
3049
|
+
list: "bg-(--ui-bg-elevated) rounded-[calc(var(--ui-radius)*2)]",
|
|
2509
3050
|
trigger: "flex-1 w-full",
|
|
2510
|
-
indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-
|
|
3051
|
+
indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-xs"
|
|
2511
3052
|
},
|
|
2512
3053
|
link: {
|
|
2513
|
-
list: "border-
|
|
3054
|
+
list: "border-(--ui-border)",
|
|
2514
3055
|
indicator: "rounded-full"
|
|
2515
3056
|
}
|
|
2516
3057
|
},
|
|
@@ -2518,12 +3059,12 @@ const tabs = (options) => ({
|
|
|
2518
3059
|
horizontal: {
|
|
2519
3060
|
root: "flex-col",
|
|
2520
3061
|
list: "w-full",
|
|
2521
|
-
indicator: "left-0 w-
|
|
3062
|
+
indicator: "left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",
|
|
2522
3063
|
trigger: "justify-center"
|
|
2523
3064
|
},
|
|
2524
3065
|
vertical: {
|
|
2525
3066
|
list: "flex-col",
|
|
2526
|
-
indicator: "top-0 h-
|
|
3067
|
+
indicator: "top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"
|
|
2527
3068
|
}
|
|
2528
3069
|
},
|
|
2529
3070
|
size: {
|
|
@@ -2585,29 +3126,29 @@ const tabs = (options) => ({
|
|
|
2585
3126
|
color,
|
|
2586
3127
|
variant: "pill",
|
|
2587
3128
|
class: {
|
|
2588
|
-
indicator: `bg-
|
|
2589
|
-
trigger: `data-[state=active]:text-
|
|
3129
|
+
indicator: `bg-(--ui-${color})`,
|
|
3130
|
+
trigger: `data-[state=active]:text-(--ui-bg) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-${color})`
|
|
2590
3131
|
}
|
|
2591
3132
|
})), {
|
|
2592
3133
|
color: "neutral",
|
|
2593
3134
|
variant: "pill",
|
|
2594
3135
|
class: {
|
|
2595
|
-
indicator: "bg-
|
|
2596
|
-
trigger: "data-[state=active]:text-
|
|
3136
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
3137
|
+
trigger: "data-[state=active]:text-(--ui-bg) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ui-border-inverted)"
|
|
2597
3138
|
}
|
|
2598
3139
|
}, ...(options.theme.colors || []).map((color) => ({
|
|
2599
3140
|
color,
|
|
2600
3141
|
variant: "link",
|
|
2601
3142
|
class: {
|
|
2602
|
-
indicator: `bg-
|
|
2603
|
-
trigger: `data-[state=active]:text-
|
|
3143
|
+
indicator: `bg-(--ui-${color})`,
|
|
3144
|
+
trigger: `data-[state=active]:text-(--ui-${color}) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`
|
|
2604
3145
|
}
|
|
2605
3146
|
})), {
|
|
2606
3147
|
color: "neutral",
|
|
2607
3148
|
variant: "link",
|
|
2608
3149
|
class: {
|
|
2609
|
-
indicator: "bg-
|
|
2610
|
-
trigger: "data-[state=active]:text-
|
|
3150
|
+
indicator: "bg-(--ui-bg-inverted)",
|
|
3151
|
+
trigger: "data-[state=active]:text-(--ui-text-highlighted) focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)"
|
|
2611
3152
|
}
|
|
2612
3153
|
}],
|
|
2613
3154
|
defaultVariants: {
|
|
@@ -2623,38 +3164,43 @@ const textarea = (options) => {
|
|
|
2623
3164
|
|
|
2624
3165
|
const toast = (options) => ({
|
|
2625
3166
|
slots: {
|
|
2626
|
-
root: "relative group overflow-hidden bg-
|
|
2627
|
-
wrapper: "w-0 flex-1 flex flex-col
|
|
2628
|
-
title: "text-sm font-medium text-
|
|
2629
|
-
description: "text-sm text-
|
|
3167
|
+
root: "relative group overflow-hidden bg-(--ui-bg) shadow-lg rounded-[calc(var(--ui-radius)*2)] ring ring-(--ui-border) p-4 flex gap-2.5 focus:outline-none",
|
|
3168
|
+
wrapper: "w-0 flex-1 flex flex-col",
|
|
3169
|
+
title: "text-sm font-medium text-(--ui-text-highlighted)",
|
|
3170
|
+
description: "text-sm text-(--ui-text-muted)",
|
|
2630
3171
|
icon: "shrink-0 size-5",
|
|
2631
3172
|
avatar: "shrink-0",
|
|
2632
3173
|
avatarSize: "2xl",
|
|
2633
3174
|
actions: "flex gap-1.5 shrink-0",
|
|
2634
3175
|
progress: "absolute inset-x-0 bottom-0 h-1 z-[-1]",
|
|
2635
|
-
close: "p-0
|
|
3176
|
+
close: "p-0"
|
|
2636
3177
|
},
|
|
2637
3178
|
variants: {
|
|
2638
3179
|
color: {
|
|
2639
3180
|
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
2640
|
-
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
2641
|
-
icon: `text-
|
|
2642
|
-
progress: `bg-
|
|
3181
|
+
root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-${color})`,
|
|
3182
|
+
icon: `text-(--ui-${color})`,
|
|
3183
|
+
progress: `bg-(--ui-${color})`
|
|
2643
3184
|
}])),
|
|
2644
3185
|
neutral: {
|
|
2645
|
-
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-
|
|
2646
|
-
icon: "text-
|
|
2647
|
-
progress: "bg-
|
|
3186
|
+
root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-(--ui-border-inverted)",
|
|
3187
|
+
icon: "text-(--ui-text-highlighted)",
|
|
3188
|
+
progress: "bg-(--ui-bg-inverted)"
|
|
2648
3189
|
}
|
|
2649
3190
|
},
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
root: "items-start",
|
|
2653
|
-
actions: "items-start mt-1"
|
|
2654
|
-
},
|
|
2655
|
-
false: {
|
|
3191
|
+
orientation: {
|
|
3192
|
+
horizontal: {
|
|
2656
3193
|
root: "items-center",
|
|
2657
3194
|
actions: "items-center"
|
|
3195
|
+
},
|
|
3196
|
+
vertical: {
|
|
3197
|
+
root: "items-start",
|
|
3198
|
+
actions: "items-start mt-2.5"
|
|
3199
|
+
}
|
|
3200
|
+
},
|
|
3201
|
+
title: {
|
|
3202
|
+
true: {
|
|
3203
|
+
description: "mt-1"
|
|
2658
3204
|
}
|
|
2659
3205
|
}
|
|
2660
3206
|
},
|
|
@@ -2665,8 +3211,8 @@ const toast = (options) => ({
|
|
|
2665
3211
|
|
|
2666
3212
|
const toaster = {
|
|
2667
3213
|
slots: {
|
|
2668
|
-
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-
|
|
2669
|
-
base: "absolute inset-x-0 z-
|
|
3214
|
+
viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none",
|
|
3215
|
+
base: "pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[expanded=false]:data-[front=false]:h-(--front-height) data-[expanded=false]:data-[front=false]:*:invisible data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"
|
|
2670
3216
|
},
|
|
2671
3217
|
variants: {
|
|
2672
3218
|
position: {
|
|
@@ -2710,10 +3256,10 @@ const toaster = {
|
|
|
2710
3256
|
}
|
|
2711
3257
|
}, {
|
|
2712
3258
|
swipeDirection: ["left", "right"],
|
|
2713
|
-
class: "data-[swipe=move]:translate-x-
|
|
3259
|
+
class: "data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0"
|
|
2714
3260
|
}, {
|
|
2715
3261
|
swipeDirection: ["up", "down"],
|
|
2716
|
-
class: "data-[swipe=move]:translate-y-
|
|
3262
|
+
class: "data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0"
|
|
2717
3263
|
}],
|
|
2718
3264
|
defaultVariants: {
|
|
2719
3265
|
position: "bottom-right"
|
|
@@ -2722,14 +3268,95 @@ const toaster = {
|
|
|
2722
3268
|
|
|
2723
3269
|
const tooltip = {
|
|
2724
3270
|
slots: {
|
|
2725
|
-
content: "flex items-center gap-1 bg-
|
|
2726
|
-
arrow: "fill-
|
|
3271
|
+
content: "flex items-center gap-1 bg-(--ui-bg) text-(--ui-text-highlighted) shadow-sm rounded-(--ui-radius) ring ring-(--ui-border) h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] pointer-events-auto",
|
|
3272
|
+
arrow: "fill-(--ui-border)",
|
|
2727
3273
|
text: "truncate",
|
|
2728
3274
|
kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:me-0.5`,
|
|
2729
3275
|
kbdsSize: "sm"
|
|
2730
3276
|
}
|
|
2731
3277
|
};
|
|
2732
3278
|
|
|
3279
|
+
const tree = (options) => ({
|
|
3280
|
+
slots: {
|
|
3281
|
+
root: "relative isolate",
|
|
3282
|
+
item: "",
|
|
3283
|
+
listWithChildren: "ms-4.5 border-s border-(--ui-border)",
|
|
3284
|
+
itemWithChildren: "ps-1.5 -ms-px",
|
|
3285
|
+
link: "relative group w-full flex items-center text-sm before:absolute before:inset-y-px before:inset-x-0 before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
|
|
3286
|
+
linkLeadingIcon: "shrink-0",
|
|
3287
|
+
linkLabel: "truncate",
|
|
3288
|
+
linkTrailing: "ms-auto inline-flex gap-1.5 items-center",
|
|
3289
|
+
linkTrailingIcon: "shrink-0 transform transition-transform duration-200 group-data-expanded:rotate-180"
|
|
3290
|
+
},
|
|
3291
|
+
variants: {
|
|
3292
|
+
color: {
|
|
3293
|
+
...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
|
|
3294
|
+
link: `focus-visible:before:ring-(--ui-${color})`
|
|
3295
|
+
}])),
|
|
3296
|
+
neutral: {
|
|
3297
|
+
link: "focus-visible:before:ring-(--ui-border-inverted)"
|
|
3298
|
+
}
|
|
3299
|
+
},
|
|
3300
|
+
size: {
|
|
3301
|
+
xs: {
|
|
3302
|
+
link: "px-2 py-1 text-xs gap-1",
|
|
3303
|
+
linkLeadingIcon: "size-4",
|
|
3304
|
+
linkTrailingIcon: "size-4"
|
|
3305
|
+
},
|
|
3306
|
+
sm: {
|
|
3307
|
+
link: "px-2.5 py-1.5 text-xs gap-1.5",
|
|
3308
|
+
linkLeadingIcon: "size-4",
|
|
3309
|
+
linkTrailingIcon: "size-4"
|
|
3310
|
+
},
|
|
3311
|
+
md: {
|
|
3312
|
+
link: "px-2.5 py-1.5 text-sm gap-1.5",
|
|
3313
|
+
linkLeadingIcon: "size-5",
|
|
3314
|
+
linkTrailingIcon: "size-5"
|
|
3315
|
+
},
|
|
3316
|
+
lg: {
|
|
3317
|
+
link: "px-3 py-2 text-sm gap-2",
|
|
3318
|
+
linkLeadingIcon: "size-5",
|
|
3319
|
+
linkTrailingIcon: "size-5"
|
|
3320
|
+
},
|
|
3321
|
+
xl: {
|
|
3322
|
+
link: "px-3 py-2 text-base gap-2",
|
|
3323
|
+
linkLeadingIcon: "size-6",
|
|
3324
|
+
linkTrailingIcon: "size-6"
|
|
3325
|
+
}
|
|
3326
|
+
},
|
|
3327
|
+
selected: {
|
|
3328
|
+
true: {
|
|
3329
|
+
link: "before:bg-(--ui-bg-elevated)"
|
|
3330
|
+
},
|
|
3331
|
+
false: {
|
|
3332
|
+
link: ["hover:not-disabled:text-(--ui-text-highlighted) hover:not-disabled:before:bg-(--ui-bg-elevated)/50", options.theme.transitions && "transition-colors before:transition-colors"]
|
|
3333
|
+
}
|
|
3334
|
+
},
|
|
3335
|
+
disabled: {
|
|
3336
|
+
true: {
|
|
3337
|
+
link: "cursor-not-allowed opacity-75"
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
},
|
|
3341
|
+
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
3342
|
+
color,
|
|
3343
|
+
selected: true,
|
|
3344
|
+
class: {
|
|
3345
|
+
link: `text-(--ui-${color})`
|
|
3346
|
+
}
|
|
3347
|
+
})), {
|
|
3348
|
+
color: "neutral",
|
|
3349
|
+
selected: true,
|
|
3350
|
+
class: {
|
|
3351
|
+
link: "text-(--ui-text-highlighted)"
|
|
3352
|
+
}
|
|
3353
|
+
}],
|
|
3354
|
+
defaultVariants: {
|
|
3355
|
+
color: "primary",
|
|
3356
|
+
size: "md"
|
|
3357
|
+
}
|
|
3358
|
+
});
|
|
3359
|
+
|
|
2733
3360
|
const theme = {
|
|
2734
3361
|
__proto__: null,
|
|
2735
3362
|
accordion: accordion,
|
|
@@ -2740,11 +3367,13 @@ const theme = {
|
|
|
2740
3367
|
breadcrumb: breadcrumb,
|
|
2741
3368
|
button: button,
|
|
2742
3369
|
buttonGroup: buttonGroup,
|
|
3370
|
+
calendar: calendar,
|
|
2743
3371
|
card: card,
|
|
2744
3372
|
carousel: carousel,
|
|
2745
3373
|
checkbox: checkbox,
|
|
2746
3374
|
chip: chip,
|
|
2747
3375
|
collapsible: collapsible,
|
|
3376
|
+
colorPicker: colorPicker,
|
|
2748
3377
|
commandPalette: commandPalette,
|
|
2749
3378
|
container: container,
|
|
2750
3379
|
contextMenu: contextMenu,
|
|
@@ -2754,11 +3383,13 @@ const theme = {
|
|
|
2754
3383
|
formField: formField,
|
|
2755
3384
|
input: input,
|
|
2756
3385
|
inputMenu: inputMenu,
|
|
3386
|
+
inputNumber: inputNumber,
|
|
2757
3387
|
kbd: kbd,
|
|
2758
3388
|
link: link,
|
|
2759
3389
|
modal: modal,
|
|
2760
3390
|
navigationMenu: navigationMenu,
|
|
2761
3391
|
pagination: pagination,
|
|
3392
|
+
pinInput: pinInput,
|
|
2762
3393
|
popover: popover,
|
|
2763
3394
|
progress: progress,
|
|
2764
3395
|
radioGroup: radioGroup,
|
|
@@ -2768,21 +3399,17 @@ const theme = {
|
|
|
2768
3399
|
skeleton: skeleton,
|
|
2769
3400
|
slideover: slideover,
|
|
2770
3401
|
slider: slider,
|
|
3402
|
+
stepper: stepper,
|
|
2771
3403
|
switch: _switch,
|
|
2772
3404
|
table: table,
|
|
2773
3405
|
tabs: tabs,
|
|
2774
3406
|
textarea: textarea,
|
|
2775
3407
|
toast: toast,
|
|
2776
3408
|
toaster: toaster,
|
|
2777
|
-
tooltip: tooltip
|
|
3409
|
+
tooltip: tooltip,
|
|
3410
|
+
tree: tree
|
|
2778
3411
|
};
|
|
2779
3412
|
|
|
2780
|
-
function buildTemplates(options) {
|
|
2781
|
-
return Object.entries(theme).reduce((acc, [key, component]) => {
|
|
2782
|
-
acc[key] = typeof component === "function" ? component(options) : component;
|
|
2783
|
-
return acc;
|
|
2784
|
-
}, {});
|
|
2785
|
-
}
|
|
2786
3413
|
function getTemplates(options, uiConfig) {
|
|
2787
3414
|
const templates = [];
|
|
2788
3415
|
for (const component in theme) {
|
|
@@ -2792,19 +3419,52 @@ function getTemplates(options, uiConfig) {
|
|
|
2792
3419
|
getContents: async () => {
|
|
2793
3420
|
const template = theme[component];
|
|
2794
3421
|
const result = typeof template === "function" ? template(options) : template;
|
|
2795
|
-
const variants = Object.
|
|
3422
|
+
const variants = Object.entries(result.variants || {}).filter(([_, values]) => {
|
|
3423
|
+
const keys = Object.keys(values);
|
|
3424
|
+
return keys.some((key) => key !== "true" && key !== "false");
|
|
3425
|
+
}).map(([key]) => key);
|
|
2796
3426
|
let json = JSON.stringify(result, null, 2);
|
|
2797
3427
|
for (const variant of variants) {
|
|
2798
|
-
json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"),
|
|
3428
|
+
json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"), `$1 as typeof ${variant}[number]`);
|
|
2799
3429
|
json = json.replace(new RegExp(`("${variant}": \\[\\s*)((?:"[^"]+",?\\s*)+)(\\])`, "g"), (_, before, match, after) => {
|
|
2800
|
-
const replaced = match.replace(/("[^"]+")/g,
|
|
3430
|
+
const replaced = match.replace(/("[^"]+")/g, `$1 as typeof ${variant}[number]`);
|
|
2801
3431
|
return `${before}${replaced}${after}`;
|
|
2802
3432
|
});
|
|
2803
3433
|
}
|
|
2804
|
-
|
|
3434
|
+
function generateVariantDeclarations(variants2) {
|
|
3435
|
+
return variants2.map((variant) => {
|
|
3436
|
+
const keys = Object.keys(result.variants[variant]);
|
|
3437
|
+
return `const ${variant} = ${JSON.stringify(keys, null, 2)} as const`;
|
|
3438
|
+
});
|
|
3439
|
+
}
|
|
3440
|
+
return [
|
|
3441
|
+
...generateVariantDeclarations(variants),
|
|
3442
|
+
`export default ${json}`
|
|
3443
|
+
].join("\n\n");
|
|
2805
3444
|
}
|
|
2806
3445
|
});
|
|
2807
3446
|
}
|
|
3447
|
+
templates.push({
|
|
3448
|
+
filename: "ui.css",
|
|
3449
|
+
write: true,
|
|
3450
|
+
getContents: () => `@source "./ui";
|
|
3451
|
+
|
|
3452
|
+
@theme default static {
|
|
3453
|
+
--color-old-neutral-50: ${colors.neutral[50]};
|
|
3454
|
+
--color-old-neutral-100: ${colors.neutral[100]};
|
|
3455
|
+
--color-old-neutral-200: ${colors.neutral[200]};
|
|
3456
|
+
--color-old-neutral-300: ${colors.neutral[300]};
|
|
3457
|
+
--color-old-neutral-400: ${colors.neutral[400]};
|
|
3458
|
+
--color-old-neutral-500: ${colors.neutral[500]};
|
|
3459
|
+
--color-old-neutral-600: ${colors.neutral[600]};
|
|
3460
|
+
--color-old-neutral-700: ${colors.neutral[700]};
|
|
3461
|
+
--color-old-neutral-800: ${colors.neutral[800]};
|
|
3462
|
+
--color-old-neutral-900: ${colors.neutral[900]};
|
|
3463
|
+
--color-old-neutral-950: ${colors.neutral[950]};
|
|
3464
|
+
${[...options.theme?.colors || [], "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3465
|
+
}
|
|
3466
|
+
`
|
|
3467
|
+
});
|
|
2808
3468
|
templates.push({
|
|
2809
3469
|
filename: "ui/index.ts",
|
|
2810
3470
|
write: true,
|
|
@@ -2813,13 +3473,14 @@ function getTemplates(options, uiConfig) {
|
|
|
2813
3473
|
templates.push({
|
|
2814
3474
|
filename: "types/ui.d.ts",
|
|
2815
3475
|
getContents: () => `import * as ui from '#build/ui'
|
|
2816
|
-
import type { DeepPartial } from '
|
|
3476
|
+
import type { DeepPartial } from '@nuxt/ui'
|
|
3477
|
+
import type { defaultConfig } from 'tailwind-variants'
|
|
2817
3478
|
import colors from 'tailwindcss/colors'
|
|
2818
3479
|
|
|
2819
3480
|
const icons = ${JSON.stringify(uiConfig.icons)};
|
|
2820
3481
|
|
|
2821
|
-
type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
|
|
2822
|
-
type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor>
|
|
3482
|
+
type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone' | (string & {})
|
|
3483
|
+
type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor> | (string & {})
|
|
2823
3484
|
|
|
2824
3485
|
type AppConfigUI = {
|
|
2825
3486
|
colors?: {
|
|
@@ -2827,6 +3488,7 @@ type AppConfigUI = {
|
|
|
2827
3488
|
neutral?: NeutralColor
|
|
2828
3489
|
}
|
|
2829
3490
|
icons?: Partial<typeof icons>
|
|
3491
|
+
tv?: typeof defaultConfig
|
|
2830
3492
|
} & DeepPartial<typeof ui>
|
|
2831
3493
|
|
|
2832
3494
|
declare module '@nuxt/schema' {
|
|
@@ -2862,4 +3524,4 @@ function addTemplates(options, nuxt, resolve) {
|
|
|
2862
3524
|
});
|
|
2863
3525
|
}
|
|
2864
3526
|
|
|
2865
|
-
export { getDefaultUiConfig as a, addTemplates as b,
|
|
3527
|
+
export { getDefaultUiConfig as a, addTemplates as b, defaultOptions as d, getTemplates as g, resolveColors as r };
|