@jcsoftdev/ui 0.3.0 → 0.5.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 +200 -1
- package/README.md +56 -3
- package/bin/ui-theme.mjs +13 -2
- package/dist/atoms/button/button.d.ts +8 -1
- package/dist/atoms/button/button.js +10 -3
- package/dist/atoms/checkbox/checkbox.js +3 -1
- package/dist/atoms/chip/chip.d.ts +11 -3
- package/dist/atoms/chip/chip.js +8 -1
- package/dist/atoms/chip/index.d.ts +1 -1
- package/dist/atoms/chip/index.js +2 -0
- package/dist/atoms/divider/divider.d.ts +15 -0
- package/dist/atoms/divider/divider.js +27 -0
- package/dist/atoms/divider/index.d.ts +1 -0
- package/dist/atoms/divider/index.js +1 -0
- package/dist/atoms/due-chip/due-chip.d.ts +31 -0
- package/dist/atoms/due-chip/due-chip.js +41 -0
- package/dist/atoms/due-chip/index.d.ts +2 -0
- package/dist/atoms/due-chip/index.js +6 -0
- package/dist/atoms/due-chip/model.d.ts +25 -0
- package/dist/atoms/due-chip/model.js +44 -0
- package/dist/atoms/icon-button/icon-button.d.ts +22 -0
- package/dist/atoms/icon-button/icon-button.js +38 -0
- package/dist/atoms/icon-button/index.d.ts +1 -0
- package/dist/atoms/icon-button/index.js +8 -0
- package/dist/atoms/index.d.ts +6 -0
- package/dist/atoms/index.js +6 -0
- package/dist/atoms/internal/hit-area.d.ts +6 -0
- package/dist/atoms/internal/hit-area.js +4 -0
- package/dist/atoms/kbd/index.d.ts +1 -0
- package/dist/atoms/kbd/index.js +4 -0
- package/dist/atoms/kbd/kbd.d.ts +7 -0
- package/dist/atoms/kbd/kbd.js +17 -0
- package/dist/atoms/radio-group/radio-group.js +6 -2
- package/dist/atoms/seal/index.d.ts +1 -0
- package/dist/atoms/seal/index.js +4 -0
- package/dist/atoms/seal/seal.d.ts +30 -0
- package/dist/atoms/seal/seal.js +71 -0
- package/dist/atoms/spinner/index.d.ts +1 -0
- package/dist/atoms/spinner/index.js +5 -0
- package/dist/atoms/spinner/spinner.d.ts +19 -0
- package/dist/atoms/spinner/spinner.js +31 -0
- package/dist/atoms/switch/switch.js +3 -1
- package/dist/auth/auth-illustration/auth-illustration.d.ts +35 -0
- package/dist/auth/auth-illustration/auth-illustration.js +72 -0
- package/dist/auth/auth-illustration/index.d.ts +3 -0
- package/dist/auth/auth-illustration/index.js +11 -0
- package/dist/auth/auth-illustration/look.d.ts +30 -0
- package/dist/auth/auth-illustration/look.js +0 -0
- package/dist/auth/auth-illustration/model.d.ts +133 -0
- package/dist/auth/auth-illustration/model.js +202 -0
- package/dist/auth/auth-illustration/use-art-pointer.d.ts +9 -0
- package/dist/auth/auth-illustration/use-art-pointer.js +69 -0
- package/dist/auth/auth-layout/auth-layout.d.ts +80 -0
- package/dist/auth/auth-layout/auth-layout.js +190 -0
- package/dist/auth/auth-layout/index.d.ts +1 -0
- package/dist/auth/auth-layout/index.js +1 -0
- package/dist/auth/character/character.d.ts +12 -0
- package/dist/auth/character/character.js +333 -0
- package/dist/auth/character/index.d.ts +1 -0
- package/dist/auth/character/index.js +1 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/internal/auth-context.d.ts +17 -0
- package/dist/auth/internal/auth-context.js +10 -0
- package/dist/auth/internal/auth-styles.d.ts +1 -0
- package/dist/auth/internal/auth-styles.js +29 -0
- package/dist/auth/internal/portal-glyphs.d.ts +6 -0
- package/dist/auth/internal/portal-glyphs.js +39 -0
- package/dist/auth/login-form/context.d.ts +51 -0
- package/dist/auth/login-form/context.js +12 -0
- package/dist/auth/login-form/index.d.ts +2 -0
- package/dist/auth/login-form/index.js +23 -0
- package/dist/auth/login-form/login-form.d.ts +66 -0
- package/dist/auth/login-form/login-form.js +233 -0
- package/dist/auth/login-form/parts.d.ts +71 -0
- package/dist/auth/login-form/parts.js +371 -0
- package/dist/auth/looks/auth-illustration-any.d.ts +16 -0
- package/dist/auth/looks/auth-illustration-any.js +24 -0
- package/dist/auth/looks/index.d.ts +1 -0
- package/dist/auth/looks/index.js +1 -0
- package/dist/auth/mosaic/index.d.ts +1 -0
- package/dist/auth/mosaic/index.js +1 -0
- package/dist/auth/mosaic/mosaic.d.ts +11 -0
- package/dist/auth/mosaic/mosaic.js +195 -0
- package/dist/auth/slabs/index.d.ts +1 -0
- package/dist/auth/slabs/index.js +1 -0
- package/dist/auth/slabs/slabs.d.ts +13 -0
- package/dist/auth/slabs/slabs.js +136 -0
- package/dist/auth/stack/index.d.ts +1 -0
- package/dist/auth/stack/index.js +1 -0
- package/dist/auth/stack/stack.d.ts +6 -0
- package/dist/auth/stack/stack.js +222 -0
- package/dist/auth/statement/index.d.ts +1 -0
- package/dist/auth/statement/index.js +1 -0
- package/dist/auth/statement/statement.d.ts +13 -0
- package/dist/auth/statement/statement.js +99 -0
- package/dist/calendar/date-calendar/date-calendar.d.ts +32 -0
- package/dist/calendar/date-calendar/date-calendar.js +189 -0
- package/dist/calendar/date-calendar/index.d.ts +1 -0
- package/dist/calendar/date-calendar/index.js +6 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +1 -0
- package/dist/calendar/internal/date-utils.d.ts +26 -0
- package/dist/calendar/internal/date-utils.js +95 -1
- package/dist/containers/aside/aside.d.ts +14 -0
- package/dist/containers/aside/aside.js +25 -0
- package/dist/containers/aside/index.d.ts +1 -0
- package/dist/containers/aside/index.js +5 -0
- package/dist/containers/banner/banner.d.ts +4 -1
- package/dist/containers/banner/banner.js +9 -1
- package/dist/containers/description-list/description-list.d.ts +29 -6
- package/dist/containers/description-list/description-list.js +47 -6
- package/dist/containers/feed/feed.d.ts +23 -0
- package/dist/containers/feed/feed.js +77 -0
- package/dist/containers/feed/index.d.ts +2 -0
- package/dist/containers/feed/index.js +10 -0
- package/dist/containers/feed/model.d.ts +19 -0
- package/dist/containers/feed/model.js +38 -0
- package/dist/containers/index.d.ts +6 -0
- package/dist/containers/index.js +6 -0
- package/dist/containers/kpi/kpi.d.ts +50 -8
- package/dist/containers/kpi/kpi.js +91 -39
- package/dist/containers/list-detail/index.d.ts +1 -0
- package/dist/containers/list-detail/index.js +20 -0
- package/dist/containers/list-detail/list-detail.d.ts +55 -0
- package/dist/containers/list-detail/list-detail.js +221 -0
- package/dist/containers/note/index.d.ts +1 -0
- package/dist/containers/note/index.js +4 -0
- package/dist/containers/note/note.d.ts +13 -0
- package/dist/containers/note/note.js +27 -0
- package/dist/containers/section/index.d.ts +1 -0
- package/dist/containers/section/index.js +6 -0
- package/dist/containers/section/section.d.ts +68 -0
- package/dist/containers/section/section.js +198 -0
- package/dist/containers/shortcuts/index.d.ts +1 -0
- package/dist/containers/shortcuts/index.js +8 -0
- package/dist/containers/shortcuts/shortcuts.d.ts +18 -0
- package/dist/containers/shortcuts/shortcuts.js +50 -0
- package/dist/containers/table/selection.d.ts +9 -0
- package/dist/containers/table/selection.js +20 -0
- package/dist/containers/table/table.d.ts +66 -4
- package/dist/containers/table/table.js +128 -7
- package/dist/containers/timeline/index.d.ts +1 -1
- package/dist/containers/timeline/index.js +4 -2
- package/dist/containers/timeline/timeline.d.ts +32 -5
- package/dist/containers/timeline/timeline.js +154 -90
- package/dist/forms/chip-group/chip-group.d.ts +54 -0
- package/dist/forms/chip-group/chip-group.js +114 -0
- package/dist/forms/chip-group/index.d.ts +1 -0
- package/dist/forms/chip-group/index.js +6 -0
- package/dist/forms/combobox/combobox.d.ts +60 -0
- package/dist/forms/combobox/combobox.js +281 -0
- package/dist/forms/combobox/index.d.ts +1 -0
- package/dist/forms/combobox/index.js +6 -0
- package/dist/forms/date-picker/date-picker.d.ts +40 -0
- package/dist/forms/date-picker/date-picker.js +183 -0
- package/dist/forms/date-picker/date-time-picker.d.ts +43 -0
- package/dist/forms/date-picker/date-time-picker.js +121 -0
- package/dist/forms/date-picker/index.d.ts +2 -0
- package/dist/forms/date-picker/index.js +10 -0
- package/dist/forms/date-picker/model.d.ts +35 -0
- package/dist/forms/date-picker/model.js +83 -0
- package/dist/forms/dropzone/dropzone.d.ts +30 -2
- package/dist/forms/dropzone/dropzone.js +153 -23
- package/dist/forms/field/field.d.ts +16 -10
- package/dist/forms/field/field.js +41 -5
- package/dist/forms/index.d.ts +5 -0
- package/dist/forms/index.js +5 -0
- package/dist/forms/input/index.d.ts +1 -1
- package/dist/forms/input/index.js +4 -1
- package/dist/forms/input/input.d.ts +21 -5
- package/dist/forms/input/input.js +75 -9
- package/dist/forms/input-icon/input-icon.d.ts +1 -1
- package/dist/forms/internal/listbox-items.d.ts +18 -0
- package/dist/forms/internal/listbox-items.js +88 -0
- package/dist/forms/internal/listbox.d.ts +44 -0
- package/dist/forms/internal/listbox.js +74 -0
- package/dist/forms/number-stepper/model.d.ts +16 -0
- package/dist/forms/number-stepper/model.js +23 -0
- package/dist/forms/number-stepper/number-stepper.d.ts +36 -6
- package/dist/forms/number-stepper/number-stepper.js +86 -37
- package/dist/forms/password-input/index.d.ts +1 -0
- package/dist/forms/password-input/index.js +1 -0
- package/dist/forms/password-input/password-input.d.ts +16 -0
- package/dist/forms/password-input/password-input.js +45 -0
- package/dist/forms/select-menu/index.d.ts +1 -0
- package/dist/forms/select-menu/index.js +6 -0
- package/dist/forms/select-menu/select-menu.d.ts +35 -0
- package/dist/forms/select-menu/select-menu.js +230 -0
- package/dist/i18n/strings.d.ts +153 -0
- package/dist/i18n/strings.js +86 -2
- package/dist/i18n/ui-strings-provider.d.ts +1 -1
- package/dist/i18n/ui-strings-provider.js +6 -2
- package/dist/icons/eye.d.ts +2 -0
- package/dist/icons/eye.js +11 -0
- package/dist/icons/graduation-cap.d.ts +2 -0
- package/dist/icons/graduation-cap.js +12 -0
- package/dist/icons/house.d.ts +2 -0
- package/dist/icons/house.js +11 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +8 -0
- package/dist/icons/mail.d.ts +2 -0
- package/dist/icons/mail.js +11 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/stepper/index.d.ts +1 -1
- package/dist/navigation/stepper/index.js +3 -1
- package/dist/navigation/stepper/stepper.d.ts +8 -0
- package/dist/navigation/stepper/stepper.js +68 -45
- package/dist/navigation/tabs/index.d.ts +1 -0
- package/dist/navigation/tabs/index.js +6 -0
- package/dist/navigation/tabs/tabs-nav.d.ts +37 -0
- package/dist/navigation/tabs/tabs-nav.js +57 -0
- package/dist/navigation/wizard/index.d.ts +1 -0
- package/dist/navigation/wizard/index.js +6 -0
- package/dist/navigation/wizard/model.d.ts +33 -0
- package/dist/navigation/wizard/model.js +34 -0
- package/dist/navigation/wizard/wizard.d.ts +45 -0
- package/dist/navigation/wizard/wizard.js +169 -0
- package/dist/overlays/alert-dialog/alert-dialog.d.ts +103 -0
- package/dist/overlays/alert-dialog/alert-dialog.js +342 -0
- package/dist/overlays/alert-dialog/index.d.ts +1 -0
- package/dist/overlays/alert-dialog/index.js +26 -0
- package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +17 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.js +12 -4
- package/dist/overlays/dropdown-menu/index.d.ts +1 -1
- package/dist/overlays/dropdown-menu/index.js +8 -2
- package/dist/overlays/index.d.ts +2 -0
- package/dist/overlays/index.js +2 -0
- package/dist/overlays/testing/index.d.ts +5 -0
- package/dist/overlays/testing/index.js +4 -0
- package/dist/overlays/toaster/index.d.ts +2 -1
- package/dist/overlays/toaster/index.js +4 -2
- package/dist/overlays/toaster/toast-store.d.ts +6 -2
- package/dist/overlays/toaster/toast.d.ts +3 -0
- package/dist/overlays/toaster/toast.js +3 -0
- package/dist/overlays/toaster/toaster.d.ts +3 -0
- package/dist/overlays/toaster/toaster.js +36 -3
- package/dist/overlays/tooltip/index.d.ts +1 -0
- package/dist/overlays/tooltip/index.js +4 -0
- package/dist/overlays/tooltip/model.d.ts +10 -0
- package/dist/overlays/tooltip/model.js +13 -0
- package/dist/overlays/tooltip/tooltip.d.ts +41 -0
- package/dist/overlays/tooltip/tooltip.js +116 -0
- package/dist/primitives/use-dismissable-layer.js +1 -1
- package/dist/states/error-state/error-state.d.ts +6 -1
- package/dist/states/error-state/error-state.js +13 -9
- package/dist/states/skeleton/skeleton.d.ts +8 -2
- package/dist/states/skeleton/skeleton.js +44 -2
- package/icons/svg/eye.svg +4 -0
- package/icons/svg/graduation-cap.svg +5 -0
- package/icons/svg/house.svg +4 -0
- package/icons/svg/mail.svg +4 -0
- package/package.json +2 -2
- package/scripts/build-theme.mjs +12 -1
- package/src/atoms/button/button.tsx +25 -3
- package/src/atoms/checkbox/checkbox.tsx +3 -1
- package/src/atoms/chip/chip.tsx +18 -3
- package/src/atoms/chip/index.ts +2 -0
- package/src/atoms/divider/divider.tsx +40 -0
- package/src/atoms/divider/index.ts +1 -0
- package/src/atoms/due-chip/due-chip.tsx +75 -0
- package/src/atoms/due-chip/index.ts +2 -0
- package/src/atoms/due-chip/model.ts +67 -0
- package/src/atoms/icon-button/icon-button.tsx +58 -0
- package/src/atoms/icon-button/index.ts +6 -0
- package/src/atoms/index.ts +6 -0
- package/src/atoms/internal/hit-area.ts +7 -0
- package/src/atoms/kbd/index.ts +1 -0
- package/src/atoms/kbd/kbd.tsx +20 -0
- package/src/atoms/radio-group/radio-group.tsx +8 -2
- package/src/atoms/seal/index.ts +1 -0
- package/src/atoms/seal/seal.tsx +107 -0
- package/src/atoms/spinner/index.ts +1 -0
- package/src/atoms/spinner/spinner.tsx +49 -0
- package/src/atoms/switch/switch.tsx +3 -1
- package/src/auth/auth-illustration/auth-illustration.tsx +100 -0
- package/src/auth/auth-illustration/index.ts +8 -0
- package/src/auth/auth-illustration/look.ts +32 -0
- package/src/auth/auth-illustration/model.ts +330 -0
- package/src/auth/auth-illustration/use-art-pointer.ts +78 -0
- package/src/auth/auth-layout/auth-layout.tsx +282 -0
- package/src/auth/auth-layout/index.ts +1 -0
- package/src/auth/character/character.tsx +346 -0
- package/src/auth/character/index.ts +1 -0
- package/src/auth/index.ts +4 -0
- package/src/auth/internal/auth-context.ts +26 -0
- package/src/auth/internal/auth-styles.tsx +39 -0
- package/src/auth/internal/portal-glyphs.tsx +32 -0
- package/src/auth/login-form/context.ts +78 -0
- package/src/auth/login-form/index.ts +21 -0
- package/src/auth/login-form/login-form.tsx +330 -0
- package/src/auth/login-form/parts.tsx +457 -0
- package/src/auth/looks/auth-illustration-any.tsx +38 -0
- package/src/auth/looks/index.ts +1 -0
- package/src/auth/mosaic/index.ts +1 -0
- package/src/auth/mosaic/mosaic.tsx +255 -0
- package/src/auth/slabs/index.ts +1 -0
- package/src/auth/slabs/slabs.tsx +181 -0
- package/src/auth/stack/index.ts +1 -0
- package/src/auth/stack/stack.tsx +267 -0
- package/src/auth/statement/index.ts +1 -0
- package/src/auth/statement/statement.tsx +122 -0
- package/src/calendar/date-calendar/date-calendar.tsx +230 -0
- package/src/calendar/date-calendar/index.ts +5 -0
- package/src/calendar/index.ts +1 -0
- package/src/calendar/internal/date-utils.ts +115 -0
- package/src/containers/aside/aside.tsx +40 -0
- package/src/containers/aside/index.ts +1 -0
- package/src/containers/banner/banner.tsx +18 -1
- package/src/containers/description-list/description-list.tsx +85 -9
- package/src/containers/feed/feed.tsx +99 -0
- package/src/containers/feed/index.ts +8 -0
- package/src/containers/feed/model.ts +54 -0
- package/src/containers/index.ts +6 -0
- package/src/containers/kpi/kpi.tsx +161 -62
- package/src/containers/list-detail/index.ts +15 -0
- package/src/containers/list-detail/list-detail.tsx +293 -0
- package/src/containers/note/index.ts +1 -0
- package/src/containers/note/note.tsx +38 -0
- package/src/containers/section/index.ts +11 -0
- package/src/containers/section/section.tsx +281 -0
- package/src/containers/shortcuts/index.ts +6 -0
- package/src/containers/shortcuts/shortcuts.tsx +92 -0
- package/src/containers/table/selection.ts +26 -0
- package/src/containers/table/table.tsx +215 -13
- package/src/containers/timeline/index.ts +3 -0
- package/src/containers/timeline/timeline.tsx +204 -93
- package/src/forms/chip-group/chip-group.tsx +184 -0
- package/src/forms/chip-group/index.ts +8 -0
- package/src/forms/combobox/combobox.tsx +359 -0
- package/src/forms/combobox/index.ts +7 -0
- package/src/forms/date-picker/date-picker.tsx +239 -0
- package/src/forms/date-picker/date-time-picker.tsx +178 -0
- package/src/forms/date-picker/index.ts +10 -0
- package/src/forms/date-picker/model.ts +108 -0
- package/src/forms/dropzone/dropzone.tsx +217 -35
- package/src/forms/field/field.tsx +72 -7
- package/src/forms/index.ts +5 -0
- package/src/forms/input/index.ts +8 -1
- package/src/forms/input/input.tsx +99 -12
- package/src/forms/input-icon/input-icon.tsx +1 -1
- package/src/forms/internal/listbox-items.tsx +103 -0
- package/src/forms/internal/listbox.ts +124 -0
- package/src/forms/number-stepper/model.ts +35 -0
- package/src/forms/number-stepper/number-stepper.tsx +132 -42
- package/src/forms/password-input/index.ts +1 -0
- package/src/forms/password-input/password-input.tsx +57 -0
- package/src/forms/select-menu/index.ts +7 -0
- package/src/forms/select-menu/select-menu.tsx +280 -0
- package/src/i18n/strings.ts +153 -0
- package/src/i18n/ui-strings-provider.tsx +15 -4
- package/src/icons/eye.tsx +12 -0
- package/src/icons/graduation-cap.tsx +13 -0
- package/src/icons/house.tsx +12 -0
- package/src/icons/index.ts +4 -0
- package/src/icons/mail.tsx +12 -0
- package/src/navigation/index.ts +1 -0
- package/src/navigation/stepper/index.ts +7 -1
- package/src/navigation/stepper/stepper.tsx +41 -5
- package/src/navigation/tabs/index.ts +7 -0
- package/src/navigation/tabs/tabs-nav.tsx +131 -0
- package/src/navigation/wizard/index.ts +7 -0
- package/src/navigation/wizard/model.ts +61 -0
- package/src/navigation/wizard/wizard.tsx +222 -0
- package/src/overlays/alert-dialog/alert-dialog.tsx +486 -0
- package/src/overlays/alert-dialog/index.ts +19 -0
- package/src/overlays/dropdown-menu/dropdown-menu.tsx +29 -4
- package/src/overlays/dropdown-menu/index.ts +3 -0
- package/src/overlays/index.ts +2 -0
- package/src/overlays/testing/index.ts +5 -0
- package/src/overlays/toaster/index.ts +2 -0
- package/src/overlays/toaster/toast-store.ts +6 -2
- package/src/overlays/toaster/toast.ts +6 -0
- package/src/overlays/toaster/toaster.tsx +44 -2
- package/src/overlays/tooltip/index.ts +1 -0
- package/src/overlays/tooltip/model.ts +18 -0
- package/src/overlays/tooltip/tooltip.tsx +166 -0
- package/src/primitives/use-dismissable-layer.ts +7 -2
- package/src/states/error-state/error-state.tsx +19 -8
- package/src/states/skeleton/skeleton.tsx +68 -2
- package/styles/tailwind.css +33 -30
- package/styles/theme.css +33 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,205 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.5.0 (2026-10-23)
|
|
4
|
+
|
|
5
|
+
### Busy buttons keep focus (behavior to check when upgrading)
|
|
6
|
+
|
|
7
|
+
- **`Button` and `IconButton` `loading`** no longer set the native `disabled` attribute. A busy
|
|
8
|
+
button stays focusable, so pressing it from the keyboard leaves focus on it instead of dropping
|
|
9
|
+
to `body`. It is exposed as `aria-disabled="true"` plus `aria-busy="true"` (the status region
|
|
10
|
+
still announces the loading text), it ignores clicks, Enter and Space, and a `type="submit"`
|
|
11
|
+
button does not submit its form, including the implicit submit from Enter in one of its fields.
|
|
12
|
+
The dimmed `disabled` look no longer applies while loading; the spinner or loading label stays
|
|
13
|
+
and the cursor turns to `progress` (a button with neither a `loadingLabel` nor a spinner child
|
|
14
|
+
shows no other visible change, so give it one). Passing `disabled` keeps the native attribute and the dimmed
|
|
15
|
+
look as before, also while loading. Check code that read `button.disabled` or tests that expect
|
|
16
|
+
`toBeDisabled()` on a loading button: they now see `aria-disabled` instead.
|
|
17
|
+
|
|
18
|
+
### Sign-in screen
|
|
19
|
+
|
|
20
|
+
New `@jcsoftdev/ui/auth` entry, additive and source compatible. Colors come only from the theme
|
|
21
|
+
tokens, so dark mode and every `data-accent` apply without extra code. Guide: `/docs/auth/`.
|
|
22
|
+
|
|
23
|
+
#### Added
|
|
24
|
+
|
|
25
|
+
- **Auth.** `AuthLayout` (`layout` `split`, `split-reverse`, `centered`, driven by its own container
|
|
26
|
+
width; parts `.Brand`, `.Art`, `.Panel`, `.Footer`; controlled or uncontrolled `state`,
|
|
27
|
+
`progress` and `activeIndex`; `useAuthLayout`), `AuthIllustration` (isometric portal slabs that
|
|
28
|
+
react to `state`, `progress` and `activeIndex` with CSS only; under reduced motion each state
|
|
29
|
+
keeps its pose without moving) and `LoginForm` (parts `.Header`, `.Portals`, `.Identifier`, `.Password`, `.Error`,
|
|
30
|
+
`.Submit`, `.Footer`; async `onSubmit`, `loading`, `error`, `success`; drives the surrounding
|
|
31
|
+
layout and works standalone). A field left empty is reported under that field; a failed sign-in
|
|
32
|
+
shows as a callout from `.Error`, placed above the fields in the default composition.
|
|
33
|
+
- **Auth compositions.** `AuthLayout` `panel` (`paper`, `solid`: a solid themed side panel with an
|
|
34
|
+
open form on the other side), `LoginForm` `appearance` (`card`, `open`), `LoginForm.Options`
|
|
35
|
+
(remember me, reported as `remember`, plus a help slot) and `LoginForm.Providers` (a labelled slot,
|
|
36
|
+
no providers included), and `AuthIllustration` `look` as the plug-in point for further looks.
|
|
37
|
+
- **Illustration motion.** Pointer parallax (fine pointers only, one CSS variable write per
|
|
38
|
+
frame), a hop per keystroke, an overshooting entrance, a cheer and burst on success, and an
|
|
39
|
+
error that settles back to the password state after `ERROR_HOLD_MS` (1.1s). Only `transform`
|
|
40
|
+
and `opacity` animate; reduced motion jumps straight to each state's pose (spread at rest, flung
|
|
41
|
+
apart on an error, assembled with a still burst on success) and turns the parallax off, also when
|
|
42
|
+
the setting changes while the page is open.
|
|
43
|
+
- **`Stack` look (`@jcsoftdev/ui/auth/stack`).** A tower of books that gains a book as the form fills,
|
|
44
|
+
wobbles on an error and plants a flag with the active portal's glyph on success; 4, 5 or 6
|
|
45
|
+
books by the width of its container.
|
|
46
|
+
- **`Mosaic` look (`@jcsoftdev/ui/auth/mosaic`).** A floor of isometric tiles that lights diagonally with
|
|
47
|
+
progress, glints per keystroke, glows under the pointer, flashes red on an error and ripples on
|
|
48
|
+
success; three tiles carry the portal glyphs and the active one stands raised.
|
|
49
|
+
- **`Character` look (`@jcsoftdev/ui/auth/character`).** A student on a hover board that follows the
|
|
50
|
+
pointer, looks toward the form while it is typed into, covers their eyes for the password,
|
|
51
|
+
shakes their head on an error and hops with a boost on success.
|
|
52
|
+
- **`Statement` look (`@jcsoftdev/ui/auth/statement`).** Kinetic type: `headline` rises word by word, an
|
|
53
|
+
optional `caption` and `action`, and a pill that fills toward its arrow as a progress meter;
|
|
54
|
+
on success the headline gives way to the new UI string `signedIn` (default headline
|
|
55
|
+
`welcomeBack`). Not hidden from assistive technology. `AuthLayout.Art` forwards `headline`,
|
|
56
|
+
`caption` and `action`.
|
|
57
|
+
- **One entry per look.** `AuthIllustration` takes the look as a component (`look`, default `Slabs`),
|
|
58
|
+
and each look is its own subpath (`@jcsoftdev/ui/auth/slabs`, `stack`, `mosaic`, `character`,
|
|
59
|
+
`statement`), so an app bundles only the looks it renders; each look carries only its own CSS. A look
|
|
60
|
+
is any component typed `AuthLook`, with optional static `variant` (the `data-variant` value) and
|
|
61
|
+
`text` (not hidden from assistive technology). `AuthLayout.Art` takes `look` too.
|
|
62
|
+
`AuthIllustrationAny` (`@jcsoftdev/ui/auth/looks`) keeps the string `variant` and imports all five
|
|
63
|
+
looks on purpose. The `ui/auth` size budget drops back from 32300 to its default-entry weight.
|
|
64
|
+
- **`PasswordInput`** (reveal toggle with `aria-pressed`) and **`Divider`** (optional label).
|
|
65
|
+
- **Icons.** `Eye`, `Mail`, `House` and `GraduationCap`.
|
|
66
|
+
- **UI strings** (en/es) for the sign-in screen and `showPassword`.
|
|
67
|
+
|
|
68
|
+
#### Fixed
|
|
69
|
+
|
|
70
|
+
- **Portal tiles.** A `LoginForm.Portals` tile lifts on keyboard focus as it does on hover, and the
|
|
71
|
+
selected tile shows a check badge besides its colour change, so the choice does not rest on
|
|
72
|
+
colour alone. The badge is decorative; the radio's `aria-checked` still carries the state.
|
|
73
|
+
- **Primary button hover contrast.** On hover the primary `Button` and `IconButton` (and so
|
|
74
|
+
`LoginForm.Submit`) turn their text to `--surface` on the darker `--accent-ink` fill. The text
|
|
75
|
+
kept `--on-accent`, made for the pale `--accent`, and fell to 2.4:1 in light themes for six of the
|
|
76
|
+
seven accents; it is now 5.7:1 or more in every accent, light and dark.
|
|
77
|
+
- **Portal tile edge.** An unselected portal tile draws its border in `--ink-3` instead of
|
|
78
|
+
`--line-strong`, which was 1.5:1 against the card; it is now 5.2:1 or more in light and dark.
|
|
79
|
+
- **Sign in shows it is busy.** `LoginForm.Submit` draws a spinner next to its label while the
|
|
80
|
+
request runs, since a loading button is no longer dimmed.
|
|
81
|
+
- **`Input`** with `start` or `end` draws one focus ring (the wrapper's) instead of a second square
|
|
82
|
+
ring on the inner input.
|
|
83
|
+
- **`LoginForm` posts by default.** The form carries `method="post"`, so a submit before hydration
|
|
84
|
+
can no longer put the identifier and the password in the URL (history, logs, Referer). Pass
|
|
85
|
+
`method` to override it.
|
|
86
|
+
- **Looks are client modules.** Each look and `AuthIllustrationAny` start with `"use client"`, so a
|
|
87
|
+
Server Component can pass `look={Stack}` to `AuthLayout.Art` or `AuthIllustration` without
|
|
88
|
+
Next.js rejecting a function prop.
|
|
89
|
+
- **`LoginForm` state.** The same failed sign-in twice in a row replays the error (a new submit
|
|
90
|
+
leaves the error state first). A controlled `success` or `error` returning to unset derives
|
|
91
|
+
idle, typing or password from focus again. Without portals the form no longer overrides
|
|
92
|
+
`AuthLayout` `defaultActiveIndex`.
|
|
93
|
+
- **`Statement` accessibility.** The visible line is the one assistive technology reads: "You're in."
|
|
94
|
+
replaces the headline on success, and the caption is hidden with it.
|
|
95
|
+
- **Password length no longer reaches the DOM.** `progress` counts the identifier by length but the
|
|
96
|
+
password only as filled or not (new pure `formProgress`), so styles and attributes do not mirror
|
|
97
|
+
how long the password is. The slabs tighten once the password is filled instead of per character,
|
|
98
|
+
and the keystroke hop no longer fires per password character.
|
|
99
|
+
|
|
100
|
+
## 0.4.0 (2026-10-21)
|
|
101
|
+
|
|
102
|
+
### Blocks for application screens
|
|
103
|
+
|
|
104
|
+
New components, all additive and source compatible, with no new runtime dependency. Defaults come
|
|
105
|
+
from `UiStringsProvider` (en/es), layout follows container queries, and hit areas follow
|
|
106
|
+
`data-density="touch"`. Guide with examples: `/docs/blocks/`.
|
|
107
|
+
|
|
108
|
+
#### Added
|
|
109
|
+
|
|
110
|
+
- **Atoms.** `Spinner` (`size`, `label`, decorative `label={false}`), `Kbd`, `IconButton`
|
|
111
|
+
(required `label`, `variant`, `size`, `loading`, `asChild`, `iconButtonSizeClasses`), `DueChip`
|
|
112
|
+
(`date`, `today`, `soonDays`, `done`, `locale`) and `Seal` (`title`, `icon`, `tone`, `label`).
|
|
113
|
+
- **Overlays.** `Tooltip` (`content`, `shortcut`, `side`, `align`, `openDelay`, `closeDelay`,
|
|
114
|
+
controlled `open`) and `AlertDialog` (`role="alertdialog"`, `tone`, async `onConfirm` with a
|
|
115
|
+
pending state and inline failure message, focus on Cancel).
|
|
116
|
+
- **Forms.** `SelectMenu` (custom listbox select over `options`), `Combobox` (filter, async
|
|
117
|
+
`onSearchChange`, `loading`, `clearable`, `valueLabel`), `DatePicker` and `DateTimePicker` (ISO
|
|
118
|
+
values, `min`, `max`, `isDateDisabled`, locale-derived format and week start, time-zone safe) and
|
|
119
|
+
`ChipGroup` (multiple or single toggle chips with roving focus).
|
|
120
|
+
- **Calendar.** `DateCalendar`, the standalone keyboard date grid behind the pickers.
|
|
121
|
+
- **Navigation.** `Wizard` (`steps`, async `canAdvance`, `onBeforeNext`, `onComplete`) and
|
|
122
|
+
`TabsNav` / `TabsNavLink` (link strip with `aria-current="page"`, `renderLink`, `asChild`).
|
|
123
|
+
- **Containers.** `Section`, `Note`, `Aside` / `AsideHeader`, `ListDetail` (with its parts and
|
|
124
|
+
`useListDetail`), `Feed` / `FeedEvent` and `Shortcuts` / `ShortcutsItem`.
|
|
125
|
+
- **Banner `appearance="outline"`.** Page surface where only the border carries the tone (default
|
|
126
|
+
`soft`).
|
|
127
|
+
- **`DescriptionList`** `layout` (`auto`, `inline`, `stacked`), `columns` (1 to 3), `valueAlign` and
|
|
128
|
+
`DescriptionListItem` (dash placeholder for `null`, `undefined`, `false` and `""`).
|
|
129
|
+
- **`Chip` `size="sm"`** and `chipSizeClasses`; `ref` is a regular prop.
|
|
130
|
+
- **`Skeleton` variants** `list`, `kpis`, `key-value` and `bar`, with `count`.
|
|
131
|
+
- **`ErrorState` `actions`.**
|
|
132
|
+
- **Toast tones.** `toast.info`, `toast.warning`, `toast.danger` and `toastToneClasses`.
|
|
133
|
+
- **`resetToasts()`** in the new `@jcsoftdev/ui/overlays/testing` entry, for resetting the toast
|
|
134
|
+
store between tests.
|
|
135
|
+
- **Form gaps found while migrating an app.** `Input` takes `start` / `end` adornments, a
|
|
136
|
+
30px `size="xs"` and `variant="bare"`; `Dropzone` has `mode="field"` (a real labelled
|
|
137
|
+
`<input type="file">` with `accept`, `multiple`, `onChange` and removable selections);
|
|
138
|
+
`NumberStepper` has a string mode (`mode="string"`: empty state, caller-owned text, change event);
|
|
139
|
+
`Field` accepts a node `label` and several children.
|
|
140
|
+
- **Table.** `flush` (`true`, `"start"`, `"end"`) drops the outer cell padding so the first and last
|
|
141
|
+
column sit on the container edge; `stickyHeader`; `maxHeight` (the capped wrapper is focusable);
|
|
142
|
+
row selection with `selectedKeys`, `defaultSelectedKeys`, `onSelectedKeysChange`, `rowKey` on
|
|
143
|
+
`TableRow` / `TableLinkRow` (`aria-selected`), `TableSelectCell` and `TableSelectAllCell` (checked,
|
|
144
|
+
mixed, unchecked); `TableActionsCell`, which wraps inline actions under a narrow table container
|
|
145
|
+
(a named container query) or swaps them for an overflow `menu` you pass.
|
|
146
|
+
- **Section parts.** `Section.Header`, `.Title`, `.Count`, `.Description`, `.Actions` and `.Body`
|
|
147
|
+
next to the props API; a part as a direct child switches to composed rendering.
|
|
148
|
+
- **Kpi parts and chrome.** `Kpi.Label`, `.Value` (`mono`, `suffix`, `trend`) and `.Description`;
|
|
149
|
+
`card` (border and radius); `trailing` (content at the end of the label row that stays exposed to
|
|
150
|
+
assistive tech, unlike the decorative `icon`).
|
|
151
|
+
- **Timeline** `status` per item (`done`, `current`, `error`, `pending`) with a glyph, a spoken state
|
|
152
|
+
and `aria-current="step"`, and `Timeline.Item` children next to `items`.
|
|
153
|
+
- **Stepper** `status` per step (`done`, `current`, `error`, `pending`) with a check or cross and a
|
|
154
|
+
spoken state; the default stays `current` for `currentStepId` and `pending` otherwise.
|
|
155
|
+
- **AlertDialog** `confirmDisabled` and `cancelDisabled`, and a compound API: `AlertDialog.Root`,
|
|
156
|
+
`.Trigger`, `.Content`, `.Header`, `.Title`, `.Description`, `.Body`, `.Footer`, `.Cancel` and
|
|
157
|
+
`.Action`. Cancel and Action close the dialog after their `onClick` unless it calls
|
|
158
|
+
`preventDefault()`; use the props API for an async confirm with a pending state.
|
|
159
|
+
- **ListDetail** `onBack`.
|
|
160
|
+
- **DueChip** `state` forces `overdue`, `soon`, `ok` or `done` whatever the date says.
|
|
161
|
+
- **Seal** `tone="institutional"` (strong neutral, ink frame) and any tone declared in
|
|
162
|
+
`tonePalettes`, by name, as `Kpi` does.
|
|
163
|
+
- **DropdownMenu** `bare` content (layering and size limits only, so a custom menu draws its own
|
|
164
|
+
surface), `DropdownMenuAnchor`, and `dropdownMenuItemClasses` / `dropdownMenuSurfaceClasses`.
|
|
165
|
+
- **UI strings** (en/es) for the new components: `noResults`, `clear`, `selectPlaceholder`,
|
|
166
|
+
`calendar`, `openCalendar`, `previousMonth`, `nextMonth`, `time`, `locale`, the day, month and
|
|
167
|
+
year placeholders, `back`, `next`, `finish`, `stepOf`, `steps`, `aside`, `backToList`, `overdue`,
|
|
168
|
+
`dueSoon`, `stepDone`, `stepError`, `selectRow`, `selectAll` and `rowActions`.
|
|
169
|
+
|
|
170
|
+
#### Changed (behavior to check when upgrading)
|
|
171
|
+
|
|
172
|
+
- **`ErrorState` markup.** The retry button now sits inside a wrapper `div` that also holds
|
|
173
|
+
`actions`. Selectors or tests that expect the button as a direct child need updating.
|
|
174
|
+
- **Toast tint.** Success and error toasts are tinted with their tone (`*-soft` surface, tone
|
|
175
|
+
border, status glyph) instead of the inverted neutral look. `default` is unchanged and roles are
|
|
176
|
+
unchanged (only error is an alert).
|
|
177
|
+
- **`Checkbox` and `Switch` touch target.** The 44px target is an invisible `::after` of the control
|
|
178
|
+
instead of a larger root, so under touch density the layout box is 40px (it was 44px) and the hit
|
|
179
|
+
target can overlap a neighbour by 2px per side. Default density is unchanged.
|
|
180
|
+
- **`Section` `divider` is off by default.** A kit whose section header always drew a hairline
|
|
181
|
+
needs `divider`.
|
|
182
|
+
- **`RadioGroup`** radios now carry `aria-labelledby` and `aria-describedby`, so they have
|
|
183
|
+
accessible names without relying on `<label for>`.
|
|
184
|
+
- **`theme.css` no longer emits self-referencing variables.** Entries such as
|
|
185
|
+
`--radius-input: var(--radius-input)` (radii, shadows, `--font-sans`) now sit in an
|
|
186
|
+
`@theme reference inline` block, so the utilities resolve to the raw token and nothing is declared
|
|
187
|
+
in Tailwind's theme layer. Consumers no longer need to reorder layers; verified on Tailwind 4.3.3.
|
|
188
|
+
- **Locale reaches the date pickers.** `UiStringsProvider` ignores `undefined` and empty entries
|
|
189
|
+
instead of letting them overwrite the preset, so `strings={{ locale: undefined }}` no longer sends
|
|
190
|
+
Intl to the system locale; its context is shared across duplicate module copies.
|
|
191
|
+
- **`Combobox` `required`** sets `aria-required` only and no longer blocks native submit before your
|
|
192
|
+
own validation; `nativeRequired` opts back in.
|
|
193
|
+
- **`Section` and titleless wrappers.** A `Section` with no title no longer takes a heading level or
|
|
194
|
+
tightens the spacing of what it wraps, so a titled section inside a wrapper keeps the level it
|
|
195
|
+
would have had without it (it moves up one level compared with the earlier 0.3.0 previews).
|
|
196
|
+
- **`ListDetail` back action.** It calls `onBack` and never `onValueChange(null)`; `onValueChange`
|
|
197
|
+
is typed `(value: string) => void`. Both only affect the earlier 0.3.0 previews, since `ListDetail`
|
|
198
|
+
is new in 0.3.0.
|
|
199
|
+
- **`Table` selected rows.** A row with a `rowKey` in a table with selection props reports
|
|
200
|
+
`aria-selected` and highlights; tables without selection props render as before.
|
|
201
|
+
- **Escape inside the library's own comboboxes.** The dismissable-layer primitive no longer treats
|
|
202
|
+
the library's own open `role="combobox"` widgets as a foreign layer, so Escape closes them.
|
|
4
203
|
|
|
5
204
|
### Components for app shells
|
|
6
205
|
|
package/README.md
CHANGED
|
@@ -52,6 +52,8 @@ npx ui-theme build my-tokens.json --out src/theme # optional: your own look (d
|
|
|
52
52
|
@source "../node_modules/@jcsoftdev/ui/dist"; /* lets Tailwind see the classes used by the components */
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
Import order is free: `theme.css` declares nothing in Tailwind's `theme` layer that points back at itself (tokens such as `--radius-input` are mapped with `@theme reference inline`, so `rounded-input` reads the raw variable directly). `tokens.css` and `base.css` can sit unlayered, or in a layer of your own (`@import "…/tokens.css" layer(ui);`) declared before or after `theme`, with no `@layer` reordering and no re-declared names. Verified with Tailwind 4.3.3.
|
|
56
|
+
|
|
55
57
|
```tsx
|
|
56
58
|
import { Button } from "@jcsoftdev/ui/atoms/button";
|
|
57
59
|
<Button variant="primary">Save</Button>;
|
|
@@ -145,11 +147,62 @@ older components already ship (NumberStepper, Carousel, AI set) are not routed t
|
|
|
145
147
|
|
|
146
148
|
| Component | Added |
|
|
147
149
|
| --- | --- |
|
|
148
|
-
| `Button` | `loadingLabel` (shown instead of the children while `loading`, announced through a status region), `block` (full width), `size="lg"` (52px at normal density, scaled like the other controls). |
|
|
150
|
+
| `Button` | `loading` keeps the button focusable (`aria-disabled` and `aria-busy`, clicks and form submission ignored, not dimmed; `disabled` still disables natively), `loadingLabel` (shown instead of the children while `loading`, announced through a status region), `block` (full width), `size="lg"` (52px at normal density, scaled like the other controls). |
|
|
149
151
|
| `Field` | `optional` appends the localized "(optional)" marker to the label; `error` also accepts `null`. |
|
|
150
|
-
| `Banner` | `title`; a default glyph per tone when `icon` is not passed (`icon={null}` hides it, so status never relies on color alone); only `danger` is `role="alert"`, the rest are `role="status"`; the `info` tone uses the `info` tokens. |
|
|
152
|
+
| `Banner` | `appearance="outline"` (page surface, only the border carries the tone; default `soft`), `title`; a default glyph per tone when `icon` is not passed (`icon={null}` hides it, so status never relies on color alone); only `danger` is `role="alert"`, the rest are `role="status"`; the `info` tone uses the `info` tokens. |
|
|
151
153
|
| `Chip` | `icon`, `statusIcon` (prefixes `info`, `success`, `warning`, `danger` chips with their glyph), and an `info` tone. |
|
|
152
|
-
| `ErrorState` | `title` and `description` (`message` keeps working as the headline)
|
|
154
|
+
| `ErrorState` | `title` and `description` (`message` keeps working as the headline), `actions`; an `Error` or any non-renderable value is never printed, a generic localized sentence is shown instead. |
|
|
155
|
+
|
|
156
|
+
## Blocks for application screens (additive)
|
|
157
|
+
|
|
158
|
+
New components, all zero-dependency, localized through `UiStringsProvider`, laid out with container
|
|
159
|
+
queries and sized for touch density. Props, accessibility notes and type-checked examples:
|
|
160
|
+
https://ui.jcsoftdev.com/docs/blocks/
|
|
161
|
+
|
|
162
|
+
| Component | Entry | What it is |
|
|
163
|
+
| --- | --- | --- |
|
|
164
|
+
| `Spinner`, `Kbd` | `atoms` | Loading ring (`size`, `label`, `label={false}` for decorative) and a styled `<kbd>`. |
|
|
165
|
+
| `IconButton` | `atoms` | Square `Button` with a required `label` (`aria-label`), `variant`, `size`, `loading`. |
|
|
166
|
+
| `DueChip` | `atoms` | Due-date chip: overdue, soon (`soonDays`) and ok states with a glyph and sr-only suffix; time-zone safe. |
|
|
167
|
+
| `Seal` | `atoms` | Stamp mark: `title`, `icon`, `tone`, optional named `label`. |
|
|
168
|
+
| `Tooltip` | `overlays` | Hover and focus tip: `content`, `shortcut`, `side`, `openDelay`, `closeDelay`; `role="tooltip"`. |
|
|
169
|
+
| `AlertDialog` | `overlays` | `role="alertdialog"` with cancel and confirm, `tone="danger"`, async `onConfirm` with a pending state. |
|
|
170
|
+
| `SelectMenu` | `forms` | Custom listbox select over `options` (groups, disabled options, typeahead, hidden `name` input). |
|
|
171
|
+
| `Combobox` | `forms` | Filterable, async-friendly (`onSearchChange`, `loading`), `clearable`, `emptyText`. |
|
|
172
|
+
| `DatePicker`, `DateTimePicker` | `forms` | Typed masked input plus calendar popover; ISO values, `min`, `max`, `isDateDisabled`, locale week start. |
|
|
173
|
+
| `DateCalendar` | `calendar` | Standalone keyboard date grid behind the pickers. |
|
|
174
|
+
| `ChipGroup` | `forms` | Multi or single toggle chips (`aria-pressed`, roving focus, `count`, `name`). |
|
|
175
|
+
| `Wizard` | `navigation` | `Stepper` plus Back/Next/Finish: `steps`, async `canAdvance`, `onBeforeNext`, `onComplete`. |
|
|
176
|
+
| `TabsNav`, `TabsNavLink` | `navigation` | Link-mode sub-navigation strip (`aria-current="page"`, `renderLink` or `asChild`). |
|
|
177
|
+
| `Section`, `Note`, `Aside` | `containers` | Titled block with `actions` and optional `divider`, a text note with a `tone`, and a complementary region. |
|
|
178
|
+
| `ListDetail` | `containers` | Master-detail that collapses to one pane under 641px of its own width. |
|
|
179
|
+
| `Feed`, `FeedEvent` | `containers` | Activity log with a mark, text and `<time>` (absolute or `relative`). |
|
|
180
|
+
| `Shortcuts`, `ShortcutsItem` | `containers` | Link or button tiles with `icon`, `count`, `kbd`. |
|
|
181
|
+
|
|
182
|
+
Additive props on existing components:
|
|
183
|
+
|
|
184
|
+
| Component | Added |
|
|
185
|
+
| --- | --- |
|
|
186
|
+
| `DescriptionList` | `layout` (`auto`, `inline`, `stacked`), `columns` (1 to 3), `valueAlign` (`end`, `start`); `DescriptionListItem` with a dash placeholder for empty values. |
|
|
187
|
+
| `Chip` | `size="sm"` (compact; a tag is `<Chip size="sm" square>`). |
|
|
188
|
+
| `Skeleton` | `variant` `list`, `kpis`, `key-value`, `bar` and `count`. |
|
|
189
|
+
| `ErrorState` | `actions` node, rendered in the same row as the retry button (the retry button now sits inside a wrapper `div`). |
|
|
190
|
+
| `RadioGroup` | Each radio is named by its label and described by its description. |
|
|
191
|
+
| `Checkbox`, `Switch` | The 44px touch target is an invisible `::after`; under touch density the layout box stays 40px. |
|
|
192
|
+
| `Table` | `flush` (`true`, `"start"`, `"end"`), `stickyHeader`, `maxHeight`, selection (`selectedKeys`, `defaultSelectedKeys`, `onSelectedKeysChange`, `rowKey`, `TableSelectCell`, `TableSelectAllCell`), `TableActionsCell` (wraps, or swaps for your overflow `menu`, under a narrow table container). |
|
|
193
|
+
| `Section` | Parts `Section.Header`, `.Title`, `.Count`, `.Description`, `.Actions`, `.Body` next to the props; a titleless wrapper takes no heading level. |
|
|
194
|
+
| `Kpi` | Parts `Kpi.Label`, `.Value` (`mono`, `suffix`, `trend`), `.Description`; `card` chrome; `trailing` slot. |
|
|
195
|
+
| `Timeline` | `status` per item (`done`, `current`, `error`, `pending`) and `Timeline.Item` children. |
|
|
196
|
+
| `Stepper` | `status` per step with a glyph and a spoken state. |
|
|
197
|
+
| `AlertDialog` | `confirmDisabled`, `cancelDisabled`; compound `AlertDialog.Root`, `.Trigger`, `.Content`, `.Title`, `.Description`, `.Cancel`, `.Action`. |
|
|
198
|
+
| `ListDetail` | `onBack` for the back action; `onValueChange` never receives `null`. |
|
|
199
|
+
| `DueChip` | `state` forces `overdue`, `soon`, `ok` or `done`. |
|
|
200
|
+
| `Seal` | `tone="institutional"` and any `tonePalettes` tone by name. |
|
|
201
|
+
| `DropdownMenu` | `DropdownMenuContent bare` (no panel look), `DropdownMenuAnchor`, `dropdownMenuItemClasses`, `dropdownMenuSurfaceClasses` for custom menus. |
|
|
202
|
+
| `toast` | `toast.info`, `toast.warning`, `toast.danger`; success, info, warning and error toasts are tinted with a glyph. |
|
|
203
|
+
|
|
204
|
+
In tests, reset the toast store with `import { resetToasts } from "@jcsoftdev/ui/overlays/testing"`
|
|
205
|
+
(kept off the `overlays` entry so production bundles never carry it).
|
|
153
206
|
|
|
154
207
|
## ConfirmAction and ResponsiveList
|
|
155
208
|
|
package/bin/ui-theme.mjs
CHANGED
|
@@ -792,12 +792,23 @@ function buildThemeCss(tokens2) {
|
|
|
792
792
|
);
|
|
793
793
|
const tail = utilities.length ? `
|
|
794
794
|
${utilities.join("\n\n")}
|
|
795
|
+
` : "";
|
|
796
|
+
const selfReference = (l) => {
|
|
797
|
+
const m = /^\s*(--[\w-]+): var\((--[\w-]+)\);$/.exec(l);
|
|
798
|
+
return m !== null && m[1] === m[2];
|
|
799
|
+
};
|
|
800
|
+
const mapped = lines.filter((l) => !selfReference(l));
|
|
801
|
+
const same = lines.filter(selfReference);
|
|
802
|
+
const reference = same.length ? `
|
|
803
|
+
@theme reference inline {
|
|
804
|
+
${same.join("\n")}
|
|
805
|
+
}
|
|
795
806
|
` : "";
|
|
796
807
|
return `/* Generated by ui-theme from "${tokens2.name}". Do not edit. */
|
|
797
808
|
@theme inline {
|
|
798
|
-
${
|
|
809
|
+
${mapped.join("\n")}
|
|
799
810
|
}
|
|
800
|
-
${tail}`;
|
|
811
|
+
${reference}${tail}`;
|
|
801
812
|
}
|
|
802
813
|
function buildFontsCss(tokens2) {
|
|
803
814
|
const imports = (tokens2.type?.fonts ?? []).filter((f) => f.source === "google").map((f) => `@import url("https://fonts.googleapis.com/css2?family=${f.spec}&display=swap");`);
|
|
@@ -22,6 +22,13 @@ export declare function buttonClasses({ variant, size, block, className, }?: But
|
|
|
22
22
|
export interface ButtonProps extends ComponentPropsWithRef<"button"> {
|
|
23
23
|
variant?: ButtonVariant;
|
|
24
24
|
size?: ButtonSize;
|
|
25
|
+
/**
|
|
26
|
+
* Busy state: the button keeps its focus and its full colour, ignores clicks (a submit button no
|
|
27
|
+
* longer submits, including the implicit submit from Enter in a field of its form) and is exposed
|
|
28
|
+
* as `aria-disabled` and `aria-busy`. It is not natively `disabled`, so keyboard focus stays on it
|
|
29
|
+
* while the work runs; pass `disabled` for a button that must leave the tab order. The visible
|
|
30
|
+
* cue is `loadingLabel` or a spinner among the children: without either only the cursor changes.
|
|
31
|
+
*/
|
|
25
32
|
loading?: boolean;
|
|
26
33
|
/**
|
|
27
34
|
* Replaces the children while `loading` and is announced to screen readers. Without it the
|
|
@@ -33,4 +40,4 @@ export interface ButtonProps extends ComponentPropsWithRef<"button"> {
|
|
|
33
40
|
/** Render the child element (via Slot) instead of a `<button>`, e.g. a link. */
|
|
34
41
|
asChild?: boolean;
|
|
35
42
|
}
|
|
36
|
-
export declare function Button({ variant, size, loading, loadingLabel, block, disabled, asChild, className, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
43
|
+
export declare function Button({ variant, size, loading, loadingLabel, block, disabled, asChild, className, children, onClick, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { useUiStrings } from "../../i18n/index.js";
|
|
|
9
9
|
import { cn } from "../../utils/cn.js";
|
|
10
10
|
import { Slot } from "../../utils/slot.js";
|
|
11
11
|
const buttonVariantClasses = {
|
|
12
|
-
primary: "bg-accent text-on-accent font-bold hover:bg-accent-ink",
|
|
12
|
+
primary: "bg-accent text-on-accent font-bold hover:bg-accent-ink hover:text-surface",
|
|
13
13
|
secondary: "bg-surface-control text-ink shadow-control hover:bg-surface-2",
|
|
14
14
|
ghost: "bg-transparent text-ink-2 hover:bg-surface-2 hover:text-ink",
|
|
15
15
|
danger: "bg-danger-soft text-danger hover:bg-danger-soft/70"
|
|
@@ -19,7 +19,7 @@ const buttonSizeClasses = {
|
|
|
19
19
|
md: "h-control px-control-x text-fs-130",
|
|
20
20
|
lg: "h-control-lg px-control-x text-fs-140"
|
|
21
21
|
};
|
|
22
|
-
const baseClasses = "inline-flex min-w-0 max-w-full cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-button pressable focus-visible:focus-ring font-[650] no-underline disabled:cursor-not-allowed disabled:opacity-45 [&_svg]:shrink-0";
|
|
22
|
+
const baseClasses = "inline-flex min-w-0 max-w-full cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-button pressable focus-visible:focus-ring font-[650] no-underline disabled:cursor-not-allowed disabled:opacity-45 aria-busy:cursor-progress aria-busy:scale-none! [&_svg]:shrink-0";
|
|
23
23
|
function buttonClasses({
|
|
24
24
|
variant = "secondary",
|
|
25
25
|
size = "md",
|
|
@@ -44,9 +44,11 @@ function Button({
|
|
|
44
44
|
asChild,
|
|
45
45
|
className,
|
|
46
46
|
children,
|
|
47
|
+
onClick,
|
|
47
48
|
...props
|
|
48
49
|
}) {
|
|
49
50
|
const strings = useUiStrings();
|
|
51
|
+
const busy = Boolean(loading) && !disabled;
|
|
50
52
|
const Comp = asChild ? Slot : "button";
|
|
51
53
|
const showLoadingLabel = loading && loadingLabel !== void 0 && !asChild;
|
|
52
54
|
const content = showLoadingLabel ? labelRun(loadingLabel) : asChild ? children : Children.map(children, labelRun);
|
|
@@ -55,9 +57,11 @@ function Button({
|
|
|
55
57
|
{
|
|
56
58
|
...asChild ? {} : { type: "button" },
|
|
57
59
|
"aria-busy": loading ? "true" : void 0,
|
|
58
|
-
disabled:
|
|
60
|
+
"aria-disabled": busy || void 0,
|
|
61
|
+
disabled,
|
|
59
62
|
className: buttonClasses({ variant, size, block, className }),
|
|
60
63
|
...props,
|
|
64
|
+
onClick: busy ? ignoreClick : onClick,
|
|
61
65
|
children: content
|
|
62
66
|
}
|
|
63
67
|
);
|
|
@@ -67,6 +71,9 @@ function Button({
|
|
|
67
71
|
/* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: loading ? loadingLabel ?? strings.loading : null })
|
|
68
72
|
] });
|
|
69
73
|
}
|
|
74
|
+
function ignoreClick(event) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
}
|
|
70
77
|
function labelRun(child) {
|
|
71
78
|
if (typeof child === "string" || typeof child === "number") {
|
|
72
79
|
return /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: child });
|
|
@@ -6,6 +6,7 @@ import { cn } from "../../utils/cn.js";
|
|
|
6
6
|
import { composeHandlers, useComposedRefs } from "../../utils/compose.js";
|
|
7
7
|
import { BubbleInput, useFormBubble, useFormReset } from "../../utils/form-bubble.js";
|
|
8
8
|
import { useControllableState } from "../../utils/use-controllable-state.js";
|
|
9
|
+
import { touchHitArea } from "../internal/hit-area.js";
|
|
9
10
|
function getState(checked) {
|
|
10
11
|
return checked === "indeterminate" ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
11
12
|
}
|
|
@@ -56,7 +57,8 @@ function Checkbox({
|
|
|
56
57
|
...props,
|
|
57
58
|
ref: composedRef,
|
|
58
59
|
className: cn(
|
|
59
|
-
|
|
60
|
+
touchHitArea,
|
|
61
|
+
"group inline-flex size-10 shrink-0 items-center justify-center disabled:cursor-not-allowed disabled:opacity-50",
|
|
60
62
|
classNames?.root,
|
|
61
63
|
className
|
|
62
64
|
),
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
export type ChipBuiltinTone = "neutral" | "danger" | "warning" | "success" | "accent" | "info" | "solid" | "outline";
|
|
3
3
|
/** A built-in tone, or the name of a tone declared in `tonePalettes`. */
|
|
4
4
|
export type ChipTone = ChipBuiltinTone | (string & {});
|
|
5
5
|
/** Class map behind each `tone`; exported so apps can extend or reuse it. */
|
|
6
6
|
export declare const chipToneClasses: Readonly<Record<ChipBuiltinTone, string>>;
|
|
7
|
-
export
|
|
7
|
+
export type ChipSize = "sm" | "md";
|
|
8
|
+
/** Class map behind each `size`; exported like `chipToneClasses`. */
|
|
9
|
+
export declare const chipSizeClasses: Readonly<Record<ChipSize, string>>;
|
|
10
|
+
export interface ChipProps extends ComponentPropsWithRef<"span"> {
|
|
8
11
|
tone?: ChipTone;
|
|
12
|
+
/**
|
|
13
|
+
* `sm` is the compact tag: it grows with its content, tightens the padding and uses tabular
|
|
14
|
+
* numerals, so codes, counts and ids line up. Pair it with `square` and a neutral tone for a tag.
|
|
15
|
+
*/
|
|
16
|
+
size?: ChipSize;
|
|
9
17
|
/** Use the smaller chip radius instead of a full pill. */
|
|
10
18
|
square?: boolean;
|
|
11
19
|
/** Leading decorative icon; wins over `statusIcon`. */
|
|
@@ -17,4 +25,4 @@ export interface ChipProps extends ComponentPropsWithoutRef<"span"> {
|
|
|
17
25
|
/** Accessible name of the remove button. Defaults to the localized "Remove". */
|
|
18
26
|
removeLabel?: string;
|
|
19
27
|
}
|
|
20
|
-
export declare function Chip({ tone, square, icon, statusIcon: withStatusIcon, onRemove, removeLabel, className, style, children, ...props }: ChipProps): import("react").JSX.Element;
|
|
28
|
+
export declare function Chip({ tone, size, square, icon, statusIcon: withStatusIcon, onRemove, removeLabel, className, style, children, ...props }: ChipProps): import("react").JSX.Element;
|
package/dist/atoms/chip/chip.js
CHANGED
|
@@ -15,10 +15,15 @@ const chipToneClasses = {
|
|
|
15
15
|
solid: "bg-accent text-on-accent",
|
|
16
16
|
outline: "bg-transparent text-ink-2 shadow-[inset_0_0_0_1px_var(--line-strong)]"
|
|
17
17
|
};
|
|
18
|
+
const chipSizeClasses = {
|
|
19
|
+
md: "h-6 px-2.5 font-[650] text-fs-120",
|
|
20
|
+
sm: "h-auto min-h-5 px-1.5 py-px font-medium text-fs-115 tabular-nums"
|
|
21
|
+
};
|
|
18
22
|
const statusTones = /* @__PURE__ */ new Set(["info", "success", "warning", "danger"]);
|
|
19
23
|
const builtinTones = new Set(Object.keys(chipToneClasses));
|
|
20
24
|
function Chip({
|
|
21
25
|
tone = "neutral",
|
|
26
|
+
size = "md",
|
|
22
27
|
square,
|
|
23
28
|
icon,
|
|
24
29
|
statusIcon: withStatusIcon,
|
|
@@ -37,7 +42,8 @@ function Chip({
|
|
|
37
42
|
"span",
|
|
38
43
|
{
|
|
39
44
|
className: cn(
|
|
40
|
-
"inline-flex
|
|
45
|
+
"inline-flex max-w-full items-center gap-1.5 overflow-hidden whitespace-nowrap leading-none [&_svg]:size-3",
|
|
46
|
+
chipSizeClasses[size],
|
|
41
47
|
square ? "rounded-chip" : "rounded-badge",
|
|
42
48
|
custom ? "bg-(--tone-c-soft) text-(--tone-c-ink)" : chipToneClasses[tone] ?? chipToneClasses.neutral,
|
|
43
49
|
(interactive || onRemove) && "in-data-[density=touch]:min-h-11",
|
|
@@ -65,5 +71,6 @@ function Chip({
|
|
|
65
71
|
}
|
|
66
72
|
export {
|
|
67
73
|
Chip,
|
|
74
|
+
chipSizeClasses,
|
|
68
75
|
chipToneClasses
|
|
69
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Chip, type ChipBuiltinTone, type ChipProps, type ChipTone, chipToneClasses, } from "./chip.js";
|
|
1
|
+
export { Chip, type ChipBuiltinTone, type ChipProps, type ChipSize, type ChipTone, chipSizeClasses, chipToneClasses, } from "./chip.js";
|
package/dist/atoms/chip/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export type DividerPart = "root" | "line" | "label";
|
|
4
|
+
export interface DividerProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
5
|
+
/** Text centered on the rule. Without it the divider is a plain hairline. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
8
|
+
classNames?: ClassNames<DividerPart>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Horizontal rule, optionally carrying a short label ("or", "with your account"). It is a
|
|
12
|
+
* separator for assistive technology, so the label is read as part of the separator's name
|
|
13
|
+
* rather than as page content.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Divider({ children, className, classNames, ...props }: DividerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
function Divider({ children, className, classNames, ...props }) {
|
|
4
|
+
const labelled = children !== void 0 && children !== null && children !== false;
|
|
5
|
+
const line = cn("h-px min-w-0 flex-1 bg-line", classNames?.line);
|
|
6
|
+
return (
|
|
7
|
+
// biome-ignore lint/a11y/useSemanticElements: an <hr> cannot carry the label between the two rules
|
|
8
|
+
/* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
role: "separator",
|
|
12
|
+
"aria-orientation": "horizontal",
|
|
13
|
+
"aria-label": labelled && typeof children === "string" ? children : void 0,
|
|
14
|
+
...props,
|
|
15
|
+
className: cn("flex items-center gap-3 text-ink-3 text-meta", classNames?.root, className),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: line }),
|
|
18
|
+
labelled ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("shrink-0", classNames?.label), children }) : null,
|
|
19
|
+
labelled ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: line }) : null
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
Divider
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./divider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./divider.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ChipProps } from "../chip/chip.js";
|
|
3
|
+
import { type DueState } from "./model.js";
|
|
4
|
+
export type { DueState } from "./model.js";
|
|
5
|
+
export interface DueChipProps extends Omit<ChipProps, "tone" | "children" | "onRemove" | "statusIcon"> {
|
|
6
|
+
/** Due date: "2026-03-04", a naive date-time "2026-03-04T17:00", or an ISO instant (read in the viewer's zone). */
|
|
7
|
+
date: string;
|
|
8
|
+
/**
|
|
9
|
+
* Reference day ("YYYY-MM-DD") the state is measured from. Defaults to the viewer's today;
|
|
10
|
+
* pass it for deterministic output (server render, tests, "as of" views).
|
|
11
|
+
*/
|
|
12
|
+
today?: string | undefined;
|
|
13
|
+
/** Days ahead (inclusive of today) that count as `soon`. Defaults to 3. */
|
|
14
|
+
soonDays?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Forces the state regardless of the date, for a status the date alone cannot tell (a
|
|
17
|
+
* payment that is late by policy, a hold). `done` is the neutral finished look. Wins over `done`.
|
|
18
|
+
*/
|
|
19
|
+
state?: DueState | "done" | undefined;
|
|
20
|
+
/** A finished item is never overdue or soon: the chip stays neutral. */
|
|
21
|
+
done?: boolean | undefined;
|
|
22
|
+
/** Replaces the formatted date text. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
locale?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A due date as a chip: neutral while it is far off, warning from `soonDays` before, danger once
|
|
28
|
+
* past. The tone is never the only signal: overdue and soon chips carry a status glyph and a
|
|
29
|
+
* screen-reader state. Renders `<time datetime>`; an unreadable date is shown as given.
|
|
30
|
+
*/
|
|
31
|
+
export declare function DueChip({ date, today, soonDays, done, state: forced, locale, children, ...props }: DueChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { todayIso } from "../../calendar/internal/date-utils.js";
|
|
4
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
5
|
+
import { Chip } from "../chip/chip.js";
|
|
6
|
+
import { dueCalendarDate, dueStatus, formatDueDay } from "./model.js";
|
|
7
|
+
const toneFor = {
|
|
8
|
+
overdue: "danger",
|
|
9
|
+
soon: "warning",
|
|
10
|
+
ok: "neutral"
|
|
11
|
+
};
|
|
12
|
+
function DueChip({
|
|
13
|
+
date,
|
|
14
|
+
today,
|
|
15
|
+
soonDays,
|
|
16
|
+
done = false,
|
|
17
|
+
state: forced,
|
|
18
|
+
locale,
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const strings = useUiStrings();
|
|
23
|
+
const reference = today ?? todayIso();
|
|
24
|
+
const day = dueCalendarDate(date);
|
|
25
|
+
const status = day ? dueStatus(date, { today: reference, soonDays }) : null;
|
|
26
|
+
if (!day || !status) return /* @__PURE__ */ jsx(Chip, { ...props, children: children ?? date });
|
|
27
|
+
const resolved = forced ?? (done ? "done" : status.state);
|
|
28
|
+
const state = resolved === "done" ? "ok" : resolved;
|
|
29
|
+
const tone = toneFor[state];
|
|
30
|
+
const stateText = state === "overdue" ? strings.overdue : state === "soon" ? strings.dueSoon : null;
|
|
31
|
+
return /* @__PURE__ */ jsxs(Chip, { tone, statusIcon: true, "data-state": resolved, ...props, children: [
|
|
32
|
+
/* @__PURE__ */ jsx("time", { dateTime: date, children: children ?? formatDueDay(day, dueCalendarDate(reference) ?? reference, locale ?? strings.locale) }),
|
|
33
|
+
stateText ? /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
34
|
+
", ",
|
|
35
|
+
stateText
|
|
36
|
+
] }) : null
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
DueChip
|
|
41
|
+
};
|