@stacksjs/components 0.2.176 → 0.2.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{Accordion-pt8j917s.stx → Accordion-8tv78bh9.stx} +4 -4
  2. package/dist/{AccordionItem-hbhzx63p.stx → AccordionItem-7bd3ga36.stx} +3 -3
  3. package/dist/{Audio-hjywk3qc.stx → Audio-y0sgq50z.stx} +3 -3
  4. package/dist/{Avatar-h3jmwcq0.stx → Avatar-rjvwnskf.stx} +2 -2
  5. package/dist/{Badge-k8dy3d53.stx → Badge-k52qmxcm.stx} +1 -1
  6. package/dist/{Breadcrumb-7f7s4d02.stx → Breadcrumb-sy5taqsn.stx} +7 -7
  7. package/dist/{Button-1vknasy3.stx → Button-wrwmnfpf.stx} +2 -2
  8. package/dist/{Calendar-reny0et7.stx → Calendar-gjjhhfnt.stx} +8 -8
  9. package/dist/{Card-c1g1fd1w.stx → Card-473a02fy.stx} +3 -3
  10. package/dist/{Checkbox-aqmq4cqv.stx → Checkbox-2s2a7n4h.stx} +4 -4
  11. package/dist/{Checkout-agt0ngpw.stx → Checkout-22wh3s22.stx} +1 -1
  12. package/dist/{ComboboxOption-hmxt3gte.stx → ComboboxOption-6yh7xk7q.stx} +2 -2
  13. package/dist/{CommandPaletteItem-mvk6q7a2.stx → CommandPaletteItem-chdw0070.stx} +1 -1
  14. package/dist/{DefaultPaymentMethod-shhf6aap.stx → DefaultPaymentMethod-6qrem3sg.stx} +8 -8
  15. package/dist/{DialogDescription-76prd1m2.stx → DialogDescription-gth4c2kx.stx} +1 -1
  16. package/dist/{Drawer-hrz7qcyp.stx → Drawer-jgepqr9j.stx} +1 -1
  17. package/dist/{DropdownItem-c7rz08e5.stx → DropdownItem-d8ht2bp5.stx} +1 -1
  18. package/dist/{Form-bpnpbymb.stx → Form-vbag14t1.stx} +1 -1
  19. package/dist/{ListboxOption-e0dtv1gc.stx → ListboxOption-4j070101.stx} +2 -2
  20. package/dist/{Login-gepemsth.stx → Login-2cp65d41.stx} +40 -22
  21. package/dist/{Navigator-rk2a5wvk.stx → Navigator-smpa7my4.stx} +12 -12
  22. package/dist/{NumberInput-g41gmd2c.stx → NumberInput-j9p5bm5y.stx} +7 -7
  23. package/dist/{Pagination-wtgxmzey.stx → Pagination-jbcjrfcs.stx} +3 -3
  24. package/dist/{PasswordInput-4rsq1gwb.stx → PasswordInput-4qykq1dz.stx} +8 -8
  25. package/dist/{PaymentMethods-x4vrx9yb.stx → PaymentMethods-2xy66bwk.stx} +11 -11
  26. package/dist/{Progress-9dhakbh4.stx → Progress-4h7dytq5.stx} +9 -9
  27. package/dist/{Radio-djtb5dpc.stx → Radio-ccm07b2m.stx} +4 -4
  28. package/dist/RadioGroup-eerw9gq7.stx +138 -0
  29. package/dist/{RadioGroupDescription-yej78fak.stx → RadioGroupDescription-z34r9avr.stx} +1 -1
  30. package/dist/{RadioGroupOption-s1d6r221.stx → RadioGroupOption-7pq7rw84.stx} +1 -1
  31. package/dist/{Select-1vnd0brz.stx → Select-zt72gg1e.stx} +4 -4
  32. package/dist/{SidebarItem-2a6n0be3.stx → SidebarItem-5v8atp7p.stx} +2 -2
  33. package/dist/{SidebarPinned-tvj28bm0.stx → SidebarPinned-rq05nrtd.stx} +3 -3
  34. package/dist/{Signup-hxm5hwkr.stx → Signup-cbncrtvd.stx} +29 -19
  35. package/dist/{Skeleton-v1pwa8nr.stx → Skeleton-wtwb97xd.stx} +1 -1
  36. package/dist/{Spinner-7dahavkd.stx → Spinner-ypya5tt2.stx} +8 -8
  37. package/dist/{StepperStep-wxgembat.stx → StepperStep-3ahq4d9m.stx} +3 -3
  38. package/dist/{SubscriptionCheckout-zy2ycrmw.stx → SubscriptionCheckout-7fdkwf04.stx} +40 -34
  39. package/dist/{Switch-p1bcr9ks.stx → Switch-hdta55a8.stx} +1 -1
  40. package/dist/{Table-6cx8az9h.stx → Table-0mc3fdek.stx} +1 -1
  41. package/dist/{TableBody-wf6t13j9.stx → TableBody-drxyz5jh.stx} +1 -1
  42. package/dist/{TableCell-ntx0edbn.stx → TableCell-8swtcq8s.stx} +1 -1
  43. package/dist/{TableHead-3k4hnm2k.stx → TableHead-e9xvjx2j.stx} +1 -1
  44. package/dist/{TableHeader-0eyzbqpz.stx → TableHeader-sxc77b4d.stx} +2 -2
  45. package/dist/{TableRow-z09p2ebf.stx → TableRow-xd542nvb.stx} +1 -1
  46. package/dist/{Tabs-79brys99.stx → Tabs-b4xsba1w.stx} +6 -6
  47. package/dist/{TextInput-g0vaz0pe.stx → TextInput-cefyyprt.stx} +9 -9
  48. package/dist/{Textarea-96kawv5c.stx → Textarea-xcdym703.stx} +6 -6
  49. package/dist/{TwoFactorChallenge-y5m3nk79.stx → TwoFactorChallenge-y7n4yrk9.stx} +8 -8
  50. package/dist/{Video-84j4pv6h.stx → Video-a0aeyexv.stx} +1 -1
  51. package/dist/{VirtualTable-f9crbfjr.stx → VirtualTable-jvm1784g.stx} +6 -6
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.js +89 -55
  54. package/dist/theme/index.d.ts +92 -0
  55. package/package.json +3 -3
  56. package/src/index.ts +2 -0
  57. package/src/theme/index.ts +130 -0
  58. package/src/ui/accordion/Accordion.stx +4 -4
  59. package/src/ui/accordion/AccordionItem.stx +3 -3
  60. package/src/ui/audio/Audio.stx +3 -3
  61. package/src/ui/auth/Login.stx +40 -22
  62. package/src/ui/auth/Signup.stx +29 -19
  63. package/src/ui/auth/TwoFactorChallenge.stx +8 -8
  64. package/src/ui/avatar/Avatar.stx +2 -2
  65. package/src/ui/badge/Badge.stx +1 -1
  66. package/src/ui/breadcrumb/Breadcrumb.stx +7 -7
  67. package/src/ui/button/Button.stx +2 -2
  68. package/src/ui/calendar/Calendar.stx +8 -8
  69. package/src/ui/card/Card.stx +3 -3
  70. package/src/ui/checkbox/Checkbox.stx +4 -4
  71. package/src/ui/combobox/ComboboxOption.stx +2 -2
  72. package/src/ui/command-palette/CommandPaletteItem.stx +1 -1
  73. package/src/ui/dialog/DialogDescription.stx +1 -1
  74. package/src/ui/drawer/Drawer.stx +1 -1
  75. package/src/ui/dropdown/DropdownItem.stx +1 -1
  76. package/src/ui/form/Form.stx +1 -1
  77. package/src/ui/input/NumberInput.stx +7 -7
  78. package/src/ui/input/PasswordInput.stx +8 -8
  79. package/src/ui/input/TextInput.stx +9 -9
  80. package/src/ui/listbox/ListboxOption.stx +2 -2
  81. package/src/ui/navigator/Navigator.stx +12 -12
  82. package/src/ui/pagination/Pagination.stx +3 -3
  83. package/src/ui/payment/Checkout.stx +1 -1
  84. package/src/ui/payment/DefaultPaymentMethod.stx +8 -8
  85. package/src/ui/payment/PaymentMethods.stx +11 -11
  86. package/src/ui/payment/SubscriptionCheckout.stx +40 -34
  87. package/src/ui/progress/Progress.stx +9 -9
  88. package/src/ui/radio/Radio.stx +4 -4
  89. package/src/ui/radio-group/RadioGroup.stx +79 -1
  90. package/src/ui/radio-group/RadioGroupDescription.stx +1 -1
  91. package/src/ui/radio-group/RadioGroupOption.stx +1 -1
  92. package/src/ui/select/Select.stx +4 -4
  93. package/src/ui/sidebar/SidebarItem.stx +2 -2
  94. package/src/ui/sidebar/SidebarPinned.stx +3 -3
  95. package/src/ui/skeleton/Skeleton.stx +1 -1
  96. package/src/ui/spinner/Spinner.stx +8 -8
  97. package/src/ui/stepper/StepperStep.stx +3 -3
  98. package/src/ui/switch/Switch.stx +1 -1
  99. package/src/ui/table/Table.stx +1 -1
  100. package/src/ui/table/TableBody.stx +1 -1
  101. package/src/ui/table/TableCell.stx +1 -1
  102. package/src/ui/table/TableHead.stx +1 -1
  103. package/src/ui/table/TableHeader.stx +2 -2
  104. package/src/ui/table/TableRow.stx +1 -1
  105. package/src/ui/tabs/Tabs.stx +6 -6
  106. package/src/ui/textarea/Textarea.stx +6 -6
  107. package/src/ui/video/Video.stx +1 -1
  108. package/src/ui/virtual-table/VirtualTable.stx +6 -6
  109. package/dist/RadioGroup-qxmnm3xm.stx +0 -60
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- // ../../../../../../../tmp/stx-components-build-aYbHGJ/stubs/stub-0.js
2
+ // ../../../../../../../tmp/stx-components-build-TVCwKC/stubs/stub-0.js
3
3
  var stub_0_default = { __stx: true, src: "./components/CodeBlock.stx" };
