@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.
- package/dist/{Button-55ahz0j6.stx → Button-j7gjvpxz.stx} +53 -0
- package/dist/{Checkbox-m90hgax3.stx → Checkbox-0grmgne5.stx} +20 -3
- package/dist/{Dialog-gec1h2y7.stx → Dialog-bb8d6zav.stx} +8 -0
- package/dist/{DialogDescription-gth4c2kx.stx → DialogDescription-yd2jgt2m.stx} +2 -1
- package/dist/{DialogPanel-dj0qjfdq.stx → DialogPanel-efae92wv.stx} +24 -0
- package/dist/{DialogTitle-ke58hh68.stx → DialogTitle-nw0pw114.stx} +2 -1
- package/dist/{Drawer-4rqfcg4f.stx → Drawer-fzvxe2c3.stx} +31 -0
- package/dist/{EmailInput-57626391.stx → EmailInput-sf9jfrgz.stx} +11 -2
- package/dist/{GroupedList-mx0b5fe7.stx → GroupedList-j3sxv5pb.stx} +13 -3
- package/dist/{GroupedListRow-nz8b6vx4.stx → GroupedListRow-v52zmzpk.stx} +42 -15
- package/dist/{Image-71fhf8fg.stx → Image-nwxax17j.stx} +8 -1
- package/dist/{ListRow-8d3e1yxh.stx → ListRow-nvyg2fwb.stx} +32 -8
- package/dist/{PasswordInput-dg41ktgd.stx → PasswordInput-r51qzgc0.stx} +64 -0
- package/dist/{SectionCard-8ctdacjr.stx → SectionCard-8b5fyrjd.stx} +16 -4
- package/dist/{SegmentedControl-yvkjtc7y.stx → SegmentedControl-z9gk2fpn.stx} +23 -5
- package/dist/{Select-61zv5tr7.stx → Select-1cnqbcmg.stx} +39 -0
- package/dist/{Switch-rbxpzn5g.stx → Switch-nay7zdee.stx} +46 -0
- package/dist/{Tab-46mxm7f8.stx → Tab-j9f4t166.stx} +5 -1
- package/dist/{TabList-5xwk2zmz.stx → TabList-r1pc87xs.stx} +8 -1
- package/dist/{Tabs-bp03efe6.stx → Tabs-psm5wj7c.stx} +16 -1
- package/dist/{TextInput-9bm9gy8j.stx → TextInput-vy4qpncz.stx} +138 -6
- package/dist/index.js +10 -10
- package/dist/ui/button/Button.d.ts +61 -0
- package/dist/ui/checkbox/Checkbox.d.ts +8 -1
- package/dist/ui/checkbox/index.d.ts +1 -0
- package/dist/ui/dialog/Dialog.d.ts +7 -1
- package/dist/ui/dialog/DialogPanel.d.ts +10 -0
- package/dist/ui/grouped-list/GroupedList.d.ts +8 -1
- package/dist/ui/grouped-list/GroupedListRow.d.ts +10 -2
- package/dist/ui/image/Image.d.ts +3 -1
- package/dist/ui/input/EmailInput.d.ts +8 -0
- package/dist/ui/input/PasswordInput.d.ts +10 -0
- package/dist/ui/input/TextInput.d.ts +12 -1
- package/dist/ui/mobile/ListRow.d.ts +13 -0
- package/dist/ui/mobile/SectionCard.d.ts +10 -0
- package/dist/ui/segmented-control/SegmentedControl.d.ts +10 -2
- package/dist/ui/tabs/Tab.d.ts +1 -1
- package/dist/ui/tabs/TabList.d.ts +6 -1
- package/dist/ui/tabs/Tabs.d.ts +8 -0
- package/package.json +3 -3
- package/src/ui/button/Button.stx +53 -0
- package/src/ui/checkbox/Checkbox.stx +20 -3
- package/src/ui/checkbox/index.ts +2 -0
- package/src/ui/dialog/Dialog.stx +8 -0
- package/src/ui/dialog/DialogDescription.stx +2 -1
- package/src/ui/dialog/DialogPanel.stx +24 -0
- package/src/ui/dialog/DialogTitle.stx +2 -1
- package/src/ui/drawer/Drawer.stx +31 -0
- package/src/ui/grouped-list/GroupedList.stx +13 -3
- package/src/ui/grouped-list/GroupedListRow.stx +42 -15
- package/src/ui/image/Image.stx +8 -1
- package/src/ui/input/EmailInput.stx +11 -2
- package/src/ui/input/PasswordInput.stx +64 -0
- package/src/ui/input/TextInput.stx +138 -6
- package/src/ui/mobile/ListRow.stx +32 -8
- package/src/ui/mobile/SectionCard.stx +16 -4
- package/src/ui/segmented-control/SegmentedControl.stx +23 -5
- package/src/ui/select/Select.stx +39 -0
- package/src/ui/switch/Switch.stx +46 -0
- package/src/ui/tabs/Tab.stx +5 -1
- package/src/ui/tabs/TabList.stx +8 -1
- package/src/ui/tabs/Tabs.stx +16 -1
package/src/ui/tabs/Tab.stx
CHANGED
|
@@ -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
|
-
|
|
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
|
package/src/ui/tabs/TabList.stx
CHANGED
|
@@ -34,7 +34,14 @@ const variantClasses = {
|
|
|
34
34
|
none: '',
|
|
35
35
|
}
|
|
36
36
|
const directionClasses = orientation === 'vertical' ? 'flex-col' : ''
|
|
37
|
-
|
|
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>
|
package/src/ui/tabs/Tabs.stx
CHANGED
|
@@ -36,7 +36,17 @@ const variantClasses = {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export const containerClasses = `flex ${orientationClasses[orientation] || orientationClasses.horizontal} ${className}`.trim()
|
|
39
|
-
|
|
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'
|