twico-ui 1.11.0 → 1.12.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/CHANGELOG.md +28 -0
- package/dist/index.cjs +1690 -214
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +478 -72
- package/dist/index.d.ts +478 -72
- package/dist/index.mjs +1686 -215
- package/dist/index.mjs.map +1 -1
- package/llms.txt +308 -3
- package/package.json +6 -6
package/llms.txt
CHANGED
|
@@ -207,7 +207,7 @@ in the examples.
|
|
|
207
207
|
|
|
208
208
|
---
|
|
209
209
|
|
|
210
|
-
## Component reference (
|
|
210
|
+
## Component reference (81 components)
|
|
211
211
|
|
|
212
212
|
### Buttons & actions
|
|
213
213
|
|
|
@@ -293,6 +293,8 @@ Props:
|
|
|
293
293
|
- `padded` — `boolean` · default `true` — Pads the scrollable content region with the standard page padding; set false for edge-to-edge content.
|
|
294
294
|
- `sidebarOpen` — `boolean` — Open state of the sidebar's off-canvas drawer on mobile; providing this (or onSidebarOpenChange) makes the shell forward overlay/open/onOpenChange to the sidebar element.
|
|
295
295
|
- `onSidebarOpenChange` — `(open: boolean) => void` — Called when the sidebar drawer requests open or close; wire a Navbar's onMenuClick to () => onSidebarOpenChange(true) for the mobile menu button.
|
|
296
|
+
- `mainId` — `string` · default `"twc-main"` — Id for the `<main>` content region and the skip-link target.
|
|
297
|
+
- `skipLinkLabel` — `React.ReactNode | false` · default `"Skip to content"` — Label for the visually-hidden-until-focused skip-to-content link (the shell's first child). Pass `false`/`null` to opt out.
|
|
296
298
|
|
|
297
299
|
```jsx
|
|
298
300
|
import { AppShell, Sidebar, Button } from "twico-ui";
|
|
@@ -458,6 +460,13 @@ Inline code with a mono font and a subtle token-styled surface — use it instea
|
|
|
458
460
|
Props:
|
|
459
461
|
- `as` — `ElementType` · default `"code"` — Overrides the rendered element, defaulting to a code tag but allowing any tag when the semantics differ.
|
|
460
462
|
- `children` — `ReactNode` — Provides the inline code text or nodes shown in the mono font on the subtle token-styled surface.
|
|
463
|
+
- `block` — `boolean` · default `false` — Render a scrollable multi-line `<pre>` block instead of the inline pill; defaults `as` to "pre".
|
|
464
|
+
- `copyable` — `boolean` · default `false` — Show a copy-to-clipboard button (typically with `block`).
|
|
465
|
+
- `copyLabel` — `string` · default `"Copy code"` — Accessible label for the copy button.
|
|
466
|
+
- `copiedLabel` — `string` · default `"Copied"` — Accessible label announced after a successful copy.
|
|
467
|
+
- `href` — `string` — Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href).
|
|
468
|
+
- `target` — `React.HTMLAttributeAnchorTarget` — Anchor target — only used with as="a" (e.g. "_blank").
|
|
469
|
+
- `rel` — `string` — Anchor rel — only used with as="a"; pair "noopener noreferrer" with target="_blank".
|
|
461
470
|
|
|
462
471
|
```jsx
|
|
463
472
|
import { Code, Text } from "twico-ui";
|
|
@@ -562,6 +571,8 @@ Props:
|
|
|
562
571
|
- `disabled` — `boolean` · default `false` — Disable all interaction (the popover cannot be opened).
|
|
563
572
|
- `hint` — `React.ReactNode` — Helper text shown below when there is no error.
|
|
564
573
|
- `error` — `React.ReactNode` — Error message — turns the field red and replaces the hint.
|
|
574
|
+
- `alpha` — `boolean` · default `false` — Show an alpha slider and emit 8-digit `#RRGGBBAA`; the hex input then accepts 3/6/8-digit hex.
|
|
575
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size.
|
|
565
576
|
- `required` — `boolean` · default `false` — Marks the field required (adds an asterisk to the label).
|
|
566
577
|
|
|
567
578
|
```jsx
|
|
@@ -603,6 +614,10 @@ Props:
|
|
|
603
614
|
- `placement` — `"bottom" | "top"` · default `"bottom"` — Open the menu upward instead of down (e.g. near a viewport bottom).
|
|
604
615
|
- `portal` — `boolean` · default `false` — Render the dropdown in a portal (position:fixed on document.body) so it is never clipped by a scrolling/overflow-hidden ancestor; auto-flips up near the viewport bottom.
|
|
605
616
|
- `minWidth` — `number` · default `0` — Minimum popover width in px when portaled (useful when the control is narrow).
|
|
617
|
+
- `onInputChange` — `(query: string) => void` — Called with the raw query on every keystroke — drive a debounced remote fetch (with `loading` + `filter={false}`).
|
|
618
|
+
- `filter` — `boolean | ((option: ComboboxOption, query: string) => boolean)` — Client-side filtering: `false` shows options as-is (server-ranked); a function replaces the default label/description match.
|
|
619
|
+
- `loading` — `boolean` · default `false` — Show a loading row instead of the option list / empty state.
|
|
620
|
+
- `emptyText` — `string` · default `"No results found"` — Text shown when no options match.
|
|
606
621
|
- `name` — `string` — Form field name submitted with the value.
|
|
607
622
|
- `readOnly` — `boolean` · default `false` — Makes the field non-editable while still focusable/selectable.
|
|
608
623
|
- `autoComplete` — `string` — Browser autocomplete hint (e.g. "email", "off").
|
|
@@ -737,6 +752,8 @@ Props:
|
|
|
737
752
|
- `error` — `React.ReactNode` — Error message — turns the field red and replaces the hint.
|
|
738
753
|
- `required` — `boolean` · default `false` — Marks the field required (adds an asterisk to the label).
|
|
739
754
|
- `locale` — `string` — BCP-47 locale for Intl-derived month/weekday names and date formatting; omit for the runtime default.
|
|
755
|
+
- `disabledDate` — `(date: Date) => boolean` — Predicate to disable arbitrary dates (return true to disable). Composes with `min`/`max`.
|
|
756
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size.
|
|
740
757
|
|
|
741
758
|
```jsx
|
|
742
759
|
import { DatePicker } from "twico-ui";
|
|
@@ -774,6 +791,12 @@ Props:
|
|
|
774
791
|
- `error` — `React.ReactNode` — Error message — turns the field red and replaces the hint.
|
|
775
792
|
- `required` — `boolean` · default `false` — Marks the field required (adds an asterisk to the label).
|
|
776
793
|
- `locale` — `string` — BCP-47 locale for Intl-derived month/weekday names and date formatting; omit for the runtime default.
|
|
794
|
+
- `min` — `Date` — Earliest selectable date (inclusive); earlier days are disabled.
|
|
795
|
+
- `max` — `Date` — Latest selectable date (inclusive); later days are disabled.
|
|
796
|
+
- `disabledDate` — `(date: Date) => boolean` — Predicate to disable arbitrary dates (return true to disable).
|
|
797
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size.
|
|
798
|
+
- `clearable` — `boolean` · default `true` — Show a clear (×) button when a range is set; clicking it resets both endpoints.
|
|
799
|
+
- `format` — `(range: DateRange) => string` — Custom display formatter for the range (defaults to a localized "start – end"). With `editable`, keep it compatible with `parse` so the text round-trips.
|
|
777
800
|
|
|
778
801
|
```jsx
|
|
779
802
|
import { DateRangePicker } from "twico-ui";
|
|
@@ -788,6 +811,52 @@ const [range, setRange] = useState({ start: null, end: null });
|
|
|
788
811
|
/>
|
|
789
812
|
```
|
|
790
813
|
|
|
814
|
+
#### DateTimePicker
|
|
815
|
+
|
|
816
|
+
DateTimePicker combines a calendar and a time-column popover over a single Date value: picking a day keeps the current time and vice-versa. It composes DatePicker and TimePicker side by side, so it inherits both — min/max bound the date while the time stays free.
|
|
817
|
+
|
|
818
|
+
`import { DateTimePicker } from "twico-ui"`
|
|
819
|
+
|
|
820
|
+
Props:
|
|
821
|
+
- `label` — `React.ReactNode` — Optional field label rendered above the date/time pair to name and associate it.
|
|
822
|
+
- `hint` — `React.ReactNode` — Helper text shown below the controls when there is no error message set.
|
|
823
|
+
- `error` — `React.ReactNode` — Error message that recolors both controls red and replaces the hint, shown once on the wrapper.
|
|
824
|
+
- `required` — `boolean` · default `false` — Marks the field required, adding an asterisk to the label as a validation cue.
|
|
825
|
+
- `value` — `Date | null` — Controlled selected date-time as a Date; pair with onChange to own the value in state.
|
|
826
|
+
- `defaultValue` — `Date | null` · default `null` — Initial date-time for uncontrolled usage when value is omitted, defaulting to null.
|
|
827
|
+
- `min` — `Date` — Earliest selectable date; dates before it are disabled in the calendar grid.
|
|
828
|
+
- `max` — `Date` — Latest selectable date; dates after it are disabled in the calendar grid.
|
|
829
|
+
- `disabledDate` — `(date: Date) => boolean` — Predicate to disable arbitrary dates (return true to disable), composing with min/max.
|
|
830
|
+
- `minuteStep` — `number` · default `5` — Increment in minutes for the time control's minute column.
|
|
831
|
+
- `secondStep` — `number` · default `5` — Increment in seconds for the second column when granularity is "second".
|
|
832
|
+
- `granularity` — `"hour" | "minute" | "second"` · default `"minute"` — Time granularity: hour only, hour and minute, or down to seconds.
|
|
833
|
+
- `hourCycle` — `12 | 24` · default `24` — 24-hour time columns, or 12-hour columns with an AM/PM column.
|
|
834
|
+
- `disabled` — `boolean` · default `false` — Disables both controls and prevents either popover from opening.
|
|
835
|
+
- `tone` — `"primary" | "success" | "warning" | "danger" | "info" | "neutral"` · default `"primary"` — Recolors the focus/open accent on both controls using one of six semantic intents.
|
|
836
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control height preset applied to both the date and time controls.
|
|
837
|
+
- `clearable` — `boolean` · default `true` — Shows a clear (×) on the date control that resets the entire value to null.
|
|
838
|
+
- `weekStartsOn` — `0 | 1 | 2 | 3 | 4 | 5 | 6` · default `0` — First day of the calendar week: 0 = Sunday through 6 = Saturday.
|
|
839
|
+
- `locale` — `string` — BCP-47 locale for names and formatting via Intl; omit for the runtime default.
|
|
840
|
+
- `dateFormat` — `(date: Date) => string` — Custom formatter for the date control's display text.
|
|
841
|
+
- `timeFormat` — `(date: Date) => string` — Custom formatter for the time control's display text.
|
|
842
|
+
- `datePlaceholder` — `string` · default `"Select date"` — Placeholder for the date control.
|
|
843
|
+
- `timePlaceholder` — `string` · default `"Time"` — Placeholder for the time control.
|
|
844
|
+
- `onChange` — `(date: Date | null) => void` — Fires with the merged Date (or null when cleared) after a date or time change.
|
|
845
|
+
|
|
846
|
+
```jsx
|
|
847
|
+
import { DateTimePicker } from "twico-ui";
|
|
848
|
+
|
|
849
|
+
const [when, setWhen] = useState(null);
|
|
850
|
+
|
|
851
|
+
<DateTimePicker
|
|
852
|
+
label="Shift start"
|
|
853
|
+
value={when}
|
|
854
|
+
onChange={setWhen}
|
|
855
|
+
hourCycle={12}
|
|
856
|
+
minuteStep={15}
|
|
857
|
+
/>
|
|
858
|
+
```
|
|
859
|
+
|
|
791
860
|
#### Field
|
|
792
861
|
|
|
793
862
|
Field is the reusable form-field wrapper that supplies the label, required asterisk, helper hint, and error message (with the matching ARIA ids) that Input and Select already use internally. Wrap any control with it to get consistent field spacing, the danger-colored error treatment, and the aria-describedby target without re-implementing the markup.
|
|
@@ -835,6 +904,10 @@ Props:
|
|
|
835
904
|
- `defaultValue` — `File[]` · default `[]` — Uncontrolled initial file list.
|
|
836
905
|
- `label` — `React.ReactNode` — Field label rendered above the dropzone.
|
|
837
906
|
- `error` — `React.ReactNode` — Error message shown below the dropzone; turns the border red (sets aria-invalid).
|
|
907
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size — scales the dropzone padding.
|
|
908
|
+
- `maxSize` — `number` — Max size per file in bytes; larger files are rejected (drag + browse).
|
|
909
|
+
- `maxFiles` — `number` — Max number of files retained (multiple mode); extra files are rejected.
|
|
910
|
+
- `onReject` — `(rejections: Array<{ file: File; reason: "type" | "size" | "count" }>) => void` — Called with the files that failed validation: `{ file, reason }` where reason is "type" | "size" | "count".
|
|
838
911
|
- `required` — `boolean` · default `false` — Marks the field required (adds an asterisk to the label).
|
|
839
912
|
|
|
840
913
|
```jsx
|
|
@@ -851,6 +924,43 @@ const [files, setFiles] = React.useState([]);
|
|
|
851
924
|
/>
|
|
852
925
|
```
|
|
853
926
|
|
|
927
|
+
#### FilterBar
|
|
928
|
+
|
|
929
|
+
FilterBar is a schema-driven faceted filter bar: it renders a row of controls from a fields schema (multi-select, date-range, search/text, number, boolean, select) and emits a normalized clause list [{ field, op, value }] (isAnyOf, >=/<, contains, =). It adds per-field clear ✕ and a Clear all (N) action, and options can cascade on the current values.
|
|
930
|
+
|
|
931
|
+
`import { FilterBar } from "twico-ui"`
|
|
932
|
+
|
|
933
|
+
Props:
|
|
934
|
+
- `fields` — `FilterField[]` · **required** — The filter schema: one entry per facet ({ field, label?, type, options?, placeholder?, op? }).
|
|
935
|
+
- `value` — `FilterClause[]` — Controlled clause list — the same normalized shape emitted by onChange, so it round-trips.
|
|
936
|
+
- `defaultValue` — `FilterClause[]` · default `[]` — Initial clause list for uncontrolled usage when value is omitted.
|
|
937
|
+
- `onChange` — `(clauses: FilterClause[]) => void` — Fires with the normalized clause list [{ field, op, value }] whenever any field changes.
|
|
938
|
+
- `onValuesChange` — `(values: FilterValues) => void` — Also fires with the raw per-field value map, a convenience for rehydrating controls.
|
|
939
|
+
- `showClearAll` — `boolean` · default `false` — Render a 'Clear all (N)' button that resets every field; N is the active-field count.
|
|
940
|
+
- `clearAllLabel` — `React.ReactNode` · default `"Clear all"` — Label text for the clear-all button.
|
|
941
|
+
- `showFieldClear` — `boolean` · default `true` — Show a per-field clear ✕ beside each active field's label.
|
|
942
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size applied to every field in the bar.
|
|
943
|
+
- `tone` — `"primary" | "success" | "warning" | "danger" | "info" | "neutral"` · default `"primary"` — Accent tone forwarded to the date-range control.
|
|
944
|
+
- `disabled` — `boolean` · default `false` — Disable the entire bar and hide the per-field/clear-all actions.
|
|
945
|
+
|
|
946
|
+
```jsx
|
|
947
|
+
import { FilterBar } from "twico-ui";
|
|
948
|
+
|
|
949
|
+
const [filters, setFilters] = useState([]);
|
|
950
|
+
|
|
951
|
+
<FilterBar
|
|
952
|
+
fields={[
|
|
953
|
+
{ field: "model", label: "Model", type: "multiselect", options: MODELS },
|
|
954
|
+
{ field: "createdAt", label: "Created", type: "daterange" },
|
|
955
|
+
{ field: "status", label: "Status", type: "boolean" },
|
|
956
|
+
{ field: "q", label: "Search", type: "search" },
|
|
957
|
+
]}
|
|
958
|
+
value={filters}
|
|
959
|
+
onChange={setFilters}
|
|
960
|
+
showClearAll
|
|
961
|
+
/>
|
|
962
|
+
```
|
|
963
|
+
|
|
854
964
|
#### Input
|
|
855
965
|
|
|
856
966
|
A text input with optional label, hint text, error/validation state, and inline leading/trailing icons. Use it for any single-line form field; with type="password" it gets a built-in reveal/hide eye toggle.
|
|
@@ -914,6 +1024,12 @@ Props:
|
|
|
914
1024
|
- `placement` — `"bottom" | "top"` · default `"bottom"` — Open the menu upward instead of down (e.g. near a viewport bottom).
|
|
915
1025
|
- `portal` — `boolean` · default `false` — Render the dropdown in a portal (position:fixed on document.body) so it is never clipped by a scrolling/overflow-hidden ancestor; auto-flips up near the viewport bottom.
|
|
916
1026
|
- `minWidth` — `number` · default `0` — Minimum popover width in px when portaled (useful when the control is narrow).
|
|
1027
|
+
- `loading` — `boolean` · default `false` — Show a loading row instead of the option list / empty state.
|
|
1028
|
+
- `emptyText` — `string` · default `"No results found"` — Text shown when no options match.
|
|
1029
|
+
- `onInputChange` — `(query: string) => void` — Fires with the raw typed query — drive a debounced remote fetch (pair with `loading` and `filter={false}` so server-ranked results aren't re-filtered locally).
|
|
1030
|
+
- `filter` — `boolean | ((option: MultiSelectOption, query: string) => boolean)` — `false` shows `options` as-is (server-ranked passthrough); a function replaces the default label/description matcher. Omit for the built-in local filter.
|
|
1031
|
+
- `max` — `number` — Cap the number of selectable values; once reached, unselected options become disabled.
|
|
1032
|
+
- `maxTagCount` — `number` — Collapse chips after N into a "+K more" pill.
|
|
917
1033
|
- `name` — `string` — Form field name submitted with the value.
|
|
918
1034
|
- `readOnly` — `boolean` · default `false` — Makes the field non-editable while still focusable/selectable.
|
|
919
1035
|
- `autoComplete` — `string` — Browser autocomplete hint (e.g. "email", "off").
|
|
@@ -1032,6 +1148,10 @@ Props:
|
|
|
1032
1148
|
- `portal` — `boolean` · default `false` — Renders the dropdown in a body portal so it is never clipped, auto-flipping when near the viewport bottom.
|
|
1033
1149
|
- `minWidth` — `number` · default `0` — Sets the minimum popover width in pixels when portaled, ensuring the menu stays at least this wide.
|
|
1034
1150
|
- `clearable` — `boolean` · default `false` — Show a clear (×) affix when a value is selected; Delete/Backspace on the closed trigger also clears. Emits onChange(null).
|
|
1151
|
+
- `matchTriggerWidth` — `boolean` · default `true` — Pin the popover to the trigger's width. Set false to size it to the widest option (clamped to the viewport).
|
|
1152
|
+
- `loading` — `boolean` · default `false` — Show a loading row instead of the option list / empty state (e.g. while fetching options).
|
|
1153
|
+
- `emptyText` — `string` · default `"No results found"` — Text shown when no options match.
|
|
1154
|
+
- `name` — `string` — Name for a hidden form field so the selected value participates in native form submission.
|
|
1035
1155
|
|
|
1036
1156
|
```jsx
|
|
1037
1157
|
import { Select } from "twico-ui";
|
|
@@ -1081,6 +1201,7 @@ Props:
|
|
|
1081
1201
|
- `onChange` — `(value: number) => void` — Fires with the new number whenever the value changes via drag or keyboard, keeping state in sync.
|
|
1082
1202
|
- `hint` — `React.ReactNode` — Helper text shown below the track when there is no error.
|
|
1083
1203
|
- `error` — `React.ReactNode` — Error message shown below the track; turns it red (sets aria-invalid) and replaces the hint.
|
|
1204
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control size — scales the track, rail, and thumb.
|
|
1084
1205
|
|
|
1085
1206
|
```jsx
|
|
1086
1207
|
import { Slider } from "twico-ui";
|
|
@@ -1168,6 +1289,50 @@ import { Textarea } from "twico-ui";
|
|
|
1168
1289
|
/>
|
|
1169
1290
|
```
|
|
1170
1291
|
|
|
1292
|
+
#### TimePicker
|
|
1293
|
+
|
|
1294
|
+
TimePicker is a time-of-day input with a column-spinner popover: scrollable hour, minute, and optional second columns, plus an AM/PM column in 12-hour mode. It emits a Date (so it composes with DatePicker) and bounds the selectable time via min/max.
|
|
1295
|
+
|
|
1296
|
+
`import { TimePicker } from "twico-ui"`
|
|
1297
|
+
|
|
1298
|
+
Props:
|
|
1299
|
+
- `label` — `React.ReactNode` — Optional field label rendered above the control to name it and associate it for accessibility.
|
|
1300
|
+
- `hint` — `React.ReactNode` — Helper text shown below the control when there is no error message set.
|
|
1301
|
+
- `error` — `React.ReactNode` — Error message that turns the control red and replaces the hint text below it.
|
|
1302
|
+
- `required` — `boolean` · default `false` — Marks the field required, adding an asterisk to the label as a validation cue.
|
|
1303
|
+
- `value` — `Date | null` — Controlled selected time as a Date; pair with onChange to own the value in state.
|
|
1304
|
+
- `defaultValue` — `Date | null` · default `null` — Initial time for uncontrolled usage when value is omitted, defaulting to null so it starts empty.
|
|
1305
|
+
- `placeholder` — `string` · default `"Select time"` — Text shown in the trigger when no time has been selected yet.
|
|
1306
|
+
- `min` — `Date` — Earliest selectable time-of-day; only the hours, minutes, and seconds are compared.
|
|
1307
|
+
- `max` — `Date` — Latest selectable time-of-day; options past it are disabled in the columns.
|
|
1308
|
+
- `minuteStep` — `number` · default `5` — Increment in minutes for the minute column, so 15 yields :00/:15/:30/:45 options.
|
|
1309
|
+
- `secondStep` — `number` · default `5` — Increment in seconds for the second column, used only when granularity is "second".
|
|
1310
|
+
- `granularity` — `"hour" | "minute" | "second"` · default `"minute"` — Which columns render: hour only, hour and minute, or down to seconds.
|
|
1311
|
+
- `hourCycle` — `12 | 24` · default `24` — Show 24-hour columns, or 12-hour columns with a dedicated AM/PM column.
|
|
1312
|
+
- `referenceDate` — `Date` · default `today` — Date whose year/month/day is used for the emitted Date when no value is set yet.
|
|
1313
|
+
- `disabled` — `boolean` · default `false` — Disables the control and prevents the time popover from opening.
|
|
1314
|
+
- `tone` — `"primary" | "success" | "warning" | "danger" | "info" | "neutral"` · default `"primary"` — Recolors the focus/open accent (border and ring) using one of six semantic intents.
|
|
1315
|
+
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Control height preset for aligning with other form fields in the same row.
|
|
1316
|
+
- `clearable` — `boolean` · default `true` — Shows a clear (×) button when a time is set, resetting the value to null.
|
|
1317
|
+
- `editable` — `boolean` · default `false` — Renders the trigger as a typeable text input with a trailing toggle for direct entry.
|
|
1318
|
+
- `parse` — `(text: string) => Date | null` — Parses typed text into a Date when editable; defaults to an HH:MM[:SS] am/pm matcher.
|
|
1319
|
+
- `format` — `(date: Date) => string` — Custom display formatter; defaults to a localized time honoring hourCycle and granularity.
|
|
1320
|
+
- `locale` — `string` — BCP-47 locale for time formatting via Intl; omit for the runtime default.
|
|
1321
|
+
- `onChange` — `(date: Date | null) => void` — Fires with the newly selected Date (or null when cleared) after each column pick.
|
|
1322
|
+
|
|
1323
|
+
```jsx
|
|
1324
|
+
import { TimePicker } from "twico-ui";
|
|
1325
|
+
|
|
1326
|
+
const [time, setTime] = useState(null);
|
|
1327
|
+
|
|
1328
|
+
<TimePicker
|
|
1329
|
+
label="Start time"
|
|
1330
|
+
value={time}
|
|
1331
|
+
onChange={setTime}
|
|
1332
|
+
minuteStep={15}
|
|
1333
|
+
/>
|
|
1334
|
+
```
|
|
1335
|
+
|
|
1171
1336
|
### Data display
|
|
1172
1337
|
|
|
1173
1338
|
#### Avatar
|
|
@@ -1183,6 +1348,8 @@ Props:
|
|
|
1183
1348
|
- `square` — `boolean` · default `false` — When true, renders the avatar as a rounded square instead of the default circle for a different visual style.
|
|
1184
1349
|
- `status` — `"online" | "busy" | "away" | "offline"` — Shows a small presence dot indicating online, busy, away, or offline state on the avatar.
|
|
1185
1350
|
- `ring` — `boolean` · default `false` — When true, adds a brand-colored ring around the avatar to emphasize or highlight the user.
|
|
1351
|
+
- `statusLabel` — `string` — Accessible text for the presence dot, folded into the avatar's spoken name (e.g. "Jane Doe, Online"). Defaults to a capitalized `status`.
|
|
1352
|
+
- `statusLabels` — `Partial<Record<"online" | "busy" | "away" | "offline", string>>` — Localized presence labels keyed by status value.
|
|
1186
1353
|
|
|
1187
1354
|
```jsx
|
|
1188
1355
|
import { Avatar } from "twico-ui";
|
|
@@ -1283,6 +1450,73 @@ import { Card } from "twico-ui";
|
|
|
1283
1450
|
</Card>
|
|
1284
1451
|
```
|
|
1285
1452
|
|
|
1453
|
+
#### CardGrid
|
|
1454
|
+
|
|
1455
|
+
CardGrid is the card analogue of Datatable's serverMode: it turns page, sort, filter, and search into a query and renders one card per row via a render prop, with built-in pagination, loading, and empty states. Client mode filters locally with Datatable's exact semantics; serverMode emits the query and consumes { rows, rowCount }.
|
|
1456
|
+
|
|
1457
|
+
`import { CardGrid } from "twico-ui"`
|
|
1458
|
+
|
|
1459
|
+
Props:
|
|
1460
|
+
- `rows` — `Row[]` · default `[]` — The rows: the full set in client mode, or the current page's rows in serverMode.
|
|
1461
|
+
- `renderCard` — `(row: Row, index: number) => React.ReactNode` · **required** — Render prop returning one card element per row; this is the only required prop.
|
|
1462
|
+
- `rowKey` — `string | ((row: Row) => React.Key)` · default `"id"` — Stable React key per row: a field name or an accessor function, defaulting to id.
|
|
1463
|
+
- `minChildWidth` — `string | number` · default `"18rem"` — Minimum card width for the responsive auto-fill grid (forwarded to Grid's minChildWidth).
|
|
1464
|
+
- `columns` — `number | Record<string, number>` — Fixed column count (a responsive object is allowed); overrides minChildWidth when set.
|
|
1465
|
+
- `gap` — `number | string` · default `4` — Gap between cards on the spacing token scale, forwarded to the underlying Grid.
|
|
1466
|
+
- `pageSize` — `number` · default `12` — Cards shown per page; set 0 to disable pagination and render every row.
|
|
1467
|
+
- `pageSizeOptions` — `number[]` · default `[12, 24, 48, 96]` — Choices offered by the footer's per-page selector.
|
|
1468
|
+
- `page` — `number` — Controlled 0-based page index; omit to let the grid manage its own page.
|
|
1469
|
+
- `defaultPage` — `number` · default `0` — Initial 0-based page when uncontrolled (no page prop).
|
|
1470
|
+
- `onPageChange` — `(page: number) => void` — Fires with the new 0-based page when the user navigates the pagination.
|
|
1471
|
+
- `onPageSizeChange` — `(pageSize: number) => void` — Fires with the new page size when the per-page selector changes (makes pageSize controlled).
|
|
1472
|
+
- `showPageSize` — `boolean` · default `true` — Render the per-page selector in the footer next to the pagination.
|
|
1473
|
+
- `serverMode` — `boolean` · default `false` — Emit a query and consume rows/rowCount/loading instead of filtering, sorting, and paging locally.
|
|
1474
|
+
- `rowCount` — `number` — Total number of rows, used to compute the page count in serverMode.
|
|
1475
|
+
- `loading` — `boolean` · default `false` — Show the loading overlay and dim the grid, typically while a serverMode fetch is in flight.
|
|
1476
|
+
- `onServerChange` — `(query: CardGridQuery) => void` — Called (debounced) with { page, pageSize, sort, filters, quickFilter } whenever the query changes.
|
|
1477
|
+
- `filters` — `CardGridFilter[]` · default `[]` — External filter clauses (e.g. from a FilterBar) applied in client mode or passed through in serverMode.
|
|
1478
|
+
- `quickFilter` — `string` — Controlled quick-search string; pair with onQuickFilterChange to own it in state.
|
|
1479
|
+
- `defaultQuickFilter` — `string` · default `""` — Initial quick-search string when uncontrolled.
|
|
1480
|
+
- `onQuickFilterChange` — `(value: string) => void` — Fires with the search text as the user types in the built-in search box.
|
|
1481
|
+
- `searchable` — `boolean` · default `false` — Render a built-in quick-search box in the toolbar row above the grid.
|
|
1482
|
+
- `searchFields` — `string[]` — Fields scanned by quick search in client mode; defaults to the first row's keys.
|
|
1483
|
+
- `searchPlaceholder` — `string` · default `"Search…"` — Placeholder text for the built-in search box.
|
|
1484
|
+
- `sort` — `CardGridSort | null` — Controlled sort clause { field, dir }; omit to let the grid manage its own sort.
|
|
1485
|
+
- `defaultSort` — `CardGridSort | null` · default `null` — Initial sort clause when uncontrolled.
|
|
1486
|
+
- `onSortChange` — `(sort: CardGridSort | null) => void` — Fires when the sort field or direction changes via the built-in sort control.
|
|
1487
|
+
- `sortOptions` — `CardGridSortOption[]` — Fields offered by the built-in sort control; providing it renders the control (declare type:"number" to sort numerically).
|
|
1488
|
+
- `toolbar` — `React.ReactNode` — Extra node rendered in the toolbar row, before the sort control.
|
|
1489
|
+
- `emptyState` — `React.ReactNode` · default `"No results."` — Content shown when there are no rows and the grid is not loading.
|
|
1490
|
+
- `label` — `React.ReactNode` — Optional heading rendered above the grid and associated with it for accessibility.
|
|
1491
|
+
|
|
1492
|
+
```jsx
|
|
1493
|
+
import { CardGrid, Card, Heading, Text } from "twico-ui";
|
|
1494
|
+
|
|
1495
|
+
const products = [
|
|
1496
|
+
{ id: 1, name: "Aurora Lamp", price: 89, category: "Lighting" },
|
|
1497
|
+
{ id: 2, name: "Nimbus Chair", price: 240, category: "Seating" },
|
|
1498
|
+
{ id: 3, name: "Vega Desk", price: 420, category: "Desks" },
|
|
1499
|
+
];
|
|
1500
|
+
|
|
1501
|
+
<CardGrid
|
|
1502
|
+
rows={products}
|
|
1503
|
+
rowKey="id"
|
|
1504
|
+
minChildWidth="16rem"
|
|
1505
|
+
pageSize={12}
|
|
1506
|
+
searchable
|
|
1507
|
+
sortOptions={[
|
|
1508
|
+
{ field: "name", label: "Name" },
|
|
1509
|
+
{ field: "price", label: "Price", type: "number" },
|
|
1510
|
+
]}
|
|
1511
|
+
renderCard={(p) => (
|
|
1512
|
+
<Card>
|
|
1513
|
+
<Heading level={4}>{p.name}</Heading>
|
|
1514
|
+
<Text tone="muted">{p.category} · ${p.price}</Text>
|
|
1515
|
+
</Card>
|
|
1516
|
+
)}
|
|
1517
|
+
/>
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1286
1520
|
#### Carousel
|
|
1287
1521
|
|
|
1288
1522
|
Carousel is a sliding one-slide-per-view component with prev/next arrows, dot indicators, optional looping, and optional autoplay that pauses on hover. Use it to showcase a sequence of images or content panels where each child is a single slide.
|
|
@@ -1299,6 +1533,10 @@ Props:
|
|
|
1299
1533
|
- `index` — `number` — Controlled active slide index — pair with onIndexChange.
|
|
1300
1534
|
- `defaultIndex` — `number` · default `0` — Initial slide index when uncontrolled.
|
|
1301
1535
|
- `onIndexChange` — `(index: number) => void` — Fired when the active slide changes (arrows, dots, or autoplay).
|
|
1536
|
+
- `showPauseButton` — `boolean` · default `true` — Show the pause/play toggle when `autoPlay` is on.
|
|
1537
|
+
- `label` — `string` — Accessible name for the carousel region. Falls back to `aria-label`, then `"Carousel"`.
|
|
1538
|
+
- `pauseLabel` — `string` · default `"Pause"` — Accessible label for the pause button (paused → shows the play label).
|
|
1539
|
+
- `playLabel` — `string` · default `"Play"` — Accessible label for the play button.
|
|
1302
1540
|
|
|
1303
1541
|
```jsx
|
|
1304
1542
|
import { Carousel } from "twico-ui";
|
|
@@ -1365,6 +1603,8 @@ Props:
|
|
|
1365
1603
|
- `virtualized` — `boolean` · default `false` — Opt into row virtualization (windowing). Active only when pagination is off (pageSize={0}) and row grouping is not active; otherwise ignored and the table renders normally. Pair with a fixed height. Selection/inline-edit keep working because they key off the row id, not the rendered index.
|
|
1366
1604
|
- `overscan` — `number` · default `8` — Extra rows rendered above and below the visible window for smoother fast scrolling when virtualized.
|
|
1367
1605
|
- `rowHeight` — `number` — Estimated/fixed row height in px used to compute the virtualization window. Set if rows have a custom height so the scrollbar stays accurate.
|
|
1606
|
+
- `rowNumbers` — `boolean` · default `false` — Render a leading auto-numbered row column (1, 2, 3…). The number reflects each row's position in the current sorted/filtered order and continues across pages (page 2 starts where page 1 ended; in server mode it uses the current page × pageSize). Sits after the checkbox column, sticky-left. This prop is the initial state — when enabled, users can hide/show the column from the toolbar's **Columns** panel ("Row number").
|
|
1607
|
+
- `searchFields` — `string[]` — Restrict the toolbar quick-search to these column `field`s (client mode); defaults to every visible column. Mirrors `runDatatableQuery`'s `options.searchFields`.
|
|
1368
1608
|
|
|
1369
1609
|
```jsx
|
|
1370
1610
|
import { useState } from "react";
|
|
@@ -1463,6 +1703,51 @@ export default function Example() {
|
|
|
1463
1703
|
}
|
|
1464
1704
|
```
|
|
1465
1705
|
|
|
1706
|
+
#### DiffTable
|
|
1707
|
+
|
|
1708
|
+
DiffTable compares two versions of a dataset: it pairs rows on a business key, classifies each added / removed / modified / moved, and renders modified rows as per-cell before → after (strikethrough old, accented new). It shows an op badge per row, a +N ~M -K summary, and an 'only changed' toggle.
|
|
1709
|
+
|
|
1710
|
+
`import { DiffTable } from "twico-ui"`
|
|
1711
|
+
|
|
1712
|
+
Props:
|
|
1713
|
+
- `from` — `Row[]` · default `[]` — The 'before' rows (version A) that the comparison pairs against `to`.
|
|
1714
|
+
- `to` — `Row[]` · default `[]` — The 'after' rows (version B) compared against `from`.
|
|
1715
|
+
- `rowKey` — `(row: Row) => React.Key` · default `row.id` — Stable business key used to pair a row in A with its counterpart in B; defaults to row.id.
|
|
1716
|
+
- `columns` — `DiffTableColumn[]` · default `[]` — Columns to compare and render: { field, headerName?, valueGetter?, valueFormatter?, compare? }.
|
|
1717
|
+
- `onlyChanged` — `boolean` · default `true` — Hide unchanged rows; this is the initial state of the 'only changed' toggle.
|
|
1718
|
+
- `showToggle` — `boolean` · default `true` — Render the 'only changed' checkbox that shows or hides unchanged rows.
|
|
1719
|
+
- `showSummary` — `boolean` · default `true` — Render the +added ~modified -removed summary badges above the table.
|
|
1720
|
+
- `moveDetection` — `boolean` · default `true` — Classify same-value rows whose position changed as 'moved', using a minimal LIS so only genuinely-reordered rows are flagged.
|
|
1721
|
+
- `compare` — `(a, b, field: string) => boolean` — Global equality override for all fields; falls back to === then a JSON comparison.
|
|
1722
|
+
- `emptyState` — `React.ReactNode` · default `"No differences."` — Content shown when there are no rows to display (e.g. identical inputs with onlyChanged).
|
|
1723
|
+
- `toggleLabel` — `React.ReactNode` · default `"Only changed"` — Label for the 'only changed' toggle.
|
|
1724
|
+
- `label` — `React.ReactNode` — Optional heading rendered above the table.
|
|
1725
|
+
|
|
1726
|
+
```jsx
|
|
1727
|
+
import { DiffTable } from "twico-ui";
|
|
1728
|
+
|
|
1729
|
+
const before = [
|
|
1730
|
+
{ sku: "A1", name: "Alpha", color: "red", price: 10 },
|
|
1731
|
+
{ sku: "B2", name: "Beta", color: "blue", price: 20 },
|
|
1732
|
+
];
|
|
1733
|
+
const after = [
|
|
1734
|
+
{ sku: "A1", name: "Alpha", color: "crimson", price: 12 },
|
|
1735
|
+
{ sku: "C3", name: "Gamma", color: "green", price: 30 },
|
|
1736
|
+
];
|
|
1737
|
+
|
|
1738
|
+
<DiffTable
|
|
1739
|
+
from={before}
|
|
1740
|
+
to={after}
|
|
1741
|
+
rowKey={(r) => r.sku}
|
|
1742
|
+
columns={[
|
|
1743
|
+
{ field: "name", headerName: "Name" },
|
|
1744
|
+
{ field: "color", headerName: "Color" },
|
|
1745
|
+
{ field: "price", headerName: "Price", valueFormatter: (v) => `$${v}` },
|
|
1746
|
+
]}
|
|
1747
|
+
onlyChanged
|
|
1748
|
+
/>
|
|
1749
|
+
```
|
|
1750
|
+
|
|
1466
1751
|
#### Kanban
|
|
1467
1752
|
|
|
1468
1753
|
Kanban is a drag-and-drop board that arranges cards into columns you can drag between. Use it for visualizing and reorganizing work items (tasks, tickets, stages) by status, either controlled via cards + onCardMove or uncontrolled.
|
|
@@ -1475,6 +1760,7 @@ Props:
|
|
|
1475
1760
|
- `onCardMove` — `(cardId: string, toColumn: string, nextCards: KanbanCard[]) => void` — Fires when a card is dropped into a different column, passing the card id, target column, and updated card list.
|
|
1476
1761
|
- `renderCard` — `(card: KanbanCard) => React.ReactNode` — Overrides the default card contents with a custom renderer, falling back to title, description, tags, and footer.
|
|
1477
1762
|
- `defaultCards` — `KanbanCard[]` · default `[]` — Initial cards when uncontrolled (the board applies moves internally).
|
|
1763
|
+
- `getCardLabel` — `(card: KanbanCard) => string` — Accessible name for each card — supply this when `renderCard` produces graphical/icon-only content; falls back to a string title or "Card".
|
|
1478
1764
|
|
|
1479
1765
|
```jsx
|
|
1480
1766
|
import { Kanban } from "twico-ui";
|
|
@@ -1645,6 +1931,7 @@ Props:
|
|
|
1645
1931
|
- `tone` — `"neutral" | "primary" | "success" | "warning" | "danger" | "info"` · default `"neutral"` — Sets the semantic color from six options like success or danger; defaults to neutral (the classic chip).
|
|
1646
1932
|
- `leftIcon` — `React.ReactNode` — Renders an optional leading icon before the label, useful for signaling the tag's category or status.
|
|
1647
1933
|
- `children` — `React.ReactNode` — Provides the tag's label content, typically the filter name, selected item, or keyword being displayed.
|
|
1934
|
+
- `removeLabel` — `string` — Accessible label for the remove (×) button. Defaults to `Remove {children}` when children is a string, else "Remove".
|
|
1648
1935
|
|
|
1649
1936
|
```jsx
|
|
1650
1937
|
import { Tag } from "twico-ui";
|
|
@@ -1807,6 +2094,13 @@ Props:
|
|
|
1807
2094
|
- `crosshair` — `boolean` · default `true` — Show a vertical crosshair guide line at the hovered category on line/area/vertical-bar charts.
|
|
1808
2095
|
- `zoomable` — `boolean` · default `false` — Enable drag-to-zoom plus shift-drag pan, mouse-wheel zoom, and a reset button over the chart.
|
|
1809
2096
|
- `ariaLabel` — `string` — Accessible name for the chart's <svg role="img">; defaults to a description of the chart type.
|
|
2097
|
+
- `stacked` — `boolean` · default `false` — Stack multi-series bars/areas instead of grouping them side by side.
|
|
2098
|
+
- `horizontal` — `boolean` · default `false` — Render bars horizontally (value axis along the bottom). Ignored for line/area.
|
|
2099
|
+
- `curve` — `"straight" | "smooth" | "stepped"` · default `"straight"` — Line/area interpolation.
|
|
2100
|
+
- `smooth` — `boolean` · default `false` — Shorthand for `curve="smooth"`.
|
|
2101
|
+
- `showDots` — `boolean` · default `true` — Show point markers on line charts.
|
|
2102
|
+
- `tableFallback` — `boolean` · default `true` — Render a visually-hidden data table as an accessible text alternative (WCAG 1.1.1).
|
|
2103
|
+
- `caption` — `React.ReactNode` — Caption for the hidden data table; defaults to the chart's accessible label.
|
|
1810
2104
|
|
|
1811
2105
|
```jsx
|
|
1812
2106
|
import { Chart } from "twico-ui";
|
|
@@ -2265,6 +2559,7 @@ Props:
|
|
|
2265
2559
|
- `defaultOpen` — `string[]` · default `[]` — The list of item values that should start expanded on first render, useful for surfacing key sections by default.
|
|
2266
2560
|
- `open` — `string[]` — Controlled open panel values; pair with onOpenChange. When set, internal state is bypassed and defaultOpen is ignored.
|
|
2267
2561
|
- `onOpenChange` — `(values: string[]) => void` — Called with the next open values whenever a panel trigger is toggled (fires in both controlled and uncontrolled modes).
|
|
2562
|
+
- `headingLevel` — `1 | 2 | 3 | 4 | 5 | 6` · default `3` — Heading level wrapping each trigger button (document-outline semantics).
|
|
2268
2563
|
|
|
2269
2564
|
```jsx
|
|
2270
2565
|
import { Accordion } from "twico-ui";
|
|
@@ -2325,6 +2620,11 @@ Props:
|
|
|
2325
2620
|
- `actions` — `React.ReactNode` — Right-aligned content such as buttons, a search field, or an avatar for account and primary actions.
|
|
2326
2621
|
- `sticky` — `boolean` · default `true` — Pins the navbar to the top of the viewport with a translucent blur as the page scrolls; on by default.
|
|
2327
2622
|
- `onMenuClick` — `() => void` — Fires when the hamburger button (shown only on small screens) is clicked, typically to open a mobile drawer.
|
|
2623
|
+
- `brandHref` — `string` — If set, the brand becomes a link to this URL (sanitized). Otherwise the brand is a plain, non-navigating element unless `onBrandClick` is given.
|
|
2624
|
+
- `onBrandClick` — `(e: React.MouseEvent<HTMLButtonElement>) => void` — Click handler for the brand; renders it as a button when `brandHref` is not set.
|
|
2625
|
+
- `menuOpen` — `boolean` — Drives the hamburger's `aria-expanded` and its "Open menu"/"Close menu" accessible name.
|
|
2626
|
+
- `menuControls` — `string` — Id of the menu/drawer the hamburger controls (`aria-controls`).
|
|
2627
|
+
- `navLabel` — `string` · default `"Primary"` — Accessible name for the links `<nav>` landmark.
|
|
2328
2628
|
|
|
2329
2629
|
```jsx
|
|
2330
2630
|
import { Navbar } from "twico-ui";
|
|
@@ -2498,6 +2798,7 @@ Props:
|
|
|
2498
2798
|
- `commands` — `Command[]` · **required** — The list of Command objects to search, group, and render, each typically defining a label, action, and optional group.
|
|
2499
2799
|
- `placeholder` — `string` · default `"Type a command or search…"` — Sets the search input's placeholder text, defaulting to "Type a command or search…" to hint at the expected query.
|
|
2500
2800
|
- `emptyText` — `string` · default `"No results found"` — The message shown when no command matches the current query, defaulting to "No results found".
|
|
2801
|
+
- `searchLabel` — `string` · default `"Command palette search"` — Accessible name for the search input.
|
|
2501
2802
|
- `onClick` — `() => void` — Alias for onSelect, matching the other item-array APIs (Menu, List, Sidebar, ...) — used when onSelect is absent; palette closes after it runs.
|
|
2502
2803
|
|
|
2503
2804
|
```jsx
|
|
@@ -2694,6 +2995,8 @@ Props:
|
|
|
2694
2995
|
- `icon` — `React.ReactNode` — Overrides the default tone icon with your own node when you need a more specific or branded visual cue.
|
|
2695
2996
|
- `onClose` — `() => void` — When provided, shows a dismiss button and runs this callback so the alert can be closed by the user.
|
|
2696
2997
|
- `children` — `React.ReactNode` — The main body content of the alert, typically the descriptive message shown beneath the optional title.
|
|
2998
|
+
- `live` — `"assertive" | "polite" | "off"` · default `tone-aware` — Live-region politeness. Tone-aware default: danger/warning → `"assertive"` (role="alert"), success/info → `"polite"` (role="status"), primary/neutral → `"off"` (no live region, for static banners). Set explicitly to override.
|
|
2999
|
+
- `closeLabel` — `string` · default `"Dismiss"` — Accessible label for the dismiss button (shown only when `onClose` is set).
|
|
2697
3000
|
|
|
2698
3001
|
```jsx
|
|
2699
3002
|
import { Alert } from "twico-ui";
|
|
@@ -2745,6 +3048,7 @@ Props:
|
|
|
2745
3048
|
- `size` — `"sm" | "md" | "lg"` · default `"md"` — Thickness of the bar, sm, md, or lg, to match the visual weight of the surrounding content.
|
|
2746
3049
|
- `indeterminate` — `boolean` · default `false` — Switches to a continuously animated bar that ignores value, signaling work of unknown duration.
|
|
2747
3050
|
- `showLabel` — `boolean` · default `false` — Displays a percentage label above the bar so users can read the exact completion at a glance.
|
|
3051
|
+
- `label` — `React.ReactNode` · default `"Progress"` — Visible label in the meta row that also names the progressbar (via `aria-labelledby`).
|
|
2748
3052
|
|
|
2749
3053
|
```jsx
|
|
2750
3054
|
import { Progress } from "twico-ui";
|
|
@@ -2766,6 +3070,7 @@ Props:
|
|
|
2766
3070
|
- `width` — `string | number` — Sets the placeholder width as a CSS string or number, such as "120px" or 60, to match expected content.
|
|
2767
3071
|
- `height` — `string | number` — Sets the placeholder height as a CSS string or number to reserve the vertical space the real content will occupy.
|
|
2768
3072
|
- `lines` — `number` · default `1` — For the text variant, the number of lines to render, defaulting to 1, with the last line shortened for realism.
|
|
3073
|
+
- `label` — `string` — When set, announces loading via `role="status"` + `aria-live="polite"` + `aria-busy="true"` plus visually-hidden text (e.g. "Loading…"); otherwise the placeholder is `aria-hidden="true"`.
|
|
2769
3074
|
|
|
2770
3075
|
```jsx
|
|
2771
3076
|
import { Skeleton } from "twico-ui";
|
|
@@ -2783,9 +3088,9 @@ An indeterminate loading spinner that signals an ongoing background operation. U
|
|
|
2783
3088
|
|
|
2784
3089
|
Props:
|
|
2785
3090
|
- `size` — `"sm" | "md" | "lg" | "xl"` · default `"md"` — Sets the spinner diameter (sm, md, lg, or xl) so it fits its context, from inside a button to over a panel.
|
|
2786
|
-
- `tone` — `"current" | "primary" | "success" | "warning" | "danger" | "info" | "neutral" | "white"` · default `"current"` —
|
|
3091
|
+
- `tone` — `"current" | "primary" | "success" | "warning" | "danger" | "info" | "neutral" | "white"` · default `"current"` — Colour intent; defaults to currentColor so it adapts inside buttons and themed contexts. Wins over the deprecated color.
|
|
2787
3092
|
- `label` — `string` · default `"Loading"` — Accessible name exposed via aria-label so screen readers announce the loading state, defaulting to "Loading".
|
|
2788
|
-
- `color` — `"current" | "primary" | "success" | "warning" | "danger" | "info" | "neutral" | "white"` · default `"current"` —
|
|
3093
|
+
- `color` — `"current" | "primary" | "success" | "warning" | "danger" | "info" | "neutral" | "white"` · default `"current"` — Deprecated alias for tone (removed in 2.0) — use tone, which matches every other tone-driven component.
|
|
2789
3094
|
|
|
2790
3095
|
```jsx
|
|
2791
3096
|
import { Spinner } from "twico-ui";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twico-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Twico UI — a free, modern, themeable React + Tailwind-friendly component library. 61 components with dark mode, motion, and accessibility built in.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Twico UI",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"prepublishOnly": "npm run build:css && npm run gen:llms && npm run build"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
+
"lucide-react": ">=0.300.0",
|
|
95
96
|
"react": ">=18",
|
|
96
|
-
"react-dom": ">=18"
|
|
97
|
-
"lucide-react": ">=0.300.0"
|
|
97
|
+
"react-dom": ">=18"
|
|
98
98
|
},
|
|
99
99
|
"peerDependenciesMeta": {
|
|
100
100
|
"lucide-react": {
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"esbuild": "^0.28.1"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
108
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
109
109
|
"@semantic-release/changelog": "^6.0.3",
|
|
110
110
|
"@semantic-release/git": "^10.0.1",
|
|
111
111
|
"@size-limit/preset-small-lib": "^12.1.0",
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"@types/react": "^19.2.17",
|
|
116
116
|
"@types/react-dom": "^19.2.3",
|
|
117
117
|
"jsdom": "^29.1.1",
|
|
118
|
-
"lucide-react": "^1.
|
|
118
|
+
"lucide-react": "^1.24.0",
|
|
119
119
|
"semantic-release": "^25.0.5",
|
|
120
120
|
"size-limit": "^12.1.0",
|
|
121
121
|
"tsup": "^8.3.5",
|
|
122
122
|
"typescript": "^5.9.3",
|
|
123
|
-
"vitest": "^4.1.
|
|
123
|
+
"vitest": "^4.1.10"
|
|
124
124
|
},
|
|
125
125
|
"size-limit": [
|
|
126
126
|
{
|