4
- // ../../../../../../../tmp/stx-components-build-aYbHGJ/stubs/stub-1.js
4
+ // ../../../../../../../tmp/stx-components-build-TVCwKC/stubs/stub-1.js
5
5
  var stub_1_default = { __stx: true, src: "./components/Footer.stx" };
6
- // ../../../../../../../tmp/stx-components-build-aYbHGJ/stubs/stub-2.js
6
+ // ../../../../../../../tmp/stx-components-build-TVCwKC/stubs/stub-2.js
7
7
  var stub_2_default = { __stx: true, src: "./components/Hero.stx" };
8
- // ../../../../../../../tmp/stx-components-build-aYbHGJ/stubs/stub-3.js
8
+ // ../../../../../../../tmp/stx-components-build-TVCwKC/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-pt8j917s.stx";
576
+ var Accordion_default = "./Accordion-8tv78bh9.stx";
547
577
  // src/ui/accordion/AccordionItem.stx
548
- var AccordionItem_default = "./AccordionItem-hbhzx63p.stx";
578
+ var AccordionItem_default = "./AccordionItem-7bd3ga36.stx";
549
579
  // src/ui/audio/Audio.stx
550
- var Audio_default = "./Audio-hjywk3qc.stx";
580
+ var Audio_default = "./Audio-y0sgq50z.stx";
551
581
  // src/ui/auth/Login.stx
