@cognitap/radiant 0.0.90 → 0.0.91
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/CHANGELOG.md +7 -0
- package/dist/library/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/library/components/Checkbox/Checkbox.js +2 -2
- package/dist/library/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/library/components/Collapsible/Collapsible.js +1 -1
- package/dist/library/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/library/components/InputGroup/InputGroup.js +1 -1
- package/dist/library/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/library/components/NavLink/NavLink.d.ts.map +1 -1
- package/dist/library/components/NavLink/NavLink.js +1 -1
- package/dist/library/components/NavLink/NavLink.js.map +1 -1
- package/dist/library/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/library/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/library/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/library/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/library/components/ScrollArea/ScrollArea.js +4 -1
- package/dist/library/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/library/components/Switch/Switch.d.ts.map +1 -1
- package/dist/library/components/Switch/Switch.js +2 -2
- package/dist/library/components/Switch/Switch.js.map +1 -1
- package/dist/library/components/TagsInput/TagsInput.d.ts.map +1 -1
- package/dist/library/components/TagsInput/TagsInput.js +1 -1
- package/dist/library/components/TagsInput/TagsInput.js.map +1 -1
- package/dist/library/components/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/library/components/TimeInput/TimeInput.js +28 -20
- package/dist/library/components/TimeInput/TimeInput.js.map +1 -1
- package/dist/library/components/Toast/Toast.js +1 -1
- package/dist/library/components/Toast/Toast.js.map +1 -1
- package/dist/library/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/library/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/library/styles.css +1 -1
- package/docs/architecture.md +7 -0
- package/package.json +1 -1
- package/src/components/Checkbox/Checkbox.tsx +2 -0
- package/src/components/Collapsible/Collapsible.tsx +1 -1
- package/src/components/InputGroup/InputGroup.tsx +2 -2
- package/src/components/NavLink/NavLink.tsx +1 -6
- package/src/components/RadioGroup/RadioGroup.tsx +3 -0
- package/src/components/ScrollArea/ScrollArea.tsx +5 -1
- package/src/components/Switch/Switch.tsx +2 -0
- package/src/components/TagsInput/TagsInput.tsx +1 -0
- package/src/components/TimeInput/TimeInput.tsx +100 -75
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/ToggleGroup/ToggleGroup.tsx +1 -1
package/docs/architecture.md
CHANGED
|
@@ -75,6 +75,13 @@ Omitting the locale inherits formatting and matching from the closest provider.
|
|
|
75
75
|
|
|
76
76
|
`NumberField` localizes its display and parsing. `NumberFormatter` preserves server text when browser locale data differs during hydration. Select and Menu use locale-aware prefix search. Combobox, Autocomplete and their composed families use locale-aware substring search. Built-in matching ignores case and distinguishes accents. Caller filters and text props still apply.
|
|
77
77
|
|
|
78
|
+
### Right-to-left (RTL)
|
|
79
|
+
|
|
80
|
+
Direction-sensitive behavior reads computed CSS direction from the host or anchor, so components follow `LocaleProvider`, document `dir`, nested subtree overrides, and direct control `dir` props without separate RTL props. Logical CSS properties (`inset-inline-*`, `padding-inline-*`, `border-inline-*`, `rounded-s-*`/`rounded-e-*`, `text-start`) drive alignment, borders, indicators, and `ToastViewport` placement.
|
|
81
|
+
|
|
82
|
+
- **Verified coverage:** Horizontal arrow navigation, drag/pointer geometry, disclosure/branch chevron mirroring, logical alignment/positioning, horizontal and vertical scrolling, reading order, nested overrides, and SSR hydration are verified across overlays (`Popover`, `Tooltip`, `HoverCard`, `ContextMenu`, `Menu`, `Drawer`, `Toast`, `Tour`, `Select`, `Combobox`, `MultiSelect`, `Cascader`, `TreeSelect`), navigation (`Tabs`, `Toolbar`, `ToggleGroup`, `Menubar`, `NavigationMenu`, `Breadcrumb`, `Pagination`, `NavLink`, `AppShell`, `Stepper`, `Timeline`, `Tree`), controls (`Slider`, `RangeSlider`, `Rating`, `Calendar`, `DateField`, `DatePicker`, `DateRangePicker`, `TimeInput`, `ColorPicker`, `ColorInput`, `Switch`, `Checkbox`, `Radio`, `OTPField`, `TagsInput`, `NumberField`, `PasswordInput`, `FileInput`, `ButtonGroup`, `InputGroup`), and layout/data families (`Collapsible`, `Accordion`, `ScrollArea`, `Carousel`, `Resizable`, `DataTable`, `Indicator`, `CodeBlock`, `Charts`).
|
|
83
|
+
- **Intentional exceptions and limitations:** `TimeInput` keeps numeric `hour:minute[:second]` segments left-to-right while placing `dayPeriod` in the ambient flow. `CodeBlockViewport` defaults to `dir="ltr"` for source code and accepts an explicit `dir` override. `Popover`, `Tooltip`, and `HoverCard` keep physical `side` values (`'left' | 'right'`) while `align` (`'start' | 'end'`), `MenuSubContent`, `Drawer` (`'start' | 'end'`), and `Indicator` resolve logically. `Charts` preserve left-to-right SVG plot geometry while reversing horizontal keyboard stepping in RTL. Caller-supplied icons and `BreadcrumbSeparator` content are not mirrored automatically.
|
|
84
|
+
|
|
78
85
|
## Customization limits
|
|
79
86
|
|
|
80
87
|
`render(props)` on button and link parts must return a `<button>` or `<a>`, or a component that forwards to one, with all props, the ref, and the children.
|
package/package.json
CHANGED
|
@@ -121,6 +121,7 @@ export function Checkbox({
|
|
|
121
121
|
})
|
|
122
122
|
const controlNode = (
|
|
123
123
|
<span
|
|
124
|
+
dir={!labelled ? props.dir : undefined}
|
|
124
125
|
className={cn(
|
|
125
126
|
'relative inline-grid w-fit shrink-0',
|
|
126
127
|
indicatorPressClass,
|
|
@@ -186,6 +187,7 @@ export function Checkbox({
|
|
|
186
187
|
|
|
187
188
|
return (
|
|
188
189
|
<label
|
|
190
|
+
dir={props.dir}
|
|
189
191
|
className={cn(rowClass, parts?.wrapper?.className)}
|
|
190
192
|
style={parts?.wrapper?.style}
|
|
191
193
|
data-slot="checkbox-wrapper"
|
|
@@ -56,7 +56,7 @@ const collapsibleTriggerVariants = cva([
|
|
|
56
56
|
const collapsibleMarkerVariants = cva([
|
|
57
57
|
'size-4 shrink-0',
|
|
58
58
|
'transition-transform duration-[var(--rad-collapsible-duration,var(--rad-motion-disclosure-duration,150ms))] ease-out',
|
|
59
|
-
'[details[open]>summary>&]:rotate-90',
|
|
59
|
+
'rtl:rotate-180 [details[open]>summary>&]:rotate-90 rtl:[details[open]>summary>&]:rotate-90',
|
|
60
60
|
'motion-reduce:transition-none'
|
|
61
61
|
])
|
|
62
62
|
|
|
@@ -64,8 +64,8 @@ export function InputGroup({
|
|
|
64
64
|
'font-[family-name:var(--rad-typography-roles-ui-body-family,system-ui,sans-serif)] text-[length:var(--_rad-control-font-size)] leading-[var(--rad-typography-roles-ui-body-line-height,1.5)]',
|
|
65
65
|
focusWithinRingClass,
|
|
66
66
|
'focus-within:[--_rad-focus-color:var(--rad-input-group-focus-color)] focus-within:[--_rad-focus-width:var(--rad-input-group-focus-width)] focus-within:[--_rad-focus-offset:var(--rad-input-group-focus-offset)] focus-within:[--_rad-focus-style:var(--rad-input-group-focus-style)]',
|
|
67
|
-
'has-[>[data-invalid]]:[border-color:var(--rad-input-group-invalid-border,var(--rad-color-invalid,oklch(0.56_0.19_25)))]',
|
|
68
|
-
'has-[>input:disabled]:cursor-not-allowed has-[>textarea:disabled]:cursor-not-allowed has-[>input:disabled]:bg-[var(--rad-color-disabled-background,oklch(0.96_0.005_286))] has-[>textarea:disabled]:bg-[var(--rad-color-disabled-background,oklch(0.96_0.005_286))]',
|
|
67
|
+
'has-[>[data-invalid],[data-slot~=input-group-input][data-invalid]]:[border-color:var(--rad-input-group-invalid-border,var(--rad-color-invalid,oklch(0.56_0.19_25)))]',
|
|
68
|
+
'has-[>input:disabled,[data-slot~=input-group-input]:disabled]:cursor-not-allowed has-[>textarea:disabled]:cursor-not-allowed has-[>input:disabled,[data-slot~=input-group-input]:disabled]:bg-[var(--rad-color-disabled-background,oklch(0.96_0.005_286))] has-[>textarea:disabled]:bg-[var(--rad-color-disabled-background,oklch(0.96_0.005_286))]',
|
|
69
69
|
'forced-colors:border-[CanvasText] forced-colors:bg-[Canvas] forced-colors:text-[CanvasText]',
|
|
70
70
|
className
|
|
71
71
|
)}
|
|
@@ -160,12 +160,7 @@ export function NavLinkGroupTrigger({
|
|
|
160
160
|
{...native}
|
|
161
161
|
data-slot={joinIds('nav-link-group-trigger', slot)}
|
|
162
162
|
data-control-size={controlSize}
|
|
163
|
-
className={cn(
|
|
164
|
-
controlMetrics({ controlSize }),
|
|
165
|
-
itemClass,
|
|
166
|
-
'rtl:[&>svg]:rotate-180 rtl:data-[state=open]:[&>svg]:rotate-90',
|
|
167
|
-
className
|
|
168
|
-
)}
|
|
163
|
+
className={cn(controlMetrics({ controlSize }), itemClass, className)}
|
|
169
164
|
>
|
|
170
165
|
<Content {...{ icon, description, parts, children }} />
|
|
171
166
|
</CollapsibleTrigger>
|
|
@@ -232,6 +232,7 @@ export function Radio({
|
|
|
232
232
|
}, [controlled, selected])
|
|
233
233
|
const controlNode = (
|
|
234
234
|
<span
|
|
235
|
+
dir={!labelled && !described ? props.dir : undefined}
|
|
235
236
|
className={cn(
|
|
236
237
|
'relative inline-grid shrink-0',
|
|
237
238
|
indicatorPressClass,
|
|
@@ -273,6 +274,7 @@ export function Radio({
|
|
|
273
274
|
|
|
274
275
|
const row = labelled ? (
|
|
275
276
|
<label
|
|
277
|
+
dir={!described ? props.dir : undefined}
|
|
276
278
|
className={cn(rowClass, !described && parts?.wrapper?.className)}
|
|
277
279
|
style={!described ? parts?.wrapper?.style : undefined}
|
|
278
280
|
data-slot={!described ? 'radio-wrapper' : undefined}
|
|
@@ -294,6 +296,7 @@ export function Radio({
|
|
|
294
296
|
|
|
295
297
|
return (
|
|
296
298
|
<div
|
|
299
|
+
dir={props.dir}
|
|
297
300
|
className={cn('grid min-w-0 max-w-full justify-items-start', parts?.wrapper?.className)}
|
|
298
301
|
style={parts?.wrapper?.style}
|
|
299
302
|
data-slot="radio-wrapper"
|
|
@@ -182,7 +182,8 @@ export function ScrollArea({
|
|
|
182
182
|
})
|
|
183
183
|
}
|
|
184
184
|
const resize = new win.ResizeObserver(schedule),
|
|
185
|
-
mutation = new win.MutationObserver(schedule)
|
|
185
|
+
mutation = new win.MutationObserver(schedule),
|
|
186
|
+
direction = new win.MutationObserver(schedule)
|
|
186
187
|
resize.observe(node)
|
|
187
188
|
resize.observe(body)
|
|
188
189
|
mutation.observe(body, {
|
|
@@ -191,6 +192,8 @@ export function ScrollArea({
|
|
|
191
192
|
characterData: true,
|
|
192
193
|
attributes: true
|
|
193
194
|
})
|
|
195
|
+
for (let ancestor: HTMLElement | null = node; ancestor; ancestor = ancestor.parentElement)
|
|
196
|
+
direction.observe(ancestor, { attributes: true, attributeFilter: ['dir', 'class', 'style'] })
|
|
194
197
|
body.addEventListener('load', schedule, true)
|
|
195
198
|
body.addEventListener('loadedmetadata', schedule, true)
|
|
196
199
|
node.ownerDocument.fonts?.addEventListener('loadingdone', schedule)
|
|
@@ -198,6 +201,7 @@ export function ScrollArea({
|
|
|
198
201
|
return () => {
|
|
199
202
|
resize.disconnect()
|
|
200
203
|
mutation.disconnect()
|
|
204
|
+
direction.disconnect()
|
|
201
205
|
body.removeEventListener('load', schedule, true)
|
|
202
206
|
body.removeEventListener('loadedmetadata', schedule, true)
|
|
203
207
|
node.ownerDocument.fonts?.removeEventListener('loadingdone', schedule)
|
|
@@ -111,6 +111,7 @@ export function Switch({
|
|
|
111
111
|
})
|
|
112
112
|
const controlNode = (
|
|
113
113
|
<span
|
|
114
|
+
dir={!labelled ? props.dir : undefined}
|
|
114
115
|
className={cn('relative inline-grid w-fit shrink-0', !labelled && parts?.wrapper?.className)}
|
|
115
116
|
style={!labelled ? parts?.wrapper?.style : undefined}
|
|
116
117
|
data-slot={!labelled ? 'switch-wrapper' : undefined}
|
|
@@ -163,6 +164,7 @@ export function Switch({
|
|
|
163
164
|
if (!labelled) return controlNode
|
|
164
165
|
return (
|
|
165
166
|
<label
|
|
167
|
+
dir={props.dir}
|
|
166
168
|
className={cn(rowClass, parts?.wrapper?.className)}
|
|
167
169
|
style={parts?.wrapper?.style}
|
|
168
170
|
data-slot="switch-wrapper"
|
|
@@ -149,7 +149,9 @@ export function TimeInput({
|
|
|
149
149
|
edit({ ...parts, [part]: text })
|
|
150
150
|
if (text.length === 2) {
|
|
151
151
|
const segments = Array.from(
|
|
152
|
-
input
|
|
152
|
+
input
|
|
153
|
+
.closest('[data-slot~="time-input"]')
|
|
154
|
+
?.querySelectorAll<HTMLElement>('[data-segment]') ?? []
|
|
153
155
|
)
|
|
154
156
|
segments[segments.indexOf(input) + 1]?.focus()
|
|
155
157
|
}
|
|
@@ -175,6 +177,84 @@ export function TimeInput({
|
|
|
175
177
|
owner.request(isoTime(next, withSeconds))
|
|
176
178
|
}
|
|
177
179
|
|
|
180
|
+
const isClock = (type: string) => type === 'hour' || type === 'minute' || type === 'second'
|
|
181
|
+
const firstClock = format.parts.findIndex(({ type }) => isClock(type))
|
|
182
|
+
const lastClock = format.parts.reduce(
|
|
183
|
+
(last, part, index) => (isClock(part.type) ? index : last),
|
|
184
|
+
-1
|
|
185
|
+
)
|
|
186
|
+
const renderPart = ({ type: part, value: literal }: Intl.DateTimeFormatPart, index: number) => {
|
|
187
|
+
if (part === 'dayPeriod')
|
|
188
|
+
return (
|
|
189
|
+
<Button
|
|
190
|
+
key={part}
|
|
191
|
+
type="button"
|
|
192
|
+
variant="ghost"
|
|
193
|
+
tone="neutral"
|
|
194
|
+
motion="off"
|
|
195
|
+
data-slot="time-input-period"
|
|
196
|
+
data-segment={part}
|
|
197
|
+
aria-label={[format.names.of(part), format[parts.dayPeriod]].filter(Boolean).join(' ')}
|
|
198
|
+
aria-describedby={control['aria-describedby']}
|
|
199
|
+
controlSize={controlSize}
|
|
200
|
+
disabled={control.disabled || readOnly}
|
|
201
|
+
onClick={togglePeriod}
|
|
202
|
+
onKeyDown={event => {
|
|
203
|
+
if (event.altKey || event.metaKey || event.ctrlKey || event.defaultPrevented) return
|
|
204
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
205
|
+
event.preventDefault()
|
|
206
|
+
togglePeriod()
|
|
207
|
+
}
|
|
208
|
+
}}
|
|
209
|
+
className={cn(
|
|
210
|
+
inlineActionClass,
|
|
211
|
+
focusRingInsetClass,
|
|
212
|
+
'min-h-[max(1.5rem,calc(var(--_rad-control-height)-0.75rem))] min-w-6 [--rad-button-border-width:0px] px-1 leading-none',
|
|
213
|
+
'text-[color:var(--rad-time-input-period-color,var(--rad-color-foreground))] underline decoration-dotted decoration-[color:var(--rad-time-input-period-indicator-color,var(--rad-color-muted-foreground))] underline-offset-4 enabled:hover:decoration-solid disabled:no-underline'
|
|
214
|
+
)}
|
|
215
|
+
>
|
|
216
|
+
{format[parts.dayPeriod]}
|
|
217
|
+
</Button>
|
|
218
|
+
)
|
|
219
|
+
if (part !== 'hour' && part !== 'minute' && part !== 'second')
|
|
220
|
+
return (
|
|
221
|
+
<span
|
|
222
|
+
key={index}
|
|
223
|
+
aria-hidden="true"
|
|
224
|
+
>
|
|
225
|
+
{literal}
|
|
226
|
+
</span>
|
|
227
|
+
)
|
|
228
|
+
return (
|
|
229
|
+
<InputGroupInput
|
|
230
|
+
key={part}
|
|
231
|
+
data-segment={part}
|
|
232
|
+
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- Localized digits need text entry with per-segment spinbutton semantics.
|
|
233
|
+
role="spinbutton"
|
|
234
|
+
aria-valuemin={part === 'hour' ? format.hourMin : 0}
|
|
235
|
+
aria-valuemax={part === 'hour' ? format.hourMax : 59}
|
|
236
|
+
aria-valuenow={parts[part] ? Number(parts[part]) : undefined}
|
|
237
|
+
ref={part === 'hour' ? editorRef : undefined}
|
|
238
|
+
id={part === 'hour' ? control.id : undefined}
|
|
239
|
+
form={form}
|
|
240
|
+
disabled={control.disabled}
|
|
241
|
+
readOnly={readOnly}
|
|
242
|
+
required={control.required}
|
|
243
|
+
aria-label={format.names.of(part)}
|
|
244
|
+
aria-describedby={control['aria-describedby']}
|
|
245
|
+
aria-invalid={invalid || control['aria-invalid'] || undefined}
|
|
246
|
+
placeholder="––"
|
|
247
|
+
autoComplete="off"
|
|
248
|
+
inputMode="numeric"
|
|
249
|
+
className="w-[2.7ch] flex-none text-center tabular-nums focus-visible:underline"
|
|
250
|
+
value={format.localize(parts[part])}
|
|
251
|
+
onFocus={event => event.currentTarget.select()}
|
|
252
|
+
onChange={event => editNumber(part, event.currentTarget)}
|
|
253
|
+
onKeyDown={event => advance(event, part)}
|
|
254
|
+
/>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
178
258
|
return (
|
|
179
259
|
<InputGroup
|
|
180
260
|
data-slot="time-input"
|
|
@@ -187,80 +267,25 @@ export function TimeInput({
|
|
|
187
267
|
style={style}
|
|
188
268
|
>
|
|
189
269
|
<WithoutField>
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (event.altKey || event.metaKey || event.ctrlKey || event.defaultPrevented)
|
|
210
|
-
return
|
|
211
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
212
|
-
event.preventDefault()
|
|
213
|
-
togglePeriod()
|
|
214
|
-
}
|
|
215
|
-
}}
|
|
216
|
-
className={cn(
|
|
217
|
-
inlineActionClass,
|
|
218
|
-
focusRingInsetClass,
|
|
219
|
-
'min-h-[max(1.5rem,calc(var(--_rad-control-height)-0.75rem))] min-w-6 [--rad-button-border-width:0px] px-1 leading-none',
|
|
220
|
-
'text-[color:var(--rad-time-input-period-color,var(--rad-color-foreground))] underline decoration-dotted decoration-[color:var(--rad-time-input-period-indicator-color,var(--rad-color-muted-foreground))] underline-offset-4 enabled:hover:decoration-solid disabled:no-underline'
|
|
221
|
-
)}
|
|
222
|
-
>
|
|
223
|
-
{format[parts.dayPeriod]}
|
|
224
|
-
</Button>
|
|
225
|
-
)
|
|
226
|
-
if (part !== 'hour' && part !== 'minute' && part !== 'second')
|
|
227
|
-
return (
|
|
228
|
-
<span
|
|
229
|
-
key={index}
|
|
230
|
-
aria-hidden="true"
|
|
231
|
-
>
|
|
232
|
-
{literal}
|
|
233
|
-
</span>
|
|
234
|
-
)
|
|
235
|
-
return (
|
|
236
|
-
<InputGroupInput
|
|
237
|
-
key={part}
|
|
238
|
-
data-segment={part}
|
|
239
|
-
// oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- Localized digits need text entry with per-segment spinbutton semantics.
|
|
240
|
-
role="spinbutton"
|
|
241
|
-
aria-valuemin={part === 'hour' ? format.hourMin : 0}
|
|
242
|
-
aria-valuemax={part === 'hour' ? format.hourMax : 59}
|
|
243
|
-
aria-valuenow={parts[part] ? Number(parts[part]) : undefined}
|
|
244
|
-
ref={part === 'hour' ? editorRef : undefined}
|
|
245
|
-
id={part === 'hour' ? control.id : undefined}
|
|
246
|
-
form={form}
|
|
247
|
-
disabled={control.disabled}
|
|
248
|
-
readOnly={readOnly}
|
|
249
|
-
required={control.required}
|
|
250
|
-
aria-label={format.names.of(part)}
|
|
251
|
-
aria-describedby={control['aria-describedby']}
|
|
252
|
-
aria-invalid={invalid || control['aria-invalid'] || undefined}
|
|
253
|
-
placeholder="––"
|
|
254
|
-
autoComplete="off"
|
|
255
|
-
inputMode="numeric"
|
|
256
|
-
className="w-[2.7ch] flex-none text-center tabular-nums focus-visible:underline"
|
|
257
|
-
value={format.localize(parts[part])}
|
|
258
|
-
onFocus={event => event.currentTarget.select()}
|
|
259
|
-
onChange={event => editNumber(part, event.currentTarget)}
|
|
260
|
-
onKeyDown={event => advance(event, part)}
|
|
261
|
-
/>
|
|
262
|
-
)
|
|
263
|
-
})}
|
|
270
|
+
{firstClock >= 0 ? (
|
|
271
|
+
<>
|
|
272
|
+
{format.parts.slice(0, firstClock).map((part, index) => renderPart(part, index))}
|
|
273
|
+
<span
|
|
274
|
+
dir="ltr"
|
|
275
|
+
data-slot="time-input-clock"
|
|
276
|
+
className="inline-flex items-center"
|
|
277
|
+
>
|
|
278
|
+
{format.parts
|
|
279
|
+
.slice(firstClock, lastClock + 1)
|
|
280
|
+
.map((part, offset) => renderPart(part, firstClock + offset))}
|
|
281
|
+
</span>
|
|
282
|
+
{format.parts
|
|
283
|
+
.slice(lastClock + 1)
|
|
284
|
+
.map((part, offset) => renderPart(part, lastClock + 1 + offset))}
|
|
285
|
+
</>
|
|
286
|
+
) : (
|
|
287
|
+
format.parts.map(renderPart)
|
|
288
|
+
)}
|
|
264
289
|
</WithoutField>
|
|
265
290
|
<input
|
|
266
291
|
type="hidden"
|
|
@@ -401,7 +401,7 @@ export function ToastViewport({ hotkey = true, ref, className, ...props }: Toast
|
|
|
401
401
|
tabIndex={-1}
|
|
402
402
|
data-slot={joinIds('toast-viewport', props['data-slot'])}
|
|
403
403
|
className={cn(
|
|
404
|
-
'pointer-events-none fixed
|
|
404
|
+
'pointer-events-none fixed end-[var(--rad-toast-inset,1rem)] bottom-[var(--rad-toast-inset,1rem)] z-[var(--rad-toast-z-index,50)] grid min-w-0 w-[var(--rad-toast-width,24rem)] max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)] overflow-visible',
|
|
405
405
|
className
|
|
406
406
|
)}
|
|
407
407
|
/>
|
|
@@ -331,7 +331,7 @@ function Indicator({
|
|
|
331
331
|
attributeFilter: ['aria-pressed', 'class', 'style', 'hidden', 'dir']
|
|
332
332
|
})
|
|
333
333
|
for (let parent = root.parentElement; parent; parent = parent.parentElement)
|
|
334
|
-
changes.observe(parent, { attributes: true, attributeFilter: ['dir'] })
|
|
334
|
+
changes.observe(parent, { attributes: true, attributeFilter: ['dir', 'class', 'style'] })
|
|
335
335
|
observe()
|
|
336
336
|
measure()
|
|
337
337
|
view.addEventListener('resize', schedule)
|