@stacksjs/components 0.2.656 → 0.2.662

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 (62) hide show
  1. package/dist/{Button-55ahz0j6.stx → Button-j7gjvpxz.stx} +53 -0
  2. package/dist/{Checkbox-m90hgax3.stx → Checkbox-0grmgne5.stx} +20 -3
  3. package/dist/{Dialog-gec1h2y7.stx → Dialog-bb8d6zav.stx} +8 -0
  4. package/dist/{DialogDescription-gth4c2kx.stx → DialogDescription-yd2jgt2m.stx} +2 -1
  5. package/dist/{DialogPanel-dj0qjfdq.stx → DialogPanel-efae92wv.stx} +24 -0
  6. package/dist/{DialogTitle-ke58hh68.stx → DialogTitle-nw0pw114.stx} +2 -1
  7. package/dist/{Drawer-4rqfcg4f.stx → Drawer-fzvxe2c3.stx} +31 -0
  8. package/dist/{EmailInput-57626391.stx → EmailInput-sf9jfrgz.stx} +11 -2
  9. package/dist/{GroupedList-mx0b5fe7.stx → GroupedList-j3sxv5pb.stx} +13 -3
  10. package/dist/{GroupedListRow-nz8b6vx4.stx → GroupedListRow-v52zmzpk.stx} +42 -15
  11. package/dist/{Image-71fhf8fg.stx → Image-nwxax17j.stx} +8 -1
  12. package/dist/{ListRow-8d3e1yxh.stx → ListRow-nvyg2fwb.stx} +32 -8
  13. package/dist/{PasswordInput-dg41ktgd.stx → PasswordInput-r51qzgc0.stx} +64 -0
  14. package/dist/{SectionCard-8ctdacjr.stx → SectionCard-8b5fyrjd.stx} +16 -4
  15. package/dist/{SegmentedControl-yvkjtc7y.stx → SegmentedControl-z9gk2fpn.stx} +23 -5
  16. package/dist/{Select-61zv5tr7.stx → Select-1cnqbcmg.stx} +39 -0
  17. package/dist/{Switch-rbxpzn5g.stx → Switch-nay7zdee.stx} +46 -0
  18. package/dist/{Tab-46mxm7f8.stx → Tab-j9f4t166.stx} +5 -1
  19. package/dist/{TabList-5xwk2zmz.stx → TabList-r1pc87xs.stx} +8 -1
  20. package/dist/{Tabs-bp03efe6.stx → Tabs-psm5wj7c.stx} +16 -1
  21. package/dist/{TextInput-9bm9gy8j.stx → TextInput-vy4qpncz.stx} +138 -6
  22. package/dist/index.js +10 -10
  23. package/dist/ui/button/Button.d.ts +61 -0
  24. package/dist/ui/checkbox/Checkbox.d.ts +8 -1
  25. package/dist/ui/checkbox/index.d.ts +1 -0
  26. package/dist/ui/dialog/Dialog.d.ts +7 -1
  27. package/dist/ui/dialog/DialogPanel.d.ts +10 -0
  28. package/dist/ui/grouped-list/GroupedList.d.ts +8 -1
  29. package/dist/ui/grouped-list/GroupedListRow.d.ts +10 -2
  30. package/dist/ui/image/Image.d.ts +3 -1
  31. package/dist/ui/input/EmailInput.d.ts +8 -0
  32. package/dist/ui/input/PasswordInput.d.ts +10 -0
  33. package/dist/ui/input/TextInput.d.ts +12 -1
  34. package/dist/ui/mobile/ListRow.d.ts +13 -0
  35. package/dist/ui/mobile/SectionCard.d.ts +10 -0
  36. package/dist/ui/segmented-control/SegmentedControl.d.ts +10 -2
  37. package/dist/ui/tabs/Tab.d.ts +1 -1
  38. package/dist/ui/tabs/TabList.d.ts +6 -1
  39. package/dist/ui/tabs/Tabs.d.ts +8 -0
  40. package/package.json +3 -3
  41. package/src/ui/button/Button.stx +53 -0
  42. package/src/ui/checkbox/Checkbox.stx +20 -3
  43. package/src/ui/checkbox/index.ts +2 -0
  44. package/src/ui/dialog/Dialog.stx +8 -0
  45. package/src/ui/dialog/DialogDescription.stx +2 -1
  46. package/src/ui/dialog/DialogPanel.stx +24 -0
  47. package/src/ui/dialog/DialogTitle.stx +2 -1
  48. package/src/ui/drawer/Drawer.stx +31 -0
  49. package/src/ui/grouped-list/GroupedList.stx +13 -3
  50. package/src/ui/grouped-list/GroupedListRow.stx +42 -15
  51. package/src/ui/image/Image.stx +8 -1
  52. package/src/ui/input/EmailInput.stx +11 -2
  53. package/src/ui/input/PasswordInput.stx +64 -0
  54. package/src/ui/input/TextInput.stx +138 -6
  55. package/src/ui/mobile/ListRow.stx +32 -8
  56. package/src/ui/mobile/SectionCard.stx +16 -4
  57. package/src/ui/segmented-control/SegmentedControl.stx +23 -5
  58. package/src/ui/select/Select.stx +39 -0
  59. package/src/ui/switch/Switch.stx +46 -0
  60. package/src/ui/tabs/Tab.stx +5 -1
  61. package/src/ui/tabs/TabList.stx +8 -1
  62. package/src/ui/tabs/Tabs.stx +16 -1
