@stacksjs/components 0.2.176 → 0.2.177
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/dist/{Accordion-pt8j917s.stx → Accordion-8tv78bh9.stx} +4 -4
- package/dist/{AccordionItem-hbhzx63p.stx → AccordionItem-7bd3ga36.stx} +3 -3
- package/dist/{Audio-hjywk3qc.stx → Audio-y0sgq50z.stx} +3 -3
- package/dist/{Avatar-h3jmwcq0.stx → Avatar-rjvwnskf.stx} +2 -2
- package/dist/{Badge-k8dy3d53.stx → Badge-k52qmxcm.stx} +1 -1
- package/dist/{Breadcrumb-7f7s4d02.stx → Breadcrumb-sy5taqsn.stx} +7 -7
- package/dist/{Button-1vknasy3.stx → Button-wrwmnfpf.stx} +2 -2
- package/dist/{Calendar-reny0et7.stx → Calendar-gjjhhfnt.stx} +8 -8
- package/dist/{Card-c1g1fd1w.stx → Card-473a02fy.stx} +3 -3
- package/dist/{Checkbox-aqmq4cqv.stx → Checkbox-2s2a7n4h.stx} +4 -4
- package/dist/{Checkout-agt0ngpw.stx → Checkout-22wh3s22.stx} +1 -1
- package/dist/{ComboboxOption-hmxt3gte.stx → ComboboxOption-6yh7xk7q.stx} +2 -2
- package/dist/{CommandPaletteItem-mvk6q7a2.stx → CommandPaletteItem-chdw0070.stx} +1 -1
- package/dist/{DefaultPaymentMethod-shhf6aap.stx → DefaultPaymentMethod-6qrem3sg.stx} +8 -8
- package/dist/{DialogDescription-76prd1m2.stx → DialogDescription-gth4c2kx.stx} +1 -1
- package/dist/{Drawer-hrz7qcyp.stx → Drawer-jgepqr9j.stx} +1 -1
- package/dist/{DropdownItem-c7rz08e5.stx → DropdownItem-d8ht2bp5.stx} +1 -1
- package/dist/{Form-bpnpbymb.stx → Form-vbag14t1.stx} +1 -1
- package/dist/{ListboxOption-e0dtv1gc.stx → ListboxOption-4j070101.stx} +2 -2
- package/dist/{Login-gepemsth.stx → Login-2cp65d41.stx} +40 -22
- package/dist/{Navigator-rk2a5wvk.stx → Navigator-smpa7my4.stx} +12 -12
- package/dist/{NumberInput-g41gmd2c.stx → NumberInput-j9p5bm5y.stx} +7 -7
- package/dist/{Pagination-wtgxmzey.stx → Pagination-jbcjrfcs.stx} +3 -3
- package/dist/{PasswordInput-4rsq1gwb.stx → PasswordInput-4qykq1dz.stx} +8 -8
- package/dist/{PaymentMethods-x4vrx9yb.stx → PaymentMethods-2xy66bwk.stx} +11 -11
- package/dist/{Progress-9dhakbh4.stx → Progress-4h7dytq5.stx} +9 -9
- package/dist/{Radio-djtb5dpc.stx → Radio-ccm07b2m.stx} +4 -4
- package/dist/RadioGroup-eerw9gq7.stx +138 -0
- package/dist/{RadioGroupDescription-yej78fak.stx → RadioGroupDescription-z34r9avr.stx} +1 -1
- package/dist/{RadioGroupOption-s1d6r221.stx → RadioGroupOption-7pq7rw84.stx} +1 -1
- package/dist/{Select-1vnd0brz.stx → Select-zt72gg1e.stx} +4 -4
- package/dist/{SidebarItem-2a6n0be3.stx → SidebarItem-5v8atp7p.stx} +2 -2
- package/dist/{SidebarPinned-tvj28bm0.stx → SidebarPinned-rq05nrtd.stx} +3 -3
- package/dist/{Signup-hxm5hwkr.stx → Signup-cbncrtvd.stx} +29 -19
- package/dist/{Skeleton-v1pwa8nr.stx → Skeleton-wtwb97xd.stx} +1 -1
- package/dist/{Spinner-7dahavkd.stx → Spinner-ypya5tt2.stx} +8 -8
- package/dist/{StepperStep-wxgembat.stx → StepperStep-3ahq4d9m.stx} +3 -3
- package/dist/{SubscriptionCheckout-zy2ycrmw.stx → SubscriptionCheckout-7fdkwf04.stx} +40 -34
- package/dist/{Switch-p1bcr9ks.stx → Switch-hdta55a8.stx} +1 -1
- package/dist/{Table-6cx8az9h.stx → Table-0mc3fdek.stx} +1 -1
- package/dist/{TableBody-wf6t13j9.stx → TableBody-drxyz5jh.stx} +1 -1
- package/dist/{TableCell-ntx0edbn.stx → TableCell-8swtcq8s.stx} +1 -1
- package/dist/{TableHead-3k4hnm2k.stx → TableHead-e9xvjx2j.stx} +1 -1
- package/dist/{TableHeader-0eyzbqpz.stx → TableHeader-sxc77b4d.stx} +2 -2
- package/dist/{TableRow-z09p2ebf.stx → TableRow-xd542nvb.stx} +1 -1
- package/dist/{Tabs-79brys99.stx → Tabs-b4xsba1w.stx} +6 -6
- package/dist/{TextInput-g0vaz0pe.stx → TextInput-cefyyprt.stx} +9 -9
- package/dist/{Textarea-96kawv5c.stx → Textarea-xcdym703.stx} +6 -6
- package/dist/{TwoFactorChallenge-y5m3nk79.stx → TwoFactorChallenge-y7n4yrk9.stx} +8 -8
- package/dist/{Video-84j4pv6h.stx → Video-a0aeyexv.stx} +1 -1
- package/dist/{VirtualTable-f9crbfjr.stx → VirtualTable-jvm1784g.stx} +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +89 -55
- package/dist/theme/index.d.ts +92 -0
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/theme/index.ts +130 -0
- package/src/ui/accordion/Accordion.stx +4 -4
- package/src/ui/accordion/AccordionItem.stx +3 -3
- package/src/ui/audio/Audio.stx +3 -3
- package/src/ui/auth/Login.stx +40 -22
- package/src/ui/auth/Signup.stx +29 -19
- package/src/ui/auth/TwoFactorChallenge.stx +8 -8
- package/src/ui/avatar/Avatar.stx +2 -2
- package/src/ui/badge/Badge.stx +1 -1
- package/src/ui/breadcrumb/Breadcrumb.stx +7 -7
- package/src/ui/button/Button.stx +2 -2
- package/src/ui/calendar/Calendar.stx +8 -8
- package/src/ui/card/Card.stx +3 -3
- package/src/ui/checkbox/Checkbox.stx +4 -4
- package/src/ui/combobox/ComboboxOption.stx +2 -2
- package/src/ui/command-palette/CommandPaletteItem.stx +1 -1
- package/src/ui/dialog/DialogDescription.stx +1 -1
- package/src/ui/drawer/Drawer.stx +1 -1
- package/src/ui/dropdown/DropdownItem.stx +1 -1
- package/src/ui/form/Form.stx +1 -1
- package/src/ui/input/NumberInput.stx +7 -7
- package/src/ui/input/PasswordInput.stx +8 -8
- package/src/ui/input/TextInput.stx +9 -9
- package/src/ui/listbox/ListboxOption.stx +2 -2
- package/src/ui/navigator/Navigator.stx +12 -12
- package/src/ui/pagination/Pagination.stx +3 -3
- package/src/ui/payment/Checkout.stx +1 -1
- package/src/ui/payment/DefaultPaymentMethod.stx +8 -8
- package/src/ui/payment/PaymentMethods.stx +11 -11
- package/src/ui/payment/SubscriptionCheckout.stx +40 -34
- package/src/ui/progress/Progress.stx +9 -9
- package/src/ui/radio/Radio.stx +4 -4
- package/src/ui/radio-group/RadioGroup.stx +79 -1
- package/src/ui/radio-group/RadioGroupDescription.stx +1 -1
- package/src/ui/radio-group/RadioGroupOption.stx +1 -1
- package/src/ui/select/Select.stx +4 -4
- package/src/ui/sidebar/SidebarItem.stx +2 -2
- package/src/ui/sidebar/SidebarPinned.stx +3 -3
- package/src/ui/skeleton/Skeleton.stx +1 -1
- package/src/ui/spinner/Spinner.stx +8 -8
- package/src/ui/stepper/StepperStep.stx +3 -3
- package/src/ui/switch/Switch.stx +1 -1
- package/src/ui/table/Table.stx +1 -1
- package/src/ui/table/TableBody.stx +1 -1
- package/src/ui/table/TableCell.stx +1 -1
- package/src/ui/table/TableHead.stx +1 -1
- package/src/ui/table/TableHeader.stx +2 -2
- package/src/ui/table/TableRow.stx +1 -1
- package/src/ui/tabs/Tabs.stx +6 -6
- package/src/ui/textarea/Textarea.stx +6 -6
- package/src/ui/video/Video.stx +1 -1
- package/src/ui/virtual-table/VirtualTable.stx +6 -6
- package/dist/RadioGroup-qxmnm3xm.stx +0 -60
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// ../../../../../../../tmp/stx-components-build-
|
|
2
|
+
// ../../../../../../../tmp/stx-components-build-sPFoYf/stubs/stub-0.js
|
|
3
3
|
var stub_0_default = { __stx: true, src: "./components/CodeBlock.stx" };
|
|
4
|
-
// ../../../../../../../tmp/stx-components-build-
|
|
4
|
+
// ../../../../../../../tmp/stx-components-build-sPFoYf/stubs/stub-1.js
|
|
5
5
|
var stub_1_default = { __stx: true, src: "./components/Footer.stx" };
|
|
6
|
-
// ../../../../../../../tmp/stx-components-build-
|
|
6
|
+
// ../../../../../../../tmp/stx-components-build-sPFoYf/stubs/stub-2.js
|
|
7
7
|
var stub_2_default = { __stx: true, src: "./components/Hero.stx" };
|
|
8
|
-
// ../../../../../../../tmp/stx-components-build-
|
|
8
|
+
// ../../../../../../../tmp/stx-components-build-sPFoYf/stubs/stub-3.js
|
|
9
9
|
var stub_3_default = { __stx: true, src: "./components/Installation.stx" };
|
|
10
10
|
// src/composables/useCopyCode.ts
|
|
11
11
|
function useCopyCode(options) {
|
|
@@ -542,24 +542,54 @@ function useIsDarkMode() {
|
|
|
542
542
|
function usePrefersReducedMotion() {
|
|
543
543
|
return useMediaQuery(Breakpoints.reducedMotion);
|
|
544
544
|
}
|
|
545
|
+
// src/theme/index.ts
|
|
546
|
+
var THEMED_FAMILIES = ["gray", "neutral", "slate", "zinc", "red", "green", "yellow", "blue", "indigo"];
|
|
547
|
+
var SHADE_VAR_PREFIX = "--stx-color";
|
|
548
|
+
function cssVar(name, fallback) {
|
|
549
|
+
return fallback === undefined ? `var(${name})` : `var(${name}, ${fallback})`;
|
|
550
|
+
}
|
|
551
|
+
function stxThemePreset(defaults = {}) {
|
|
552
|
+
const palette = {};
|
|
553
|
+
for (const family of THEMED_FAMILIES) {
|
|
554
|
+
const shades = defaults[family];
|
|
555
|
+
if (!shades || typeof shades === "string")
|
|
556
|
+
continue;
|
|
557
|
+
const themed = {};
|
|
558
|
+
for (const [shade, value] of Object.entries(shades))
|
|
559
|
+
themed[shade] = cssVar(`${SHADE_VAR_PREFIX}-${family}-${shade}`, value);
|
|
560
|
+
palette[family] = themed;
|
|
561
|
+
}
|
|
562
|
+
return palette;
|
|
563
|
+
}
|
|
564
|
+
function themeVariableNames(defaults = {}) {
|
|
565
|
+
const names = [];
|
|
566
|
+
for (const family of THEMED_FAMILIES) {
|
|
567
|
+
const shades = defaults[family];
|
|
568
|
+
if (!shades || typeof shades === "string")
|
|
569
|
+
continue;
|
|
570
|
+
for (const shade of Object.keys(shades))
|
|
571
|
+
names.push(`${SHADE_VAR_PREFIX}-${family}-${shade}`);
|
|
572
|
+
}
|
|
573
|
+
return names;
|
|
574
|
+
}
|
|
545
575
|
// src/ui/accordion/Accordion.stx
|
|
546
|
-
var Accordion_default = "./Accordion-
|
|
576
|
+
var Accordion_default = "./Accordion-8tv78bh9.stx";
|
|
547
577
|
// src/ui/accordion/AccordionItem.stx
|
|
548
|
-
var AccordionItem_default = "./AccordionItem-
|
|
578
|
+
var AccordionItem_default = "./AccordionItem-7bd3ga36.stx";
|
|
549
579
|
// src/ui/audio/Audio.stx
|
|
550
|
-
var Audio_default = "./Audio-
|
|
580
|
+
var Audio_default = "./Audio-y0sgq50z.stx";
|
|
551
581
|
// src/ui/auth/Login.stx
|
|
552
|
-
var Login_default = "./Login-
|
|
582
|
+
var Login_default = "./Login-2cp65d41.stx";
|
|
553
583
|
// src/ui/auth/Signup.stx
|
|
554
|
-
var Signup_default = "./Signup-
|
|
584
|
+
var Signup_default = "./Signup-cbncrtvd.stx";
|
|
555
585
|
// src/ui/auth/TwoFactorChallenge.stx
|
|
556
|
-
var TwoFactorChallenge_default = "./TwoFactorChallenge-
|
|
586
|
+
var TwoFactorChallenge_default = "./TwoFactorChallenge-y7n4yrk9.stx";
|
|
557
587
|
// src/ui/avatar/Avatar.stx
|
|
558
|
-
var Avatar_default = "./Avatar-
|
|
588
|
+
var Avatar_default = "./Avatar-rjvwnskf.stx";
|
|
559
589
|
// src/ui/badge/Badge.stx
|
|
560
|
-
var Badge_default = "./Badge-
|
|
590
|
+
var Badge_default = "./Badge-k52qmxcm.stx";
|
|
561
591
|
// src/ui/breadcrumb/Breadcrumb.stx
|
|
562
|
-
var Breadcrumb_default = "./Breadcrumb-
|
|
592
|
+
var Breadcrumb_default = "./Breadcrumb-sy5taqsn.stx";
|
|
563
593
|
// src/utils/error-handling.ts
|
|
564
594
|
import process from "process";
|
|
565
595
|
var DOCS_BASE_URL = "https://stacksjs.com/components";
|
|
@@ -899,7 +929,7 @@ function warnProp(value, validator, name = "value") {
|
|
|
899
929
|
}
|
|
900
930
|
|
|
901
931
|
// src/ui/button/Button.stx
|
|
902
|
-
var Button_default = "./Button-
|
|
932
|
+
var Button_default = "./Button-wrwmnfpf.stx";
|
|
903
933
|
|
|
904
934
|
// src/ui/button/index.ts
|
|
905
935
|
var buttonPropSchema = {
|
|
@@ -929,11 +959,11 @@ function validateSize(size) {
|
|
|
929
959
|
}
|
|
930
960
|
}
|
|
931
961
|
// src/ui/calendar/Calendar.stx
|
|
932
|
-
var Calendar_default = "./Calendar-
|
|
962
|
+
var Calendar_default = "./Calendar-gjjhhfnt.stx";
|
|
933
963
|
// src/ui/card/Card.stx
|
|
934
|
-
var Card_default = "./Card-
|
|
964
|
+
var Card_default = "./Card-473a02fy.stx";
|
|
935
965
|
// src/ui/checkbox/Checkbox.stx
|
|
936
|
-
var Checkbox_default = "./Checkbox-
|
|
966
|
+
var Checkbox_default = "./Checkbox-2s2a7n4h.stx";
|
|
937
967
|
// src/ui/combobox/Combobox.stx
|
|
938
968
|
var Combobox_default = "./Combobox-fdkr6cdq.stx";
|
|
939
969
|
// src/ui/combobox/ComboboxButton.stx
|
|
@@ -941,35 +971,35 @@ var ComboboxButton_default = "./ComboboxButton-g76stp1e.stx";
|
|
|
941
971
|
// src/ui/combobox/ComboboxInput.stx
|
|
942
972
|
var ComboboxInput_default = "./ComboboxInput-z1293bbh.stx";
|
|
943
973
|
// src/ui/combobox/ComboboxOption.stx
|
|
944
|
-
var ComboboxOption_default = "./ComboboxOption-
|
|
974
|
+
var ComboboxOption_default = "./ComboboxOption-6yh7xk7q.stx";
|
|
945
975
|
// src/ui/combobox/ComboboxOptions.stx
|
|
946
976
|
var ComboboxOptions_default = "./ComboboxOptions-sq5360ae.stx";
|
|
947
977
|
// src/ui/command-palette/CommandPalette.stx
|
|
948
978
|
var CommandPalette_default = "./CommandPalette-36mxf05w.stx";
|
|
949
979
|
// src/ui/command-palette/CommandPaletteItem.stx
|
|
950
|
-
var CommandPaletteItem_default = "./CommandPaletteItem-
|
|
980
|
+
var CommandPaletteItem_default = "./CommandPaletteItem-chdw0070.stx";
|
|
951
981
|
// src/ui/dialog/Dialog.stx
|
|
952
982
|
var Dialog_default = "./Dialog-y5rz2vrq.stx";
|
|
953
983
|
// src/ui/dialog/DialogBackdrop.stx
|
|
954
984
|
var DialogBackdrop_default = "./DialogBackdrop-rxax3sec.stx";
|
|
955
985
|
// src/ui/dialog/DialogDescription.stx
|
|
956
|
-
var DialogDescription_default = "./DialogDescription-
|
|
986
|
+
var DialogDescription_default = "./DialogDescription-gth4c2kx.stx";
|
|
957
987
|
// src/ui/dialog/DialogPanel.stx
|
|
958
988
|
var DialogPanel_default = "./DialogPanel-44d8jeqy.stx";
|
|
959
989
|
// src/ui/dialog/DialogTitle.stx
|
|
960
990
|
var DialogTitle_default = "./DialogTitle-x0r6k8x9.stx";
|
|
961
991
|
// src/ui/drawer/Drawer.stx
|
|
962
|
-
var Drawer_default = "./Drawer-
|
|
992
|
+
var Drawer_default = "./Drawer-jgepqr9j.stx";
|
|
963
993
|
// src/ui/dropdown/Dropdown.stx
|
|
964
994
|
var Dropdown_default = "./Dropdown-vvhemtc0.stx";
|
|
965
995
|
// src/ui/dropdown/DropdownButton.stx
|
|
966
996
|
var DropdownButton_default = "./DropdownButton-wcz67dxy.stx";
|
|
967
997
|
// src/ui/dropdown/DropdownItem.stx
|
|
968
|
-
var DropdownItem_default = "./DropdownItem-
|
|
998
|
+
var DropdownItem_default = "./DropdownItem-d8ht2bp5.stx";
|
|
969
999
|
// src/ui/dropdown/DropdownItems.stx
|
|
970
1000
|
var DropdownItems_default = "./DropdownItems-1sxnd5qn.stx";
|
|
971
1001
|
// src/ui/form/Form.stx
|
|
972
|
-
var Form_default = "./Form-
|
|
1002
|
+
var Form_default = "./Form-vbag14t1.stx";
|
|
973
1003
|
|
|
974
1004
|
// src/ui/form/index.ts
|
|
975
1005
|
var formPropSchema = {
|
|
@@ -989,13 +1019,13 @@ var Image_default = "./Image-yhxcvgzs.stx";
|
|
|
989
1019
|
// src/ui/input/EmailInput.stx
|
|
990
1020
|
var EmailInput_default = "./EmailInput-vak3kkmk.stx";
|
|
991
1021
|
// src/ui/input/NumberInput.stx
|
|
992
|
-
var NumberInput_default = "./NumberInput-
|
|
1022
|
+
var NumberInput_default = "./NumberInput-j9p5bm5y.stx";
|
|
993
1023
|
// src/ui/input/PasswordInput.stx
|
|
994
|
-
var PasswordInput_default = "./PasswordInput-
|
|
1024
|
+
var PasswordInput_default = "./PasswordInput-4qykq1dz.stx";
|
|
995
1025
|
// src/ui/input/SearchInput.stx
|
|
996
1026
|
var SearchInput_default = "./SearchInput-pdx7agn0.stx";
|
|
997
1027
|
// src/ui/input/TextInput.stx
|
|
998
|
-
var TextInput_default = "./TextInput-
|
|
1028
|
+
var TextInput_default = "./TextInput-cefyyprt.stx";
|
|
999
1029
|
|
|
1000
1030
|
// src/ui/input/index.ts
|
|
1001
1031
|
var baseInputPropSchema = {
|
|
@@ -1092,23 +1122,23 @@ var ListboxButton_default = "./ListboxButton-keb8gm0q.stx";
|
|
|
1092
1122
|
// src/ui/listbox/ListboxLabel.stx
|
|
1093
1123
|
var ListboxLabel_default = "./ListboxLabel-7mymt1b8.stx";
|
|
1094
1124
|
// src/ui/listbox/ListboxOption.stx
|
|
1095
|
-
var ListboxOption_default = "./ListboxOption-
|
|
1125
|
+
var ListboxOption_default = "./ListboxOption-4j070101.stx";
|
|
1096
1126
|
// src/ui/listbox/ListboxOptions.stx
|
|
1097
1127
|
var ListboxOptions_default = "./ListboxOptions-ejkatcfg.stx";
|
|
1098
1128
|
// src/ui/navigator/Navigator.stx
|
|
1099
|
-
var Navigator_default = "./Navigator-
|
|
1129
|
+
var Navigator_default = "./Navigator-smpa7my4.stx";
|
|
1100
1130
|
// src/ui/notification/Notification.stx
|
|
1101
1131
|
var Notification_default = "./Notification-03vfh3k6.stx";
|
|
1102
1132
|
// src/ui/pagination/Pagination.stx
|
|
1103
|
-
var Pagination_default = "./Pagination-
|
|
1133
|
+
var Pagination_default = "./Pagination-jbcjrfcs.stx";
|
|
1104
1134
|
// src/ui/payment/Checkout.stx
|
|
1105
|
-
var Checkout_default = "./Checkout-
|
|
1135
|
+
var Checkout_default = "./Checkout-22wh3s22.stx";
|
|
1106
1136
|
// src/ui/payment/DefaultPaymentMethod.stx
|
|
1107
|
-
var DefaultPaymentMethod_default = "./DefaultPaymentMethod-
|
|
1137
|
+
var DefaultPaymentMethod_default = "./DefaultPaymentMethod-6qrem3sg.stx";
|
|
1108
1138
|
// src/ui/payment/PaymentMethods.stx
|
|
1109
|
-
var PaymentMethods_default = "./PaymentMethods-
|
|
1139
|
+
var PaymentMethods_default = "./PaymentMethods-2xy66bwk.stx";
|
|
1110
1140
|
// src/ui/payment/SubscriptionCheckout.stx
|
|
1111
|
-
var SubscriptionCheckout_default = "./SubscriptionCheckout-
|
|
1141
|
+
var SubscriptionCheckout_default = "./SubscriptionCheckout-7fdkwf04.stx";
|
|
1112
1142
|
// src/ui/popover/Popover.stx
|
|
1113
1143
|
var Popover_default = "./Popover-et2q44m7.stx";
|
|
1114
1144
|
// src/ui/popover/PopoverButton.stx
|
|
@@ -1118,19 +1148,19 @@ var PopoverPanel_default = "./PopoverPanel-054yh38h.stx";
|
|
|
1118
1148
|
// src/ui/portal/Portal.stx
|
|
1119
1149
|
var Portal_default = "./Portal-1vf14s4x.stx";
|
|
1120
1150
|
// src/ui/progress/Progress.stx
|
|
1121
|
-
var Progress_default = "./Progress-
|
|
1151
|
+
var Progress_default = "./Progress-4h7dytq5.stx";
|
|
1122
1152
|
// src/ui/radio/Radio.stx
|
|
1123
|
-
var Radio_default = "./Radio-
|
|
1153
|
+
var Radio_default = "./Radio-ccm07b2m.stx";
|
|
1124
1154
|
// src/ui/radio-group/RadioGroup.stx
|
|
1125
|
-
var RadioGroup_default = "./RadioGroup-
|
|
1155
|
+
var RadioGroup_default = "./RadioGroup-eerw9gq7.stx";
|
|
1126
1156
|
// src/ui/radio-group/RadioGroupDescription.stx
|
|
1127
|
-
var RadioGroupDescription_default = "./RadioGroupDescription-
|
|
1157
|
+
var RadioGroupDescription_default = "./RadioGroupDescription-z34r9avr.stx";
|
|
1128
1158
|
// src/ui/radio-group/RadioGroupLabel.stx
|
|
1129
1159
|
var RadioGroupLabel_default = "./RadioGroupLabel-7mymt1b8.stx";
|
|
1130
1160
|
// src/ui/radio-group/RadioGroupOption.stx
|
|
1131
|
-
var RadioGroupOption_default = "./RadioGroupOption-
|
|
1161
|
+
var RadioGroupOption_default = "./RadioGroupOption-7pq7rw84.stx";
|
|
1132
1162
|
// src/ui/select/Select.stx
|
|
1133
|
-
var Select_default = "./Select-
|
|
1163
|
+
var Select_default = "./Select-zt72gg1e.stx";
|
|
1134
1164
|
// src/ui/sidebar/Sidebar.stx
|
|
1135
1165
|
var Sidebar_default = "./Sidebar-v7ecx5gs.stx";
|
|
1136
1166
|
// src/ui/sidebar/SidebarFooter.stx
|
|
@@ -1138,9 +1168,9 @@ var SidebarFooter_default = "./SidebarFooter-s7skj92y.stx";
|
|
|
1138
1168
|
// src/ui/sidebar/SidebarHeader.stx
|
|
1139
1169
|
var SidebarHeader_default = "./SidebarHeader-34bf4mm8.stx";
|
|
1140
1170
|
// src/ui/sidebar/SidebarItem.stx
|
|
1141
|
-
var SidebarItem_default = "./SidebarItem-
|
|
1171
|
+
var SidebarItem_default = "./SidebarItem-5v8atp7p.stx";
|
|
1142
1172
|
// src/ui/sidebar/SidebarPinned.stx
|
|
1143
|
-
var SidebarPinned_default = "./SidebarPinned-
|
|
1173
|
+
var SidebarPinned_default = "./SidebarPinned-rq05nrtd.stx";
|
|
1144
1174
|
// src/ui/sidebar/SidebarSection.stx
|
|
1145
1175
|
var SidebarSection_default = "./SidebarSection-zd9z35ch.stx";
|
|
1146
1176
|
// src/ui/sidebar/SidebarSpace.stx
|
|
@@ -1444,13 +1474,13 @@ function spaceTintPayload(spaces) {
|
|
|
1444
1474
|
return spaces.map((space) => space.tint);
|
|
1445
1475
|
}
|
|
1446
1476
|
// src/ui/skeleton/Skeleton.stx
|
|
1447
|
-
var Skeleton_default = "./Skeleton-
|
|
1477
|
+
var Skeleton_default = "./Skeleton-wtwb97xd.stx";
|
|
1448
1478
|
// src/ui/spinner/Spinner.stx
|
|
1449
|
-
var Spinner_default = "./Spinner-
|
|
1479
|
+
var Spinner_default = "./Spinner-ypya5tt2.stx";
|
|
1450
1480
|
// src/ui/stepper/Stepper.stx
|
|
1451
1481
|
var Stepper_default = "./Stepper-rgbk76hd.stx";
|
|
1452
1482
|
// src/ui/stepper/StepperStep.stx
|
|
1453
|
-
var StepperStep_default = "./StepperStep-
|
|
1483
|
+
var StepperStep_default = "./StepperStep-3ahq4d9m.stx";
|
|
1454
1484
|
// src/ui/storage/index.ts
|
|
1455
1485
|
class StorageManager {
|
|
1456
1486
|
storage;
|
|
@@ -1695,37 +1725,37 @@ function createStorage(type = "local", namespace) {
|
|
|
1695
1725
|
return new StorageManager(type, namespace);
|
|
1696
1726
|
}
|
|
1697
1727
|
// src/ui/switch/Switch.stx
|
|
1698
|
-
var Switch_default = "./Switch-
|
|
1728
|
+
var Switch_default = "./Switch-hdta55a8.stx";
|
|
1699
1729
|
// src/ui/table/Table.stx
|
|
1700
|
-
var Table_default = "./Table-
|
|
1730
|
+
var Table_default = "./Table-0mc3fdek.stx";
|
|
1701
1731
|
// src/ui/table/TableBody.stx
|
|
1702
|
-
var TableBody_default = "./TableBody-
|
|
1732
|
+
var TableBody_default = "./TableBody-drxyz5jh.stx";
|
|
1703
1733
|
// src/ui/table/TableCell.stx
|
|
1704
|
-
var TableCell_default = "./TableCell-
|
|
1734
|
+
var TableCell_default = "./TableCell-8swtcq8s.stx";
|
|
1705
1735
|
// src/ui/table/TableHead.stx
|
|
1706
|
-
var TableHead_default = "./TableHead-
|
|
1736
|
+
var TableHead_default = "./TableHead-e9xvjx2j.stx";
|
|
1707
1737
|
// src/ui/table/TableHeader.stx
|
|
1708
|
-
var TableHeader_default = "./TableHeader-
|
|
1738
|
+
var TableHeader_default = "./TableHeader-sxc77b4d.stx";
|
|
1709
1739
|
// src/ui/table/TableRow.stx
|
|
1710
|
-
var TableRow_default = "./TableRow-
|
|
1740
|
+
var TableRow_default = "./TableRow-xd542nvb.stx";
|
|
1711
1741
|
// src/ui/tabs/TabPanel.stx
|
|
1712
1742
|
var TabPanel_default = "./TabPanel-5htevsq6.stx";
|
|
1713
1743
|
// src/ui/tabs/Tabs.stx
|
|
1714
|
-
var Tabs_default = "./Tabs-
|
|
1744
|
+
var Tabs_default = "./Tabs-b4xsba1w.stx";
|
|
1715
1745
|
// src/ui/teleport/Teleport.stx
|
|
1716
1746
|
var Teleport_default = "./Teleport-tsx4bt4n.stx";
|
|
1717
1747
|
// src/ui/textarea/Textarea.stx
|
|
1718
|
-
var Textarea_default = "./Textarea-
|
|
1748
|
+
var Textarea_default = "./Textarea-xcdym703.stx";
|
|
1719
1749
|
// src/ui/tooltip/Tooltip.stx
|
|
1720
1750
|
var Tooltip_default = "./Tooltip-y61h04gp.stx";
|
|
1721
1751
|
// src/ui/transition/Transition.stx
|
|
1722
1752
|
var Transition_default = "./Transition-7smenaz8.stx";
|
|
1723
1753
|
// src/ui/video/Video.stx
|
|
1724
|
-
var Video_default = "./Video-
|
|
1754
|
+
var Video_default = "./Video-a0aeyexv.stx";
|
|
1725
1755
|
// src/ui/virtual-list/VirtualList.stx
|
|
1726
1756
|
var VirtualList_default = "./VirtualList-fa7v5a3h.stx";
|
|
1727
1757
|
// src/ui/virtual-table/VirtualTable.stx
|
|
1728
|
-
var VirtualTable_default = "./VirtualTable-
|
|
1758
|
+
var VirtualTable_default = "./VirtualTable-jvm1784g.stx";
|
|
1729
1759
|
// src/utils/accessibility.ts
|
|
1730
1760
|
var idCounter = 0;
|
|
1731
1761
|
function generateId(prefix = "a11y") {
|
|
@@ -3994,11 +4024,13 @@ export {
|
|
|
3994
4024
|
useCopyCode,
|
|
3995
4025
|
useClickOutside,
|
|
3996
4026
|
useBreakpoint,
|
|
4027
|
+
themeVariableNames,
|
|
3997
4028
|
themeToCSSProperties,
|
|
3998
4029
|
themePresets,
|
|
3999
4030
|
textInputPropSchema,
|
|
4000
4031
|
tc,
|
|
4001
4032
|
t,
|
|
4033
|
+
stxThemePreset,
|
|
4002
4034
|
storage,
|
|
4003
4035
|
staggerAnimation,
|
|
4004
4036
|
spaceTintVars,
|
|
@@ -4141,6 +4173,7 @@ export {
|
|
|
4141
4173
|
TableBody_default as TableBody,
|
|
4142
4174
|
Table_default as Table,
|
|
4143
4175
|
TabPanel_default as TabPanel,
|
|
4176
|
+
THEMED_FAMILIES,
|
|
4144
4177
|
Switch_default as Switch,
|
|
4145
4178
|
SubscriptionCheckout_default as SubscriptionCheckout,
|
|
4146
4179
|
StorageManager,
|
|
@@ -4160,6 +4193,7 @@ export {
|
|
|
4160
4193
|
Sidebar_default as Sidebar,
|
|
4161
4194
|
Select_default as Select,
|
|
4162
4195
|
SearchInput_default as SearchInput,
|
|
4196
|
+
SHADE_VAR_PREFIX,
|
|
4163
4197
|
RadioGroupOption_default as RadioGroupOption,
|
|
4164
4198
|
RadioGroupLabel_default as RadioGroupLabel,
|
|
4165
4199
|
RadioGroupDescription_default as RadioGroupDescription,
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the palette fragment.
|
|
3
|
+
*
|
|
4
|
+
* @param defaults - Crosswind's default `theme.colors`. Pass the one your
|
|
5
|
+
* project resolves; omitted, the returned entries carry no fallback, which is
|
|
6
|
+
* only useful if you intend to define every variable yourself.
|
|
7
|
+
*/
|
|
8
|
+
export declare function stxThemePreset(defaults?: Palette): Palette;
|
|
9
|
+
/**
|
|
10
|
+
* Every variable the preset reads, in declaration order.
|
|
11
|
+
*
|
|
12
|
+
* The issue asked for "a documented list of the variables each family reads",
|
|
13
|
+
* and a list generated from the same source as the palette cannot disagree with
|
|
14
|
+
* it. Useful for emitting a starter stylesheet or documenting the surface.
|
|
15
|
+
*/
|
|
16
|
+
export declare function themeVariableNames(defaults?: Palette): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Colour families the components actually draw with.
|
|
19
|
+
*
|
|
20
|
+
* Deliberately not "every family in the palette". A variable per shade of every
|
|
21
|
+
* colour would be several hundred declarations an app has no use for, and the
|
|
22
|
+
* point is a list someone can read. `red`, `green` and `yellow` are here
|
|
23
|
+
* because they carry the status roles below.
|
|
24
|
+
*/
|
|
25
|
+
export declare const THEMED_FAMILIES: readonly ['gray', 'neutral', 'slate', 'zinc', 'red', 'green', 'yellow', 'blue', 'indigo'];
|
|
26
|
+
/** Prefix for the per-shade variables, e.g. `--stx-color-gray-600`. */
|
|
27
|
+
export declare const SHADE_VAR_PREFIX: '--stx-color';
|
|
28
|
+
/**
|
|
29
|
+
* A seam for an app's own theme (stacksjs/stx#1930).
|
|
30
|
+
*
|
|
31
|
+
* 62 of the 91 components name Tailwind palette shades directly —
|
|
32
|
+
* `bg-gray-100`, `text-gray-600`, `ring-indigo-600`. Dark mode is handled, via
|
|
33
|
+
* the `dark:` variant. What was not handled is an app with its own palette: it
|
|
34
|
+
* installs `<Button>` and gets `bg-gray-100`, which matches nothing around it.
|
|
35
|
+
*
|
|
36
|
+
* ## What already works, without this module
|
|
37
|
+
*
|
|
38
|
+
* A project's `crosswind.config.ts` `theme.colors` **deep-merges** over the base
|
|
39
|
+
* palette, and stx generates CSS by scanning the rendered page — so redefining
|
|
40
|
+
* a shade re-themes every component that names it, with no component edits:
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* // crosswind.config.ts
|
|
44
|
+
* export default { theme: { colors: { gray: { 600: '#3f3f46' } } } }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Shades you do not name keep their defaults. That is a build-time seam and it
|
|
48
|
+
* is the right one for a fixed brand palette.
|
|
49
|
+
*
|
|
50
|
+
* ## What this module adds
|
|
51
|
+
*
|
|
52
|
+
* A **runtime** seam, and **semantic** names.
|
|
53
|
+
*
|
|
54
|
+
* `stxThemePreset()` returns a `theme.colors` fragment in which every themed
|
|
55
|
+
* shade resolves through a CSS custom property with today's value as the
|
|
56
|
+
* fallback. Spread it into your crosswind config and nothing changes visually;
|
|
57
|
+
* set a variable and every component follows, without a rebuild:
|
|
58
|
+
*
|
|
59
|
+
* ROLE tokens are not here. `packages/stx/src/theme-tokens.ts` puts those in the
|
|
60
|
+
* base theme, so they resolve in every app with no opt-in — a component saying
|
|
61
|
+
* `text-fg-muted` cannot depend on a config change. A second list of role names
|
|
62
|
+
* living here would disagree with that one, which is the failure this module
|
|
63
|
+
* exists to avoid rather than to introduce.
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* // crosswind.config.ts
|
|
67
|
+
* import { stxThemePreset } from '@stacksjs/components/theme'
|
|
68
|
+
* export default { theme: { colors: stxThemePreset() } }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* ```css
|
|
72
|
+
* :root { --stx-color-gray-600: #52525b; }
|
|
73
|
+
* .dark { --stx-color-gray-600: #a1a1aa; }
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* The fallbacks are read from crosswind's own default palette rather than
|
|
77
|
+
* copied, so this cannot drift from the values the components are drawn
|
|
78
|
+
* against — a hand-copied table is the failure mode this whole file exists to
|
|
79
|
+
* remove, and duplicating it here would reintroduce it one level up.
|
|
80
|
+
*
|
|
81
|
+
* ## The trade this makes
|
|
82
|
+
*
|
|
83
|
+
* An opacity modifier on a variable-backed colour compiles to `color-mix()`
|
|
84
|
+
* rather than a baked `oklch(… / 0.5)`, because the value is not known at build
|
|
85
|
+
* time. That is why this is opt-in and not the framework default: it is a real
|
|
86
|
+
* change to the generated CSS, and it is the app's call to make.
|
|
87
|
+
*
|
|
88
|
+
* @module theme
|
|
89
|
+
*/
|
|
90
|
+
/** A crosswind palette entry: one colour, or a map of shades. */
|
|
91
|
+
export type PaletteValue = string | Record<string, string>;
|
|
92
|
+
export type Palette = Record<string, PaletteValue>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.177",
|
|
5
5
|
"description": "A modern component library built with STX, featuring headwind utility classes and TypeScript syntax highlighting.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@iconify-json/f7": "^1.2.2",
|
|
66
66
|
"@cwcss/crosswind": "^0.2.14",
|
|
67
|
-
"@stacksjs/stx": "0.2.
|
|
68
|
-
"bun-plugin-stx": "0.2.
|
|
67
|
+
"@stacksjs/stx": "0.2.177",
|
|
68
|
+
"bun-plugin-stx": "0.2.177",
|
|
69
69
|
"ts-syntax-highlighter": "^0.2.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Hero } from './components/Hero.stx'
|
|
|
6
6
|
export { default as Installation } from './components/Installation.stx'
|
|
7
7
|
// Export composables
|
|
8
8
|
export * from './composables'
|
|
9
|
+
// Theme seam — see src/theme for how an app redirects the components' colours.
|
|
10
|
+
export * from './theme'
|
|
9
11
|
// Export UI components
|
|
10
12
|
export * from './ui/accordion'
|
|
11
13
|
export * from './ui/audio'
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A seam for an app's own theme (stacksjs/stx#1930).
|
|
3
|
+
*
|
|
4
|
+
* 62 of the 91 components name Tailwind palette shades directly —
|
|
5
|
+
* `bg-gray-100`, `text-gray-600`, `ring-indigo-600`. Dark mode is handled, via
|
|
6
|
+
* the `dark:` variant. What was not handled is an app with its own palette: it
|
|
7
|
+
* installs `<Button>` and gets `bg-gray-100`, which matches nothing around it.
|
|
8
|
+
*
|
|
9
|
+
* ## What already works, without this module
|
|
10
|
+
*
|
|
11
|
+
* A project's `crosswind.config.ts` `theme.colors` **deep-merges** over the base
|
|
12
|
+
* palette, and stx generates CSS by scanning the rendered page — so redefining
|
|
13
|
+
* a shade re-themes every component that names it, with no component edits:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* // crosswind.config.ts
|
|
17
|
+
* export default { theme: { colors: { gray: { 600: '#3f3f46' } } } }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Shades you do not name keep their defaults. That is a build-time seam and it
|
|
21
|
+
* is the right one for a fixed brand palette.
|
|
22
|
+
*
|
|
23
|
+
* ## What this module adds
|
|
24
|
+
*
|
|
25
|
+
* A **runtime** seam, and **semantic** names.
|
|
26
|
+
*
|
|
27
|
+
* `stxThemePreset()` returns a `theme.colors` fragment in which every themed
|
|
28
|
+
* shade resolves through a CSS custom property with today's value as the
|
|
29
|
+
* fallback. Spread it into your crosswind config and nothing changes visually;
|
|
30
|
+
* set a variable and every component follows, without a rebuild:
|
|
31
|
+
*
|
|
32
|
+
* ROLE tokens are not here. `packages/stx/src/theme-tokens.ts` puts those in the
|
|
33
|
+
* base theme, so they resolve in every app with no opt-in — a component saying
|
|
34
|
+
* `text-fg-muted` cannot depend on a config change. A second list of role names
|
|
35
|
+
* living here would disagree with that one, which is the failure this module
|
|
36
|
+
* exists to avoid rather than to introduce.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* // crosswind.config.ts
|
|
40
|
+
* import { stxThemePreset } from '@stacksjs/components/theme'
|
|
41
|
+
* export default { theme: { colors: stxThemePreset() } }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* ```css
|
|
45
|
+
* :root { --stx-color-gray-600: #52525b; }
|
|
46
|
+
* .dark { --stx-color-gray-600: #a1a1aa; }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* The fallbacks are read from crosswind's own default palette rather than
|
|
50
|
+
* copied, so this cannot drift from the values the components are drawn
|
|
51
|
+
* against — a hand-copied table is the failure mode this whole file exists to
|
|
52
|
+
* remove, and duplicating it here would reintroduce it one level up.
|
|
53
|
+
*
|
|
54
|
+
* ## The trade this makes
|
|
55
|
+
*
|
|
56
|
+
* An opacity modifier on a variable-backed colour compiles to `color-mix()`
|
|
57
|
+
* rather than a baked `oklch(… / 0.5)`, because the value is not known at build
|
|
58
|
+
* time. That is why this is opt-in and not the framework default: it is a real
|
|
59
|
+
* change to the generated CSS, and it is the app's call to make.
|
|
60
|
+
*
|
|
61
|
+
* @module theme
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/** A crosswind palette entry: one colour, or a map of shades. */
|
|
65
|
+
export type PaletteValue = string | Record<string, string>
|
|
66
|
+
export type Palette = Record<string, PaletteValue>
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Colour families the components actually draw with.
|
|
70
|
+
*
|
|
71
|
+
* Deliberately not "every family in the palette". A variable per shade of every
|
|
72
|
+
* colour would be several hundred declarations an app has no use for, and the
|
|
73
|
+
* point is a list someone can read. `red`, `green` and `yellow` are here
|
|
74
|
+
* because they carry the status roles below.
|
|
75
|
+
*/
|
|
76
|
+
export const THEMED_FAMILIES = ['gray', 'neutral', 'slate', 'zinc', 'red', 'green', 'yellow', 'blue', 'indigo'] as const
|
|
77
|
+
|
|
78
|
+
/** Prefix for the per-shade variables, e.g. `--stx-color-gray-600`. */
|
|
79
|
+
export const SHADE_VAR_PREFIX = '--stx-color'
|
|
80
|
+
|
|
81
|
+
/** `var(--name, fallback)`, or `var(--name)` when there is nothing to fall back to. */
|
|
82
|
+
function cssVar(name: string, fallback?: string): string {
|
|
83
|
+
return fallback === undefined ? `var(${name})` : `var(${name}, ${fallback})`
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Build the palette fragment.
|
|
88
|
+
*
|
|
89
|
+
* @param defaults - Crosswind's default `theme.colors`. Pass the one your
|
|
90
|
+
* project resolves; omitted, the returned entries carry no fallback, which is
|
|
91
|
+
* only useful if you intend to define every variable yourself.
|
|
92
|
+
*/
|
|
93
|
+
export function stxThemePreset(defaults: Palette = {}): Palette {
|
|
94
|
+
const palette: Palette = {}
|
|
95
|
+
|
|
96
|
+
for (const family of THEMED_FAMILIES) {
|
|
97
|
+
const shades = defaults[family]
|
|
98
|
+
if (!shades || typeof shades === 'string')
|
|
99
|
+
continue
|
|
100
|
+
|
|
101
|
+
const themed: Record<string, string> = {}
|
|
102
|
+
for (const [shade, value] of Object.entries(shades))
|
|
103
|
+
themed[shade] = cssVar(`${SHADE_VAR_PREFIX}-${family}-${shade}`, value)
|
|
104
|
+
|
|
105
|
+
palette[family] = themed
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return palette
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Every variable the preset reads, in declaration order.
|
|
113
|
+
*
|
|
114
|
+
* The issue asked for "a documented list of the variables each family reads",
|
|
115
|
+
* and a list generated from the same source as the palette cannot disagree with
|
|
116
|
+
* it. Useful for emitting a starter stylesheet or documenting the surface.
|
|
117
|
+
*/
|
|
118
|
+
export function themeVariableNames(defaults: Palette = {}): string[] {
|
|
119
|
+
const names: string[] = []
|
|
120
|
+
|
|
121
|
+
for (const family of THEMED_FAMILIES) {
|
|
122
|
+
const shades = defaults[family]
|
|
123
|
+
if (!shades || typeof shades === 'string')
|
|
124
|
+
continue
|
|
125
|
+
for (const shade of Object.keys(shades))
|
|
126
|
+
names.push(`${SHADE_VAR_PREFIX}-${family}-${shade}`)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return names
|
|
130
|
+
}
|
|
@@ -11,10 +11,10 @@ export const allowMultiple = $props.allowMultiple || false
|
|
|
11
11
|
export const defaultOpen = $props.defaultOpen || []
|
|
12
12
|
export const className = $props.className || ''
|
|
13
13
|
|
|
14
|
-
export const accordionClasses = `divide-y divide-
|
|
15
|
-
export const headerClasses = `w-full flex items-center justify-between px-4 py-3 text-left font-medium text-
|
|
16
|
-
export const iconClasses = `w-5 h-5 text-
|
|
17
|
-
export const contentClasses = `px-4 py-3 text-
|
|
14
|
+
export const accordionClasses = `divide-y divide-line border border-line rounded-lg ${className}`.trim()
|
|
15
|
+
export const headerClasses = `w-full flex items-center justify-between px-4 py-3 text-left font-medium text-fg hover:bg-surface transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900`.trim()
|
|
16
|
+
export const iconClasses = `w-5 h-5 text-fg-soft transition-transform duration-200`.trim()
|
|
17
|
+
export const contentClasses = `px-4 py-3 text-fg-strong`.trim()
|
|
18
18
|
export const hasPropItems = Array.isArray(items) && items.length > 0
|
|
19
19
|
</script>
|
|
20
20
|
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
export const title = $props.title || ''
|
|
8
8
|
export const className = $props.className || ''
|
|
9
9
|
|
|
10
|
-
const headerClasses = 'w-full flex items-center justify-between px-4 py-3 text-left font-medium text-
|
|
11
|
-
const iconClasses = 'w-5 h-5 text-
|
|
12
|
-
const contentClasses = 'px-4 py-3 text-
|
|
10
|
+
const headerClasses = 'w-full flex items-center justify-between px-4 py-3 text-left font-medium text-fg hover:bg-surface transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900'
|
|
11
|
+
const iconClasses = 'w-5 h-5 text-fg-soft transition-transform duration-200'
|
|
12
|
+
const contentClasses = 'px-4 py-3 text-fg-strong'
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<div data-stx-accordion-item data-title="{{ title }}" class="{{ className }}">
|
package/src/ui/audio/Audio.stx
CHANGED
|
@@ -10,13 +10,13 @@ export const showWaveform = $props.showWaveform || false
|
|
|
10
10
|
export const title = $props.title || ''
|
|
11
11
|
|
|
12
12
|
export const containerClasses = `relative w-full ${className}`.trim()
|
|
13
|
-
export const audioClasses = 'w-full rounded-md bg-
|
|
13
|
+
export const audioClasses = 'w-full rounded-md bg-surface-raised'
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<div class="{{ containerClasses }}">
|
|
17
17
|
@if(title)
|
|
18
18
|
<div class="mb-2 px-1">
|
|
19
|
-
<h3 class="text-sm font-medium text-
|
|
19
|
+
<h3 class="text-sm font-medium text-fg">
|
|
20
20
|
{{ title }}
|
|
21
21
|
</h3>
|
|
22
22
|
</div>
|
|
@@ -35,7 +35,7 @@ export const audioClasses = 'w-full rounded-md bg-gray-100 dark:bg-gray-800'
|
|
|
35
35
|
</audio>
|
|
36
36
|
|
|
37
37
|
@if(showWaveform)
|
|
38
|
-
<div class="mt-2 h-16 bg-
|
|
38
|
+
<div class="mt-2 h-16 bg-surface-raised rounded-md flex items-center justify-center">
|
|
39
39
|
<svg class="w-full h-full px-4" viewBox="0 0 100 40" preserveAspectRatio="none">
|
|
40
40
|
<path
|
|
41
41
|
d="M 0,20 L 10,15 L 20,10 L 30,5 L 40,15 L 50,20 L 60,25 L 70,30 L 80,20 L 90,15 L 100,20"
|