@justai/cuts 0.69.0 → 0.71.0
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/package.json +1 -1
- package/src/Segmented.astro +24 -2
package/package.json
CHANGED
package/src/Segmented.astro
CHANGED
|
@@ -58,6 +58,20 @@ export interface Option {
|
|
|
58
58
|
/** Shown, never hidden — an option a person can see and not reach explains itself; one that
|
|
59
59
|
* vanishes reads as a feature that was removed. */
|
|
60
60
|
disabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* A translation key, for a consumer that swaps its words after render.
|
|
63
|
+
*
|
|
64
|
+
* queries: translate a segmented control · data-i · the labels stay English · one bundle many
|
|
65
|
+
* languages
|
|
66
|
+
*
|
|
67
|
+
* THE ECOSYSTEM'S OWN CONVENTION, carried by the component rather than left to the caller. A
|
|
68
|
+
* mounted child persona (`/files`, `/me`) is ONE static bundle on every host, so it cannot have
|
|
69
|
+
* per-locale routes and translates in the browser by sweeping `[data-i]`. A control that renders
|
|
70
|
+
* its label as bare text is a control whose words stay English in thirteen languages — and the
|
|
71
|
+
* consumer's only fix would be to reach inside and add the attribute itself, which is the
|
|
72
|
+
* homework law 1 exists to refuse.
|
|
73
|
+
*/
|
|
74
|
+
i18n?: string;
|
|
61
75
|
}
|
|
62
76
|
interface Props {
|
|
63
77
|
id: string;
|
|
@@ -85,7 +99,7 @@ const on = value && options.some((o) => o.value === value) ? value : options[0]?
|
|
|
85
99
|
tabindex={o.value === on ? 0 : -1}
|
|
86
100
|
>
|
|
87
101
|
<slot name={`icon-${o.value}`} />
|
|
88
|
-
<span class="jseg-label">{o.label}</span>
|
|
102
|
+
<span class="jseg-label" data-i={o.i18n}>{o.label}</span>
|
|
89
103
|
</button>
|
|
90
104
|
))}
|
|
91
105
|
</div>
|
|
@@ -112,8 +126,16 @@ const on = value && options.some((o) => o.value === value) ? value : options[0]?
|
|
|
112
126
|
this is what makes it true for the eye. */
|
|
113
127
|
isolation: isolate;
|
|
114
128
|
}
|
|
129
|
+
/* queries: segmented control height · 44px touch target · the segments are too small
|
|
130
|
+
TWO SIZES, AND THE DIFFERENCE IS WHAT THE CONTROL IS.
|
|
131
|
+
`full` is a VIEW'S OWN SWITCH — a thumb's first target on the screen, so it meets the fleet's
|
|
132
|
+
44px like every row and every action does. `inline` is a TOOLBAR CHIP, sitting among other
|
|
133
|
+
chrome at chrome's size; forcing 44 there would make a toolbar taller than its content, which
|
|
134
|
+
is why iOS ships its own segmented controls shorter in exactly that position.
|
|
135
|
+
Found by a consumer's spec measuring 33px where its page promised 44 — a number the component
|
|
136
|
+
should have owned rather than each page discovering separately. */
|
|
115
137
|
.jseg[data-width="full"] { display: flex; width: 100%; }
|
|
116
|
-
.jseg[data-width="full"] .jseg-item { flex: 1; }
|
|
138
|
+
.jseg[data-width="full"] .jseg-item { flex: 1; min-height: 44px; }
|
|
117
139
|
|
|
118
140
|
.jseg-item {
|
|
119
141
|
box-sizing: border-box;
|