552
- var Login_default = "./Login-gepemsth.stx";
582
+ var Login_default = "./Login-2cp65d41.stx";
553
583
  // src/ui/auth/Signup.stx
554
- var Signup_default = "./Signup-hxm5hwkr.stx";
584
+ var Signup_default = "./Signup-cbncrtvd.stx";
555
585
  // src/ui/auth/TwoFactorChallenge.stx
556
- var TwoFactorChallenge_default = "./TwoFactorChallenge-y5m3nk79.stx";
586
+ var TwoFactorChallenge_default = "./TwoFactorChallenge-y7n4yrk9.stx";
557
587
  // src/ui/avatar/Avatar.stx
558
- var Avatar_default = "./Avatar-h3jmwcq0.stx";
588
+ var Avatar_default = "./Avatar-rjvwnskf.stx";
559
589
  // src/ui/badge/Badge.stx
560
- var Badge_default = "./Badge-k8dy3d53.stx";
590
+ var Badge_default = "./Badge-k52qmxcm.stx";
561
591
  // src/ui/breadcrumb/Breadcrumb.stx
562
- var Breadcrumb_default = "./Breadcrumb-7f7s4d02.stx";
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-1vknasy3.stx";
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-reny0et7.stx";
962
+ var Calendar_default = "./Calendar-gjjhhfnt.stx";
933
963
  // src/ui/card/Card.stx
934
- var Card_default = "./Card-c1g1fd1w.stx";
964
+ var Card_default = "./Card-473a02fy.stx";
935
965
  // src/ui/checkbox/Checkbox.stx
936
- var Checkbox_default = "./Checkbox-aqmq4cqv.stx";
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-hmxt3gte.stx";
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-mvk6q7a2.stx";
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-76prd1m2.stx";
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-hrz7qcyp.stx";
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-c7rz08e5.stx";
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-bpnpbymb.stx";
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-g41gmd2c.stx";
1022
+ var NumberInput_default = "./NumberInput-j9p5bm5y.stx";
993
1023
  // src/ui/input/PasswordInput.stx
994
- var PasswordInput_default = "./PasswordInput-4rsq1gwb.stx";
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-g0vaz0pe.stx";
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-e0dtv1gc.stx";
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-rk2a5wvk.stx";
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-wtgxmzey.stx";
1133
+ var Pagination_default = "./Pagination-jbcjrfcs.stx";
1104
1134
  // src/ui/payment/Checkout.stx
1105
- var Checkout_default = "./Checkout-agt0ngpw.stx";
1135
+ var Checkout_default = "./Checkout-22wh3s22.stx";
1106
1136
  // src/ui/payment/DefaultPaymentMethod.stx
