@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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useEffect,
|
|
5
|
+
useId,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState
|
|
9
|
+
} from "react";
|
|
10
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
11
|
+
import { ChevronDown } from "../../icons/index.js";
|
|
12
|
+
import * as PopoverPrimitive from "../../primitives/popover/popover.js";
|
|
13
|
+
import { cn } from "../../utils/cn.js";
|
|
14
|
+
import { useComposedRefs } from "../../utils/compose.js";
|
|
15
|
+
import { materialClass } from "../../utils/material.js";
|
|
16
|
+
import { useControllableState } from "../../utils/use-controllable-state.js";
|
|
17
|
+
import {
|
|
18
|
+
flattenItems,
|
|
19
|
+
isTypeaheadKey,
|
|
20
|
+
moveActive,
|
|
21
|
+
nextTypeahead,
|
|
22
|
+
typeaheadIndex
|
|
23
|
+
} from "../internal/listbox.js";
|
|
24
|
+
import { LISTBOX_SURFACE, ListboxItems, optionDomId } from "../internal/listbox-items.js";
|
|
25
|
+
const TYPEAHEAD_MS = 600;
|
|
26
|
+
const OPEN_KEYS = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "Enter", " "]);
|
|
27
|
+
function SelectMenu({
|
|
28
|
+
options,
|
|
29
|
+
value: valueProp,
|
|
30
|
+
defaultValue,
|
|
31
|
+
onValueChange,
|
|
32
|
+
placeholder,
|
|
33
|
+
name,
|
|
34
|
+
required,
|
|
35
|
+
invalid,
|
|
36
|
+
size = "md",
|
|
37
|
+
container,
|
|
38
|
+
material,
|
|
39
|
+
disabled,
|
|
40
|
+
className,
|
|
41
|
+
classNames,
|
|
42
|
+
onKeyDown,
|
|
43
|
+
onKeyUp,
|
|
44
|
+
onClick,
|
|
45
|
+
ref,
|
|
46
|
+
id,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
"aria-labelledby": ariaLabelledBy,
|
|
49
|
+
"aria-invalid": ariaInvalid,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
const strings = useUiStrings();
|
|
53
|
+
const listId = useId();
|
|
54
|
+
const triggerRef = useRef(null);
|
|
55
|
+
const composedRef = useComposedRefs(ref, triggerRef);
|
|
56
|
+
const typeahead = useRef({ buffer: "", at: 0 });
|
|
57
|
+
const [value, setValue] = useControllableState({
|
|
58
|
+
prop: valueProp,
|
|
59
|
+
defaultProp: defaultValue,
|
|
60
|
+
onChange: (next) => {
|
|
61
|
+
if (next !== void 0) onValueChange?.(next);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const [open, setOpenState] = useState(false);
|
|
65
|
+
const [active, setActive] = useState(-1);
|
|
66
|
+
const [listLabel, setListLabel] = useState();
|
|
67
|
+
const flat = useMemo(() => flattenItems(options), [options]);
|
|
68
|
+
const selectedIndex = flat.findIndex((option) => option.value === value);
|
|
69
|
+
const selected = flat[selectedIndex];
|
|
70
|
+
const isDisabled = Boolean(disabled);
|
|
71
|
+
const setOpen = (next, move) => {
|
|
72
|
+
if (next && isDisabled) return;
|
|
73
|
+
if (next) {
|
|
74
|
+
const preferred = selected && !selected.disabled ? selectedIndex : -1;
|
|
75
|
+
setActive(
|
|
76
|
+
move ? moveActive(flat, move === "last" ? flat.length : -1, move) : preferred >= 0 ? preferred : moveActive(flat, -1, "first")
|
|
77
|
+
);
|
|
78
|
+
setListLabel(triggerRef.current?.labels?.[0]?.textContent?.trim() || void 0);
|
|
79
|
+
}
|
|
80
|
+
setOpenState(next);
|
|
81
|
+
};
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!open || active < 0) return;
|
|
84
|
+
document.getElementById(optionDomId(listId, active))?.scrollIntoView?.({ block: "nearest" });
|
|
85
|
+
}, [open, active, listId]);
|
|
86
|
+
const pick = (index) => {
|
|
87
|
+
const option = flat[index];
|
|
88
|
+
if (!option || option.disabled) return;
|
|
89
|
+
setValue(option.value);
|
|
90
|
+
setOpenState(false);
|
|
91
|
+
};
|
|
92
|
+
const handleKeyDown = (event) => {
|
|
93
|
+
onKeyDown?.(event);
|
|
94
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
95
|
+
const { key } = event;
|
|
96
|
+
const buffering = typeahead.current.buffer !== "" && Date.now() - typeahead.current.at <= TYPEAHEAD_MS;
|
|
97
|
+
const typing = isTypeaheadKey(event) && !(key === " " && !buffering);
|
|
98
|
+
if (typing) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
typeahead.current = nextTypeahead(typeahead.current, key, Date.now());
|
|
101
|
+
const found = typeaheadIndex(flat, typeahead.current.buffer, open ? active : selectedIndex);
|
|
102
|
+
if (found < 0) return;
|
|
103
|
+
if (open) setActive(found);
|
|
104
|
+
else pick(found);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!open) {
|
|
108
|
+
if (OPEN_KEYS.has(key)) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
setOpen(true);
|
|
111
|
+
} else if (key === "Home" || key === "End") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
setOpen(true, key === "Home" ? "first" : "last");
|
|
114
|
+
}
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const moves = {
|
|
118
|
+
ArrowDown: "next",
|
|
119
|
+
ArrowUp: "prev",
|
|
120
|
+
Home: "first",
|
|
121
|
+
End: "last"
|
|
122
|
+
};
|
|
123
|
+
const move = moves[key];
|
|
124
|
+
if (move) {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
setActive((current) => moveActive(flat, current, move));
|
|
127
|
+
} else if (key === "Enter" || key === " ") {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
pick(active);
|
|
130
|
+
} else if (key === "Tab") {
|
|
131
|
+
setOpenState(false);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const showPlaceholder = !selected;
|
|
135
|
+
return /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open, onOpenChange: (next) => setOpen(next), children: [
|
|
136
|
+
/* @__PURE__ */ jsxs(
|
|
137
|
+
PopoverPrimitive.Trigger,
|
|
138
|
+
{
|
|
139
|
+
ref: composedRef,
|
|
140
|
+
id,
|
|
141
|
+
role: "combobox",
|
|
142
|
+
"data-ui-layer": "",
|
|
143
|
+
"aria-haspopup": "listbox",
|
|
144
|
+
"aria-expanded": open,
|
|
145
|
+
"aria-controls": open ? listId : void 0,
|
|
146
|
+
"aria-activedescendant": open && active >= 0 ? optionDomId(listId, active) : void 0,
|
|
147
|
+
"aria-required": required || void 0,
|
|
148
|
+
"aria-invalid": ariaInvalid ?? (invalid || void 0),
|
|
149
|
+
"aria-label": ariaLabel,
|
|
150
|
+
"aria-labelledby": ariaLabelledBy,
|
|
151
|
+
disabled,
|
|
152
|
+
"data-placeholder": showPlaceholder ? "" : void 0,
|
|
153
|
+
...props,
|
|
154
|
+
onClick: (event) => {
|
|
155
|
+
onClick?.(event);
|
|
156
|
+
event.currentTarget.focus({ preventScroll: true });
|
|
157
|
+
},
|
|
158
|
+
onKeyDown: handleKeyDown,
|
|
159
|
+
onKeyUp: (event) => {
|
|
160
|
+
onKeyUp?.(event);
|
|
161
|
+
if (event.key === " ") event.preventDefault();
|
|
162
|
+
},
|
|
163
|
+
className: cn(
|
|
164
|
+
"flex w-full min-w-0 items-center justify-between gap-2 rounded-input border-control bg-surface-control py-0 pr-2.5 pl-3 text-left text-control text-ink focus:border-transparent focus:outline-2 focus:outline-accent-ink focus:-outline-offset-1 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-danger",
|
|
165
|
+
size === "sm" ? "h-control-sm" : "h-input min-h-(--touch-target)",
|
|
166
|
+
classNames?.trigger,
|
|
167
|
+
className
|
|
168
|
+
),
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
className: cn(
|
|
174
|
+
"min-w-0 flex-1 truncate",
|
|
175
|
+
showPlaceholder && "text-ink-3",
|
|
176
|
+
classNames?.value
|
|
177
|
+
),
|
|
178
|
+
children: selected?.label ?? placeholder ?? strings.selectPlaceholder
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
ChevronDown,
|
|
183
|
+
{
|
|
184
|
+
"aria-hidden": "true",
|
|
185
|
+
className: cn("size-3.5 shrink-0 text-ink-3", classNames?.icon)
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: value ?? "", disabled }) : null,
|
|
192
|
+
/* @__PURE__ */ jsx(PopoverPrimitive.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
193
|
+
PopoverPrimitive.Content,
|
|
194
|
+
{
|
|
195
|
+
id: listId,
|
|
196
|
+
role: "listbox",
|
|
197
|
+
"data-ui-layer": "",
|
|
198
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel ?? listLabel ?? placeholder,
|
|
199
|
+
"aria-labelledby": ariaLabelledBy,
|
|
200
|
+
sideOffset: 4,
|
|
201
|
+
collisionPadding: 8,
|
|
202
|
+
align: "start",
|
|
203
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
204
|
+
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
205
|
+
className: cn(
|
|
206
|
+
LISTBOX_SURFACE,
|
|
207
|
+
materialClass(material, "surface-solid"),
|
|
208
|
+
classNames?.content
|
|
209
|
+
),
|
|
210
|
+
children: /* @__PURE__ */ jsx(
|
|
211
|
+
ListboxItems,
|
|
212
|
+
{
|
|
213
|
+
items: options,
|
|
214
|
+
flat,
|
|
215
|
+
idBase: listId,
|
|
216
|
+
isSelected: (option) => option.value === value,
|
|
217
|
+
activeIndex: active,
|
|
218
|
+
onActivate: setActive,
|
|
219
|
+
onPick: (option) => pick(flat.indexOf(option)),
|
|
220
|
+
optionClassName: classNames?.option,
|
|
221
|
+
groupClassName: classNames?.group
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
export {
|
|
229
|
+
SelectMenu
|
|
230
|
+
};
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -19,6 +19,75 @@ export interface UiStrings {
|
|
|
19
19
|
copied: string;
|
|
20
20
|
more: string;
|
|
21
21
|
remove: string;
|
|
22
|
+
noResults: string;
|
|
23
|
+
clear: string;
|
|
24
|
+
selectPlaceholder: string;
|
|
25
|
+
openCalendar: string;
|
|
26
|
+
calendar: string;
|
|
27
|
+
previousMonth: string;
|
|
28
|
+
nextMonth: string;
|
|
29
|
+
time: string;
|
|
30
|
+
/** BCP 47 locale used for date labels and the typed date format. */
|
|
31
|
+
locale: string;
|
|
32
|
+
dayPlaceholder: string;
|
|
33
|
+
monthPlaceholder: string;
|
|
34
|
+
yearPlaceholder: string;
|
|
35
|
+
back: string;
|
|
36
|
+
next: string;
|
|
37
|
+
finish: string;
|
|
38
|
+
/** Step announcement; `{current}`, `{total}` and `{label}` are replaced. */
|
|
39
|
+
stepOf: string;
|
|
40
|
+
steps: string;
|
|
41
|
+
/** Default accessible name of an `Aside`. */
|
|
42
|
+
aside: string;
|
|
43
|
+
/** Back action of a single-pane `ListDetail`. */
|
|
44
|
+
backToList: string;
|
|
45
|
+
/** Screen-reader state of a `DueChip` past its date. */
|
|
46
|
+
overdue: string;
|
|
47
|
+
/** Screen-reader state of a `DueChip` due within its `soonDays`. */
|
|
48
|
+
dueSoon: string;
|
|
49
|
+
/** Screen-reader state of a completed `Stepper` step. */
|
|
50
|
+
stepDone: string;
|
|
51
|
+
/** Screen-reader state of a `Stepper` step that has an error. */
|
|
52
|
+
stepError: string;
|
|
53
|
+
/** Name of a row checkbox in a `Table`; `{row}` is replaced by the row's label. */
|
|
54
|
+
selectRow: string;
|
|
55
|
+
/** Name of the select-all checkbox of a `Table`. */
|
|
56
|
+
selectAll: string;
|
|
57
|
+
/** Name of the overflow menu trigger of a `TableActionsCell`. */
|
|
58
|
+
rowActions: string;
|
|
59
|
+
/** Name of the `PasswordInput` toggle; its pressed state says whether the password is visible. */
|
|
60
|
+
showPassword: string;
|
|
61
|
+
/** Default title of a `LoginForm`. */
|
|
62
|
+
signIn: string;
|
|
63
|
+
/** Label of the portal picker of a `LoginForm`. */
|
|
64
|
+
signInAs: string;
|
|
65
|
+
/** Divider between the portal picker and the credential fields. */
|
|
66
|
+
withYourAccount: string;
|
|
67
|
+
/** Default label and placeholder of the `LoginForm` identifier field. */
|
|
68
|
+
identifier: string;
|
|
69
|
+
/** Default label and placeholder of the `LoginForm` password field. */
|
|
70
|
+
password: string;
|
|
71
|
+
/** Default `LoginForm` link to recover a password. */
|
|
72
|
+
forgotPassword: string;
|
|
73
|
+
/** Submit button label of a `LoginForm`. */
|
|
74
|
+
signInAction: string;
|
|
75
|
+
/** Inline error of a `LoginForm` submitted without an identifier. */
|
|
76
|
+
enterIdentifier: string;
|
|
77
|
+
/** Inline error of a `LoginForm` submitted without a password. */
|
|
78
|
+
enterPassword: string;
|
|
79
|
+
/** Label of the remember-me checkbox of `LoginForm.Options`. */
|
|
80
|
+
rememberMe: string;
|
|
81
|
+
/** Default help link of `LoginForm.Options`. */
|
|
82
|
+
needHelp: string;
|
|
83
|
+
/** Default label of `LoginForm.Providers`. */
|
|
84
|
+
orLogInWith: string;
|
|
85
|
+
/** Message shown by a `LoginForm` when sign-in fails and the app gives none. */
|
|
86
|
+
signInFailed: string;
|
|
87
|
+
/** Default headline of the `statement` look of `AuthIllustration`. */
|
|
88
|
+
welcomeBack: string;
|
|
89
|
+
/** Line the `statement` look of `AuthIllustration` shows once sign-in succeeds. */
|
|
90
|
+
signedIn: string;
|
|
22
91
|
}
|
|
23
92
|
export type UiLocale = "en" | "es";
|
|
24
93
|
export declare const uiStrings: {
|
|
@@ -43,6 +112,48 @@ export declare const uiStrings: {
|
|
|
43
112
|
readonly copied: "Copied";
|
|
44
113
|
readonly more: "More";
|
|
45
114
|
readonly remove: "Remove";
|
|
115
|
+
readonly noResults: "No results";
|
|
116
|
+
readonly clear: "Clear";
|
|
117
|
+
readonly selectPlaceholder: "Select…";
|
|
118
|
+
readonly openCalendar: "Open calendar";
|
|
119
|
+
readonly calendar: "Calendar";
|
|
120
|
+
readonly previousMonth: "Previous month";
|
|
121
|
+
readonly nextMonth: "Next month";
|
|
122
|
+
readonly time: "Time";
|
|
123
|
+
readonly locale: "en-US";
|
|
124
|
+
readonly dayPlaceholder: "dd";
|
|
125
|
+
readonly monthPlaceholder: "mm";
|
|
126
|
+
readonly yearPlaceholder: "yyyy";
|
|
127
|
+
readonly back: "Back";
|
|
128
|
+
readonly next: "Next";
|
|
129
|
+
readonly finish: "Finish";
|
|
130
|
+
readonly stepOf: "Step {current} of {total}: {label}";
|
|
131
|
+
readonly steps: "Steps";
|
|
132
|
+
readonly aside: "Related information";
|
|
133
|
+
readonly backToList: "Back to list";
|
|
134
|
+
readonly overdue: "Overdue";
|
|
135
|
+
readonly dueSoon: "Due soon";
|
|
136
|
+
readonly stepDone: "Completed";
|
|
137
|
+
readonly stepError: "Has an error";
|
|
138
|
+
readonly selectRow: "Select {row}";
|
|
139
|
+
readonly selectAll: "Select all rows";
|
|
140
|
+
readonly rowActions: "Row actions";
|
|
141
|
+
readonly showPassword: "Show password";
|
|
142
|
+
readonly signIn: "Sign in";
|
|
143
|
+
readonly signInAs: "Sign in as";
|
|
144
|
+
readonly withYourAccount: "with your account";
|
|
145
|
+
readonly identifier: "Email or ID";
|
|
146
|
+
readonly password: "Password";
|
|
147
|
+
readonly forgotPassword: "Forgot your password?";
|
|
148
|
+
readonly signInAction: "Sign in";
|
|
149
|
+
readonly enterIdentifier: "Enter your email or ID.";
|
|
150
|
+
readonly enterPassword: "Enter your password.";
|
|
151
|
+
readonly rememberMe: "Remember me";
|
|
152
|
+
readonly needHelp: "Need help?";
|
|
153
|
+
readonly orLogInWith: "Or log in with";
|
|
154
|
+
readonly signInFailed: "We could not sign you in. Check your details and try again.";
|
|
155
|
+
readonly welcomeBack: "Good to see you again.";
|
|
156
|
+
readonly signedIn: "You're in.";
|
|
46
157
|
};
|
|
47
158
|
readonly es: {
|
|
48
159
|
readonly retry: "Reintentar";
|
|
@@ -65,5 +176,47 @@ export declare const uiStrings: {
|
|
|
65
176
|
readonly copied: "Copiado";
|
|
66
177
|
readonly more: "Más";
|
|
67
178
|
readonly remove: "Quitar";
|
|
179
|
+
readonly noResults: "Sin resultados";
|
|
180
|
+
readonly clear: "Limpiar";
|
|
181
|
+
readonly selectPlaceholder: "Seleccionar…";
|
|
182
|
+
readonly openCalendar: "Abrir calendario";
|
|
183
|
+
readonly calendar: "Calendario";
|
|
184
|
+
readonly previousMonth: "Mes anterior";
|
|
185
|
+
readonly nextMonth: "Mes siguiente";
|
|
186
|
+
readonly time: "Hora";
|
|
187
|
+
readonly locale: "es-PE";
|
|
188
|
+
readonly dayPlaceholder: "dd";
|
|
189
|
+
readonly monthPlaceholder: "mm";
|
|
190
|
+
readonly yearPlaceholder: "aaaa";
|
|
191
|
+
readonly back: "Atrás";
|
|
192
|
+
readonly next: "Siguiente";
|
|
193
|
+
readonly finish: "Finalizar";
|
|
194
|
+
readonly stepOf: "Paso {current} de {total}: {label}";
|
|
195
|
+
readonly steps: "Pasos";
|
|
196
|
+
readonly aside: "Información relacionada";
|
|
197
|
+
readonly backToList: "Volver a la lista";
|
|
198
|
+
readonly overdue: "Vencido";
|
|
199
|
+
readonly dueSoon: "Vence pronto";
|
|
200
|
+
readonly stepDone: "Completado";
|
|
201
|
+
readonly stepError: "Tiene un error";
|
|
202
|
+
readonly selectRow: "Seleccionar {row}";
|
|
203
|
+
readonly selectAll: "Seleccionar todas las filas";
|
|
204
|
+
readonly rowActions: "Acciones de la fila";
|
|
205
|
+
readonly showPassword: "Mostrar contraseña";
|
|
206
|
+
readonly signIn: "Inicia sesión";
|
|
207
|
+
readonly signInAs: "Ingresar como";
|
|
208
|
+
readonly withYourAccount: "con tu cuenta";
|
|
209
|
+
readonly identifier: "Correo o documento";
|
|
210
|
+
readonly password: "Contraseña";
|
|
211
|
+
readonly forgotPassword: "¿Olvidaste tu contraseña?";
|
|
212
|
+
readonly signInAction: "Ingresar";
|
|
213
|
+
readonly enterIdentifier: "Escribe tu correo o documento.";
|
|
214
|
+
readonly enterPassword: "Escribe tu contraseña.";
|
|
215
|
+
readonly rememberMe: "Recordarme";
|
|
216
|
+
readonly needHelp: "¿Necesitas ayuda?";
|
|
217
|
+
readonly orLogInWith: "O ingresa con";
|
|
218
|
+
readonly signInFailed: "No pudimos iniciar tu sesión. Revisa tus datos e inténtalo de nuevo.";
|
|
219
|
+
readonly welcomeBack: "Qué bueno verte otra vez.";
|
|
220
|
+
readonly signedIn: "Ya estás dentro.";
|
|
68
221
|
};
|
|
69
222
|
};
|
package/dist/i18n/strings.js
CHANGED
|
@@ -19,7 +19,49 @@ const uiStrings = {
|
|
|
19
19
|
copy: "Copy",
|
|
20
20
|
copied: "Copied",
|
|
21
21
|
more: "More",
|
|
22
|
-
remove: "Remove"
|
|
22
|
+
remove: "Remove",
|
|
23
|
+
noResults: "No results",
|
|
24
|
+
clear: "Clear",
|
|
25
|
+
selectPlaceholder: "Select\u2026",
|
|
26
|
+
openCalendar: "Open calendar",
|
|
27
|
+
calendar: "Calendar",
|
|
28
|
+
previousMonth: "Previous month",
|
|
29
|
+
nextMonth: "Next month",
|
|
30
|
+
time: "Time",
|
|
31
|
+
locale: "en-US",
|
|
32
|
+
dayPlaceholder: "dd",
|
|
33
|
+
monthPlaceholder: "mm",
|
|
34
|
+
yearPlaceholder: "yyyy",
|
|
35
|
+
back: "Back",
|
|
36
|
+
next: "Next",
|
|
37
|
+
finish: "Finish",
|
|
38
|
+
stepOf: "Step {current} of {total}: {label}",
|
|
39
|
+
steps: "Steps",
|
|
40
|
+
aside: "Related information",
|
|
41
|
+
backToList: "Back to list",
|
|
42
|
+
overdue: "Overdue",
|
|
43
|
+
dueSoon: "Due soon",
|
|
44
|
+
stepDone: "Completed",
|
|
45
|
+
stepError: "Has an error",
|
|
46
|
+
selectRow: "Select {row}",
|
|
47
|
+
selectAll: "Select all rows",
|
|
48
|
+
rowActions: "Row actions",
|
|
49
|
+
showPassword: "Show password",
|
|
50
|
+
signIn: "Sign in",
|
|
51
|
+
signInAs: "Sign in as",
|
|
52
|
+
withYourAccount: "with your account",
|
|
53
|
+
identifier: "Email or ID",
|
|
54
|
+
password: "Password",
|
|
55
|
+
forgotPassword: "Forgot your password?",
|
|
56
|
+
signInAction: "Sign in",
|
|
57
|
+
enterIdentifier: "Enter your email or ID.",
|
|
58
|
+
enterPassword: "Enter your password.",
|
|
59
|
+
rememberMe: "Remember me",
|
|
60
|
+
needHelp: "Need help?",
|
|
61
|
+
orLogInWith: "Or log in with",
|
|
62
|
+
signInFailed: "We could not sign you in. Check your details and try again.",
|
|
63
|
+
welcomeBack: "Good to see you again.",
|
|
64
|
+
signedIn: "You're in."
|
|
23
65
|
},
|
|
24
66
|
es: {
|
|
25
67
|
retry: "Reintentar",
|
|
@@ -41,7 +83,49 @@ const uiStrings = {
|
|
|
41
83
|
copy: "Copiar",
|
|
42
84
|
copied: "Copiado",
|
|
43
85
|
more: "M\xE1s",
|
|
44
|
-
remove: "Quitar"
|
|
86
|
+
remove: "Quitar",
|
|
87
|
+
noResults: "Sin resultados",
|
|
88
|
+
clear: "Limpiar",
|
|
89
|
+
selectPlaceholder: "Seleccionar\u2026",
|
|
90
|
+
openCalendar: "Abrir calendario",
|
|
91
|
+
calendar: "Calendario",
|
|
92
|
+
previousMonth: "Mes anterior",
|
|
93
|
+
nextMonth: "Mes siguiente",
|
|
94
|
+
time: "Hora",
|
|
95
|
+
locale: "es-PE",
|
|
96
|
+
dayPlaceholder: "dd",
|
|
97
|
+
monthPlaceholder: "mm",
|
|
98
|
+
yearPlaceholder: "aaaa",
|
|
99
|
+
back: "Atr\xE1s",
|
|
100
|
+
next: "Siguiente",
|
|
101
|
+
finish: "Finalizar",
|
|
102
|
+
stepOf: "Paso {current} de {total}: {label}",
|
|
103
|
+
steps: "Pasos",
|
|
104
|
+
aside: "Informaci\xF3n relacionada",
|
|
105
|
+
backToList: "Volver a la lista",
|
|
106
|
+
overdue: "Vencido",
|
|
107
|
+
dueSoon: "Vence pronto",
|
|
108
|
+
stepDone: "Completado",
|
|
109
|
+
stepError: "Tiene un error",
|
|
110
|
+
selectRow: "Seleccionar {row}",
|
|
111
|
+
selectAll: "Seleccionar todas las filas",
|
|
112
|
+
rowActions: "Acciones de la fila",
|
|
113
|
+
showPassword: "Mostrar contrase\xF1a",
|
|
114
|
+
signIn: "Inicia sesi\xF3n",
|
|
115
|
+
signInAs: "Ingresar como",
|
|
116
|
+
withYourAccount: "con tu cuenta",
|
|
117
|
+
identifier: "Correo o documento",
|
|
118
|
+
password: "Contrase\xF1a",
|
|
119
|
+
forgotPassword: "\xBFOlvidaste tu contrase\xF1a?",
|
|
120
|
+
signInAction: "Ingresar",
|
|
121
|
+
enterIdentifier: "Escribe tu correo o documento.",
|
|
122
|
+
enterPassword: "Escribe tu contrase\xF1a.",
|
|
123
|
+
rememberMe: "Recordarme",
|
|
124
|
+
needHelp: "\xBFNecesitas ayuda?",
|
|
125
|
+
orLogInWith: "O ingresa con",
|
|
126
|
+
signInFailed: "No pudimos iniciar tu sesi\xF3n. Revisa tus datos e int\xE9ntalo de nuevo.",
|
|
127
|
+
welcomeBack: "Qu\xE9 bueno verte otra vez.",
|
|
128
|
+
signedIn: "Ya est\xE1s dentro."
|
|
45
129
|
}
|
|
46
130
|
};
|
|
47
131
|
export {
|
|
@@ -3,7 +3,7 @@ import { type UiLocale, type UiStrings } from "./strings.js";
|
|
|
3
3
|
export interface UiStringsProviderProps {
|
|
4
4
|
/** Preset to start from. Without it the provider keeps the strings of its parent (default `en`). */
|
|
5
5
|
locale?: UiLocale;
|
|
6
|
-
/** Overrides applied on top of the preset. */
|
|
6
|
+
/** Overrides applied on top of the preset. Missing or empty entries keep the preset string. */
|
|
7
7
|
strings?: Partial<UiStrings>;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
4
|
import { uiStrings } from "./strings.js";
|
|
5
|
-
const
|
|
5
|
+
const registry = /* @__PURE__ */ Symbol.for("@jcsoftdev/ui/i18n/strings");
|
|
6
|
+
const shared = globalThis;
|
|
7
|
+
const UiStringsContext = shared[registry] ?? createContext(uiStrings.en);
|
|
8
|
+
shared[registry] = UiStringsContext;
|
|
9
|
+
const defined = (strings) => Object.fromEntries(Object.entries(strings ?? {}).filter(([, value]) => value));
|
|
6
10
|
function UiStringsProvider({ locale, strings, children }) {
|
|
7
11
|
const parent = useContext(UiStringsContext);
|
|
8
12
|
const value = useMemo(
|
|
9
|
-
() => ({ ...locale ? uiStrings[locale] : parent, ...strings }),
|
|
13
|
+
() => ({ ...locale ? uiStrings[locale] : parent, ...defined(strings) }),
|
|
10
14
|
[locale, strings, parent]
|
|
11
15
|
);
|
|
12
16
|
return /* @__PURE__ */ jsx(UiStringsContext.Provider, { value, children });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBase } from "./icon-base.js";
|
|
3
|
+
function Eye(props) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(IconBase, { ...props, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }),
|
|
6
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
7
|
+
] });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
Eye
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBase } from "./icon-base.js";
|
|
3
|
+
function GraduationCap(props) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(IconBase, { ...props, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { d: "M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z" }),
|
|
6
|
+
/* @__PURE__ */ jsx("path", { d: "M22 10v6" }),
|
|
7
|
+
/* @__PURE__ */ jsx("path", { d: "M6 12.5V16a6 3 0 0 0 12 0v-3.5" })
|
|
8
|
+
] });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
GraduationCap
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBase } from "./icon-base.js";
|
|
3
|
+
function House(props) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(IconBase, { ...props, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }),
|
|
6
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" })
|
|
7
|
+
] });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
House
|
|
11
|
+
};
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export { CreditCard } from "./credit-card.js";
|
|
|
53
53
|
export { Download } from "./download.js";
|
|
54
54
|
export { EllipsisVertical } from "./ellipsis-vertical.js";
|
|
55
55
|
export { ExternalLink } from "./external-link.js";
|
|
56
|
+
export { Eye } from "./eye.js";
|
|
56
57
|
export { EyeOff } from "./eye-off.js";
|
|
57
58
|
export { FaceSlightlySmiling } from "./face-slightly-smiling.js";
|
|
58
59
|
export { FaceSlightlySmilingPlus } from "./face-slightly-smiling-plus.js";
|
|
@@ -65,8 +66,10 @@ export { Filter } from "./filter.js";
|
|
|
65
66
|
export { Folder } from "./folder.js";
|
|
66
67
|
export { FolderOpen } from "./folder-open.js";
|
|
67
68
|
export { Funnel } from "./funnel.js";
|
|
69
|
+
export { GraduationCap } from "./graduation-cap.js";
|
|
68
70
|
export { GripVertical } from "./grip-vertical.js";
|
|
69
71
|
export { Heading2 } from "./heading-2.js";
|
|
72
|
+
export { House } from "./house.js";
|
|
70
73
|
export { Inbox } from "./inbox.js";
|
|
71
74
|
export { Info } from "./info.js";
|
|
72
75
|
export { Italic } from "./italic.js";
|
|
@@ -83,6 +86,7 @@ export { ListOrdered } from "./list-ordered.js";
|
|
|
83
86
|
export { LoaderCircle } from "./loader-circle.js";
|
|
84
87
|
export { Lock } from "./lock.js";
|
|
85
88
|
export { LogOut } from "./log-out.js";
|
|
89
|
+
export { Mail } from "./mail.js";
|
|
86
90
|
export { MapPin } from "./map-pin.js";
|
|
87
91
|
export { Menu } from "./menu.js";
|
|
88
92
|
export { MessageCircle } from "./message-circle.js";
|
package/dist/icons/index.js
CHANGED
|
@@ -53,6 +53,7 @@ import { CreditCard } from "./credit-card.js";
|
|
|
53
53
|
import { Download } from "./download.js";
|
|
54
54
|
import { EllipsisVertical } from "./ellipsis-vertical.js";
|
|
55
55
|
import { ExternalLink } from "./external-link.js";
|
|
56
|
+
import { Eye } from "./eye.js";
|
|
56
57
|
import { EyeOff } from "./eye-off.js";
|
|
57
58
|
import { FaceSlightlySmiling } from "./face-slightly-smiling.js";
|
|
58
59
|
import { FaceSlightlySmilingPlus } from "./face-slightly-smiling-plus.js";
|
|
@@ -65,8 +66,10 @@ import { Filter } from "./filter.js";
|
|
|
65
66
|
import { Folder } from "./folder.js";
|
|
66
67
|
import { FolderOpen } from "./folder-open.js";
|
|
67
68
|
import { Funnel } from "./funnel.js";
|
|
69
|
+
import { GraduationCap } from "./graduation-cap.js";
|
|
68
70
|
import { GripVertical } from "./grip-vertical.js";
|
|
69
71
|
import { Heading2 } from "./heading-2.js";
|
|
72
|
+
import { House } from "./house.js";
|
|
70
73
|
import { Inbox } from "./inbox.js";
|
|
71
74
|
import { Info } from "./info.js";
|
|
72
75
|
import { Italic } from "./italic.js";
|
|
@@ -83,6 +86,7 @@ import { ListOrdered } from "./list-ordered.js";
|
|
|
83
86
|
import { LoaderCircle } from "./loader-circle.js";
|
|
84
87
|
import { Lock } from "./lock.js";
|
|
85
88
|
import { LogOut } from "./log-out.js";
|
|
89
|
+
import { Mail } from "./mail.js";
|
|
86
90
|
import { MapPin } from "./map-pin.js";
|
|
87
91
|
import { Menu } from "./menu.js";
|
|
88
92
|
import { MessageCircle } from "./message-circle.js";
|
|
@@ -200,6 +204,7 @@ export {
|
|
|
200
204
|
Download,
|
|
201
205
|
EllipsisVertical,
|
|
202
206
|
ExternalLink,
|
|
207
|
+
Eye,
|
|
203
208
|
EyeOff,
|
|
204
209
|
FaceSlightlySmiling,
|
|
205
210
|
FaceSlightlySmilingPlus,
|
|
@@ -212,8 +217,10 @@ export {
|
|
|
212
217
|
Folder,
|
|
213
218
|
FolderOpen,
|
|
214
219
|
Funnel,
|
|
220
|
+
GraduationCap,
|
|
215
221
|
GripVertical,
|
|
216
222
|
Heading2,
|
|
223
|
+
House,
|
|
217
224
|
Inbox,
|
|
218
225
|
Info,
|
|
219
226
|
Italic,
|
|
@@ -230,6 +237,7 @@ export {
|
|
|
230
237
|
LoaderCircle,
|
|
231
238
|
Lock,
|
|
232
239
|
LogOut,
|
|
240
|
+
Mail,
|
|
233
241
|
MapPin,
|
|
234
242
|
Menu,
|
|
235
243
|
MessageCircle,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBase } from "./icon-base.js";
|
|
3
|
+
function Mail(props) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(IconBase, { ...props, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }),
|
|
6
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" })
|
|
7
|
+
] });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
Mail
|
|
11
|
+
};
|