@@ -20,7 +20,11 @@ const variantClasses = {
20
20
  pills: `px-3 py-1.5 font-medium text-sm rounded-control text-fg-muted hover:text-fg aria-selected:bg-field aria-selected:text-fg aria-selected:shadow-sm transition-colors ${focusRing}`,
21
21
  none: '',
22
22
  }
23
- export const tabClasses = `${variantClasses[variant] ?? variantClasses.line} ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`.replace(/\s+/g, ' ').trim()
23
+ // On a native host ($native), a segment of the list's segmented control.
24
+ const nativeSegment = 'flex-1 min-h-[30px] px-3 items-center justify-center rounded-[7px] text-[13px] font-medium text-[#000000] dark:text-[#ffffff] aria-selected:font-semibold aria-selected:bg-[#ffffff] dark:aria-selected:bg-[#636366] aria-selected:shadow-sm'
25
+ export const tabClasses = $native && variant !== 'none'
26
+ ? `${nativeSegment} ${disabled ? 'opacity-50' : ''} ${className}`.replace(/\s+/g, ' ').trim()
27
+ : `${variantClasses[variant] ?? variantClasses.line} ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`.replace(/\s+/g, ' ').trim()
24
28
  </script>
25
29
 
26
30
  <button
@@ -34,7 +34,14 @@ const variantClasses = {
34
34
  none: '',
35
35
  }
36
36
  const directionClasses = orientation === 'vertical' ? 'flex-col' : ''
37
- export const listClasses = `${variantClasses[variant] ?? variantClasses.line} ${directionClasses} ${className}`.replace(/\s+/g, ' ').trim()
37
+ /*
38
+ * On a native host ($native) a horizontal strip is the phone's segmented
39
+ * control, the control iOS uses to switch a screen between views; its tabs
40
+ * draw the raised segment through `aria-selected:` (Tab.stx).
41
+ */
42
+ export const listClasses = $native && orientation === 'horizontal' && variant !== 'none'
43
+ ? `flex-row gap-0.5 p-0.5 rounded-[9px] bg-[#767680]/12 dark:bg-[#767680]/24 ${className}`.replace(/\s+/g, ' ').trim()
44
+ : `${variantClasses[variant] ?? variantClasses.line} ${directionClasses} ${className}`.replace(/\s+/g, ' ').trim()
38
45
  </script>
39
46
 
40
47
  <script client>
@@ -36,7 +36,17 @@ const variantClasses = {
36
36
  }
37
37
 
38
38
  export const containerClasses = `flex ${orientationClasses[orientation] || orientationClasses.horizontal} ${className}`.trim()
39
- export const tabListClasses = `flex ${tabListOrientationClasses[orientation] || tabListOrientationClasses.horizontal} ${variantClasses[variant] || variantClasses.line}`.trim()
39
+ /*
40
+ * On a native host ($native) a horizontal strip is the phone's segmented
41
+ * control: a grey track, the selected tab raised (getTabClasses).
42
+ */
43
+ export const nativeTabs = $native && orientation !== 'vertical'
44
+ // Empty on the web, so its stylesheet never meets them.
45
+ export const nativeTabBase = nativeTabs ? 'flex-1 min-h-[30px] px-3 items-center justify-center rounded-[7px]' : ''
46
+ export const nativeTabOn = nativeTabs ? 'bg-[#ffffff] dark:bg-[#636366] shadow-sm' : ''
47
+ export const tabListClasses = nativeTabs
48
+ ? 'flex-row gap-0.5 p-0.5 rounded-[9px] bg-[#767680]/12 dark:bg-[#767680]/24'
49
+ : `flex ${tabListOrientationClasses[orientation] || tabListOrientationClasses.horizontal} ${variantClasses[variant] || variantClasses.line}`.trim()
40
50
  export const tabPanelClasses = `p-4 focus:outline-none`.trim()
41
51
  // True when the parent passes a non-empty `tabs` array — switches to the
42
52
  // legacy render path, preserving the existing prop-array API.
@@ -50,6 +60,9 @@ const tabs = {{ tabs }}
50
60
  const variant = {{ variant }}
51
61
  const orientation = {{ orientation }}
52
62
  const hasPropTabs = {{ hasPropTabs }}
63
+ const nativeTabs = {{ nativeTabs }}
64
+ const nativeTabBase = {{ nativeTabBase }}
65
+ const nativeTabOn = {{ nativeTabOn }}
53
66
  // useRef takes the NAME the x-ref attribute uses. Called with no
54
67
  // argument it read $refs[undefined], which nothing ever fills, so
55
68
  // containerRef.value was null forever - the mount hook found no panels,
@@ -166,6 +179,8 @@ function isActive(index) {
166
179
 
167
180
  function getTabClasses(index) {
168
181
  const isActiveTab = isActive(index)
182
+ if (nativeTabs)
183
+ return `${nativeTabBase} ${isActiveTab ? nativeTabOn : ''}`
169
184
  const base = 'px-4 py-2 font-medium text-sm transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 focus:ring-offset-panel'
170
185
  if (variant === 'line') {
171
186
  const border = orientation === 'horizontal' ? 'border-b-2' : 'border-r-2'