1107
- var DefaultPaymentMethod_default = "./DefaultPaymentMethod-shhf6aap.stx";
1137
+ var DefaultPaymentMethod_default = "./DefaultPaymentMethod-6qrem3sg.stx";
1108
1138
  // src/ui/payment/PaymentMethods.stx
1109
- var PaymentMethods_default = "./PaymentMethods-x4vrx9yb.stx";
1139
+ var PaymentMethods_default = "./PaymentMethods-2xy66bwk.stx";
1110
1140
  // src/ui/payment/SubscriptionCheckout.stx
1111
- var SubscriptionCheckout_default = "./SubscriptionCheckout-zy2ycrmw.stx";
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-9dhakbh4.stx";
1151
+ var Progress_default = "./Progress-4h7dytq5.stx";
1122
1152
  // src/ui/radio/Radio.stx
1123
- var Radio_default = "./Radio-djtb5dpc.stx";
1153
+ var Radio_default = "./Radio-ccm07b2m.stx";
1124
1154
  // src/ui/radio-group/RadioGroup.stx
1125
- var RadioGroup_default = "./RadioGroup-qxmnm3xm.stx";
1155
+ var RadioGroup_default = "./RadioGroup-eerw9gq7.stx";
1126
1156
  // src/ui/radio-group/RadioGroupDescription.stx
1127
- var RadioGroupDescription_default = "./RadioGroupDescription-yej78fak.stx";
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-s1d6r221.stx";
1161
+ var RadioGroupOption_default = "./RadioGroupOption-7pq7rw84.stx";
1132
1162
  // src/ui/select/Select.stx
1133
- var Select_default = "./Select-1vnd0brz.stx";
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-2a6n0be3.stx";
1171
+ var SidebarItem_default = "./SidebarItem-5v8atp7p.stx";
1142
1172
  // src/ui/sidebar/SidebarPinned.stx
1143
- var SidebarPinned_default = "./SidebarPinned-tvj28bm0.stx";
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-v1pwa8nr.stx";
1477
+ var Skeleton_default = "./Skeleton-wtwb97xd.stx";
1448
1478
  // src/ui/spinner/Spinner.stx
1449
- var Spinner_default = "./Spinner-7dahavkd.stx";
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-wxgembat.stx";
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-p1bcr9ks.stx";
1728
+ var Switch_default = "./Switch-hdta55a8.stx";
1699
1729
  // src/ui/table/Table.stx
1700
- var Table_default = "./Table-6cx8az9h.stx";
1730
+ var Table_default = "./Table-0mc3fdek.stx";
1701
1731
  // src/ui/table/TableBody.stx
1702
- var TableBody_default = "./TableBody-wf6t13j9.stx";
1732
+ var TableBody_default = "./TableBody-drxyz5jh.stx";
1703
1733
  // src/ui/table/TableCell.stx
1704
- var TableCell_default = "./TableCell-ntx0edbn.stx";
1734
+ var TableCell_default = "./TableCell-8swtcq8s.stx";
1705
1735
  // src/ui/table/TableHead.stx
1706
- var TableHead_default = "./TableHead-3k4hnm2k.stx";
1736
+ var TableHead_default = "./TableHead-e9xvjx2j.stx";
1707
1737
  // src/ui/table/TableHeader.stx
1708
- var TableHeader_default = "./TableHeader-0eyzbqpz.stx";
1738
+ var TableHeader_default = "./TableHeader-sxc77b4d.stx";
1709
1739
  // src/ui/table/TableRow.stx
1710
- var TableRow_default = "./TableRow-z09p2ebf.stx";
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-79brys99.stx";
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-96kawv5c.stx";
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-84j4pv6h.stx";
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-f9crbfjr.stx";
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.176",
4
+ "version": "0.2.178",
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.176",
68
- "bun-plugin-stx": "0.2.176",
67
+ "@stacksjs/stx": "0.2.178",
68
+ "bun-plugin-stx": "0.2.178",
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-gray-200 dark:divide-gray-700 border border-gray-200 dark:border-gray-700 rounded-lg ${className}`.trim()
15
- export const headerClasses = `w-full flex items-center justify-between px-4 py-3 text-left font-medium text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800 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-gray-500 dark:text-gray-400 transition-transform duration-200`.trim()
17
- export const contentClasses = `px-4 py-3 text-gray-700 dark:text-gray-300`.trim()
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-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800 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-gray-500 dark:text-gray-400 transition-transform duration-200'
12
- const contentClasses = 'px-4 py-3 text-gray-700 dark:text-gray-300'
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 }}">
@@ -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-gray-100 dark:bg-gray-800'
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-gray-900 dark:text-gray-100">
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-gray-100 dark:bg-gray-800 rounded-md flex items-center justify-center">
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"