@nizivo/react 0.0.0-stage → 0.2.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/LICENSE +202 -0
- package/README.md +120 -2
- package/THIRD_PARTY_NOTICES +68 -0
- package/dist/_engines/react-aria/dialog.client.js +126 -0
- package/dist/_engines/react-aria/dom-allowlist.js +19 -0
- package/dist/_engines/react-aria/dom.js +31 -0
- package/dist/_engines/react-aria/drawer.client.js +8 -0
- package/dist/_engines/react-aria/file-upload.client.js +50 -0
- package/dist/_engines/react-aria/locale.client.js +13 -0
- package/dist/_engines/react-aria/menu.client.js +229 -0
- package/dist/_engines/react-aria/open-state.client.js +53 -0
- package/dist/_engines/react-aria/outside-press.client.js +61 -0
- package/dist/_engines/react-aria/overlay.client.js +46 -0
- package/dist/_engines/react-aria/popover.client.js +148 -0
- package/dist/_engines/react-aria/popup.client.js +153 -0
- package/dist/_engines/react-aria/select.client.js +180 -0
- package/dist/_engines/react-aria/tabs.client.js +95 -0
- package/dist/_engines/react-aria/toast.client.js +38 -0
- package/dist/_engines/react-aria/tooltip.client.js +72 -0
- package/dist/_internal/cx.js +11 -0
- package/dist/_internal/data-status.d.ts +3 -0
- package/dist/_internal/data-status.js +13 -0
- package/dist/_internal/engine-part.d.ts +1 -0
- package/dist/_internal/field.js +20 -0
- package/dist/_internal/glyphs.js +87 -0
- package/dist/_internal/keys.js +62 -0
- package/dist/_internal/modal.client.js +54 -0
- package/dist/_internal/nested-focus.js +33 -0
- package/dist/_internal/overlay.d.ts +9 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/alert/alert-dismiss.client.d.ts +32 -0
- package/dist/alert/alert-dismiss.client.js +38 -0
- package/dist/alert/alert.d.ts +28 -0
- package/dist/alert/alert.js +44 -0
- package/dist/alert/index.d.ts +3 -0
- package/dist/alert/index.js +3 -0
- package/dist/app-shell/app-shell.d.ts +24 -0
- package/dist/app-shell/app-shell.js +56 -0
- package/dist/app-shell/index.d.ts +2 -0
- package/dist/app-shell/index.js +1 -0
- package/dist/augment.d.ts +13 -0
- package/dist/augment.js +0 -0
- package/dist/avatar/avatar.d.ts +96 -0
- package/dist/avatar/avatar.js +94 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +1 -0
- package/dist/badge/badge.d.ts +19 -0
- package/dist/badge/badge.js +22 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +1 -0
- package/dist/banner/banner-dismiss.client.d.ts +32 -0
- package/dist/banner/banner-dismiss.client.js +38 -0
- package/dist/banner/banner.d.ts +34 -0
- package/dist/banner/banner.js +47 -0
- package/dist/banner/index.d.ts +3 -0
- package/dist/banner/index.js +3 -0
- package/dist/breadcrumb/breadcrumb.d.ts +46 -0
- package/dist/breadcrumb/breadcrumb.js +46 -0
- package/dist/breadcrumb/breadcrumb.parts.d.ts +6 -0
- package/dist/breadcrumb/breadcrumb.parts.js +9 -0
- package/dist/breadcrumb/index.d.ts +3 -0
- package/dist/breadcrumb/index.js +3 -0
- package/dist/button/button.d.ts +55 -0
- package/dist/button/button.js +62 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +1 -0
- package/dist/card/card.d.ts +64 -0
- package/dist/card/card.js +62 -0
- package/dist/card/card.parts.d.ts +6 -0
- package/dist/card/card.parts.js +14 -0
- package/dist/card/index.d.ts +3 -0
- package/dist/card/index.js +3 -0
- package/dist/checkbox/checkbox.client.d.ts +37 -0
- package/dist/checkbox/checkbox.client.js +81 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/chip-group/chip-group.client.d.ts +88 -0
- package/dist/chip-group/chip-group.client.js +157 -0
- package/dist/chip-group/index.d.ts +2 -0
- package/dist/chip-group/index.js +1 -0
- package/dist/choice-card/choice-card.client.d.ts +66 -0
- package/dist/choice-card/choice-card.client.js +138 -0
- package/dist/choice-card/index.d.ts +2 -0
- package/dist/choice-card/index.js +1 -0
- package/dist/config/config.client.d.ts +24 -0
- package/dist/config/config.client.js +33 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +1 -0
- package/dist/container/container.d.ts +13 -0
- package/dist/container/container.js +16 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/container/index.js +1 -0
- package/dist/contracts/details.d.ts +13 -0
- package/dist/contracts/details.js +9 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/merge-props.d.ts +16 -0
- package/dist/contracts/merge-props.js +76 -0
- package/dist/contracts/render.d.ts +17 -0
- package/dist/contracts/render.js +43 -0
- package/dist/contracts/state.d.ts +42 -0
- package/dist/contracts/state.js +42 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/app-shell.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/banner.css +2 -0
- package/dist/css/base.css +2 -0
- package/dist/css/breadcrumb.css +2 -0
- package/dist/css/button.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/checkbox.css +2 -0
- package/dist/css/chip-group.css +2 -0
- package/dist/css/choice-card.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/delta.css +2 -0
- package/dist/css/dialog.css +2 -0
- package/dist/css/drawer.css +2 -0
- package/dist/css/empty-state.css +2 -0
- package/dist/css/field.css +2 -0
- package/dist/css/fieldset.css +2 -0
- package/dist/css/file-upload.css +2 -0
- package/dist/css/form.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/heading.css +2 -0
- package/dist/css/icon-button.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/inline-error.css +2 -0
- package/dist/css/inline.css +2 -0
- package/dist/css/input.css +2 -0
- package/dist/css/kbd.css +2 -0
- package/dist/css/kpi-tile.css +2 -0
- package/dist/css/menu.css +2 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/metric.css +2 -0
- package/dist/css/mobile-tab-bar.css +2 -0
- package/dist/css/mobile-top-bar.css +2 -0
- package/dist/css/motion.css +2 -0
- package/dist/css/native-select.css +2 -0
- package/dist/css/nav-item.css +2 -0
- package/dist/css/number-value.css +2 -0
- package/dist/css/page-header.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/password-input.css +2 -0
- package/dist/css/popover.css +2 -0
- package/dist/css/progress-bar.css +2 -0
- package/dist/css/progress-ring.css +2 -0
- package/dist/css/radio-group.css +2 -0
- package/dist/css/ranked-list.css +2 -0
- package/dist/css/search-field.css +2 -0
- package/dist/css/segmented-control.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/separator.css +2 -0
- package/dist/css/sidebar.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/split.css +2 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/sticky-bar.css +2 -0
- package/dist/css/switch.css +2 -0
- package/dist/css/tab-nav.css +2 -0
- package/dist/css/table-selection.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/text.css +2 -0
- package/dist/css/textarea.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/top-bar.css +2 -0
- package/dist/css/trend-card.css +2 -0
- package/dist/delta/delta.d.ts +32 -0
- package/dist/delta/delta.js +50 -0
- package/dist/delta/index.d.ts +2 -0
- package/dist/delta/index.js +1 -0
- package/dist/dialog/dialog.client.d.ts +25 -0
- package/dist/dialog/dialog.client.js +145 -0
- package/dist/dialog/dialog.contract.d.ts +97 -0
- package/dist/dialog/dialog.parts.d.ts +6 -0
- package/dist/dialog/dialog.parts.js +15 -0
- package/dist/dialog/index.d.ts +5 -0
- package/dist/dialog/index.js +3 -0
- package/dist/drawer/drawer.client.d.ts +25 -0
- package/dist/drawer/drawer.client.js +154 -0
- package/dist/drawer/drawer.contract.d.ts +98 -0
- package/dist/drawer/drawer.parts.d.ts +6 -0
- package/dist/drawer/drawer.parts.js +16 -0
- package/dist/drawer/index.d.ts +5 -0
- package/dist/drawer/index.js +3 -0
- package/dist/empty-state/empty-state.d.ts +18 -0
- package/dist/empty-state/empty-state.js +32 -0
- package/dist/empty-state/index.d.ts +2 -0
- package/dist/empty-state/index.js +1 -0
- package/dist/field/field-scope.client.d.ts +50 -0
- package/dist/field/field-scope.client.js +212 -0
- package/dist/field/field-static.d.ts +122 -0
- package/dist/field/field-static.js +159 -0
- package/dist/field/field.d.ts +5 -0
- package/dist/field/field.js +53 -0
- package/dist/field/index.d.ts +4 -0
- package/dist/field/index.js +4 -0
- package/dist/fieldset/fieldset.d.ts +36 -0
- package/dist/fieldset/fieldset.js +63 -0
- package/dist/fieldset/index.d.ts +2 -0
- package/dist/fieldset/index.js +1 -0
- package/dist/file-upload/file-upload.client.d.ts +9 -0
- package/dist/file-upload/file-upload.client.js +406 -0
- package/dist/file-upload/file-upload.contract.d.ts +112 -0
- package/dist/file-upload/index.d.ts +3 -0
- package/dist/file-upload/index.js +1 -0
- package/dist/file-upload/seam.d.ts +1 -0
- package/dist/form/form.client.d.ts +38 -0
- package/dist/form/form.client.js +127 -0
- package/dist/form/form.d.ts +36 -0
- package/dist/form/form.js +29 -0
- package/dist/form/index.d.ts +4 -0
- package/dist/form/index.js +4 -0
- package/dist/form/submit-button.client.d.ts +20 -0
- package/dist/form/submit-button.client.js +19 -0
- package/dist/grid/grid.d.ts +38 -0
- package/dist/grid/grid.js +28 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +1 -0
- package/dist/heading/heading.d.ts +30 -0
- package/dist/heading/heading.js +26 -0
- package/dist/heading/index.d.ts +2 -0
- package/dist/heading/index.js +1 -0
- package/dist/i18n/format-label.d.ts +24 -0
- package/dist/i18n/format-label.js +19 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +1 -0
- package/dist/icon-button/icon-button-static.d.ts +23 -0
- package/dist/icon-button/icon-button-static.js +83 -0
- package/dist/icon-button/icon-button.client.js +29 -0
- package/dist/icon-button/icon-button.contract.d.ts +89 -0
- package/dist/icon-button/icon-button.d.ts +5 -0
- package/dist/icon-button/icon-button.js +21 -0
- package/dist/icon-button/index.d.ts +4 -0
- package/dist/icon-button/index.js +3 -0
- package/dist/image/image.d.ts +28 -0
- package/dist/image/image.js +24 -0
- package/dist/image/index.d.ts +2 -0
- package/dist/image/index.js +1 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +96 -0
- package/dist/inline/index.d.ts +2 -0
- package/dist/inline/index.js +1 -0
- package/dist/inline/inline.d.ts +16 -0
- package/dist/inline/inline.js +14 -0
- package/dist/inline-error/index.d.ts +2 -0
- package/dist/inline-error/index.js +1 -0
- package/dist/inline-error/inline-error.d.ts +17 -0
- package/dist/inline-error/inline-error.js +33 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +1 -0
- package/dist/input/input.client.d.ts +39 -0
- package/dist/input/input.client.js +82 -0
- package/dist/kbd/index.d.ts +2 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/kbd.d.ts +19 -0
- package/dist/kbd/kbd.js +68 -0
- package/dist/kpi-tile/index.d.ts +2 -0
- package/dist/kpi-tile/index.js +1 -0
- package/dist/kpi-tile/kpi-tile.d.ts +30 -0
- package/dist/kpi-tile/kpi-tile.js +48 -0
- package/dist/locales/en-US.d.ts +77 -0
- package/dist/locales/en-US.js +83 -0
- package/dist/menu/index.d.ts +5 -0
- package/dist/menu/index.js +3 -0
- package/dist/menu/menu.client.d.ts +14 -0
- package/dist/menu/menu.client.js +152 -0
- package/dist/menu/menu.contract.d.ts +152 -0
- package/dist/menu/menu.parts.d.ts +6 -0
- package/dist/menu/menu.parts.js +17 -0
- package/dist/meter/index.d.ts +2 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/meter.d.ts +43 -0
- package/dist/meter/meter.js +59 -0
- package/dist/metric/index.d.ts +2 -0
- package/dist/metric/index.js +1 -0
- package/dist/metric/metric.d.ts +72 -0
- package/dist/metric/metric.js +116 -0
- package/dist/mobile-tab-bar/index.d.ts +4 -0
- package/dist/mobile-tab-bar/index.js +4 -0
- package/dist/mobile-tab-bar/mobile-tab-bar-inset.client.js +38 -0
- package/dist/mobile-tab-bar/mobile-tab-bar-more.client.d.ts +26 -0
- package/dist/mobile-tab-bar/mobile-tab-bar-more.client.js +60 -0
- package/dist/mobile-tab-bar/mobile-tab-bar.d.ts +39 -0
- package/dist/mobile-tab-bar/mobile-tab-bar.js +54 -0
- package/dist/mobile-tab-bar/mobile-tab-bar.parts.d.ts +6 -0
- package/dist/mobile-tab-bar/mobile-tab-bar.parts.js +9 -0
- package/dist/mobile-top-bar/index.d.ts +2 -0
- package/dist/mobile-top-bar/index.js +1 -0
- package/dist/mobile-top-bar/mobile-top-bar.d.ts +17 -0
- package/dist/mobile-top-bar/mobile-top-bar.js +31 -0
- package/dist/motion/count-up.client.d.ts +39 -0
- package/dist/motion/count-up.client.js +109 -0
- package/dist/motion/index.d.ts +2 -0
- package/dist/motion/index.js +1 -0
- package/dist/native-select/index.d.ts +2 -0
- package/dist/native-select/index.js +1 -0
- package/dist/native-select/native-select.d.ts +43 -0
- package/dist/native-select/native-select.js +56 -0
- package/dist/nav-item/index.d.ts +2 -0
- package/dist/nav-item/index.js +1 -0
- package/dist/nav-item/nav-item.d.ts +35 -0
- package/dist/nav-item/nav-item.js +50 -0
- package/dist/number-value/index.d.ts +2 -0
- package/dist/number-value/index.js +1 -0
- package/dist/number-value/number-value.d.ts +25 -0
- package/dist/number-value/number-value.js +26 -0
- package/dist/page-header/index.d.ts +2 -0
- package/dist/page-header/index.js +1 -0
- package/dist/page-header/page-header.d.ts +19 -0
- package/dist/page-header/page-header.js +39 -0
- package/dist/pagination/index.d.ts +2 -0
- package/dist/pagination/index.js +1 -0
- package/dist/pagination/pagination.d.ts +74 -0
- package/dist/pagination/pagination.js +136 -0
- package/dist/password-input/index.d.ts +2 -0
- package/dist/password-input/index.js +1 -0
- package/dist/password-input/password-input.client.d.ts +52 -0
- package/dist/password-input/password-input.client.js +106 -0
- package/dist/popover/index.d.ts +5 -0
- package/dist/popover/index.js +3 -0
- package/dist/popover/popover.client.d.ts +20 -0
- package/dist/popover/popover.client.js +113 -0
- package/dist/popover/popover.contract.d.ts +88 -0
- package/dist/popover/popover.parts.d.ts +6 -0
- package/dist/popover/popover.parts.js +13 -0
- package/dist/progress-bar/index.d.ts +2 -0
- package/dist/progress-bar/index.js +1 -0
- package/dist/progress-bar/progress-bar.d.ts +34 -0
- package/dist/progress-bar/progress-bar.js +55 -0
- package/dist/progress-ring/index.d.ts +2 -0
- package/dist/progress-ring/index.js +1 -0
- package/dist/progress-ring/progress-ring.d.ts +38 -0
- package/dist/progress-ring/progress-ring.js +67 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.js +3 -0
- package/dist/radio-group/radio-group.client.d.ts +22 -0
- package/dist/radio-group/radio-group.client.js +70 -0
- package/dist/radio-group/radio-group.d.ts +28 -0
- package/dist/radio-group/radio-group.js +35 -0
- package/dist/ranked-list/index.d.ts +3 -0
- package/dist/ranked-list/index.js +3 -0
- package/dist/ranked-list/ranked-list.d.ts +85 -0
- package/dist/ranked-list/ranked-list.js +153 -0
- package/dist/ranked-list/ranked-list.parts.d.ts +6 -0
- package/dist/ranked-list/ranked-list.parts.js +10 -0
- package/dist/search-field/index.d.ts +2 -0
- package/dist/search-field/index.js +1 -0
- package/dist/search-field/search-field.client.d.ts +55 -0
- package/dist/search-field/search-field.client.js +136 -0
- package/dist/segmented-control/index.d.ts +3 -0
- package/dist/segmented-control/index.js +3 -0
- package/dist/segmented-control/segmented-control.client.d.ts +61 -0
- package/dist/segmented-control/segmented-control.client.js +156 -0
- package/dist/segmented-control/segmented-control.parts.d.ts +6 -0
- package/dist/segmented-control/segmented-control.parts.js +9 -0
- package/dist/select/index.d.ts +5 -0
- package/dist/select/index.js +3 -0
- package/dist/select/select.client.d.ts +12 -0
- package/dist/select/select.client.js +152 -0
- package/dist/select/select.contract.d.ts +119 -0
- package/dist/select/select.parts.d.ts +6 -0
- package/dist/select/select.parts.js +15 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +1 -0
- package/dist/separator/separator.d.ts +26 -0
- package/dist/separator/separator.js +23 -0
- package/dist/sidebar/index.d.ts +4 -0
- package/dist/sidebar/index.js +4 -0
- package/dist/sidebar/sidebar-item.client.d.ts +10 -0
- package/dist/sidebar/sidebar-item.client.js +55 -0
- package/dist/sidebar/sidebar.d.ts +45 -0
- package/dist/sidebar/sidebar.js +62 -0
- package/dist/sidebar/sidebar.parts.d.ts +6 -0
- package/dist/sidebar/sidebar.parts.js +11 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/skeleton.d.ts +20 -0
- package/dist/skeleton/skeleton.js +19 -0
- package/dist/split/index.d.ts +3 -0
- package/dist/split/index.js +3 -0
- package/dist/split/split.d.ts +28 -0
- package/dist/split/split.js +33 -0
- package/dist/split/split.parts.d.ts +6 -0
- package/dist/split/split.parts.js +10 -0
- package/dist/stack/index.d.ts +2 -0
- package/dist/stack/index.js +1 -0
- package/dist/stack/stack.d.ts +17 -0
- package/dist/stack/stack.js +14 -0
- package/dist/sticky-bar/index.d.ts +2 -0
- package/dist/sticky-bar/index.js +1 -0
- package/dist/sticky-bar/sticky-bar.d.ts +16 -0
- package/dist/sticky-bar/sticky-bar.js +26 -0
- package/dist/styles.css +595 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/switch.client.d.ts +33 -0
- package/dist/switch/switch.client.js +63 -0
- package/dist/tab-nav/index.d.ts +3 -0
- package/dist/tab-nav/index.js +3 -0
- package/dist/tab-nav/tab-nav.d.ts +36 -0
- package/dist/tab-nav/tab-nav.js +47 -0
- package/dist/tab-nav/tab-nav.parts.d.ts +6 -0
- package/dist/tab-nav/tab-nav.parts.js +9 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +3 -0
- package/dist/table/table.d.ts +101 -0
- package/dist/table/table.js +121 -0
- package/dist/table/table.parts.d.ts +6 -0
- package/dist/table/table.parts.js +18 -0
- package/dist/table-selection/index.d.ts +3 -0
- package/dist/table-selection/index.js +3 -0
- package/dist/table-selection/table-selection.client.d.ts +14 -0
- package/dist/table-selection/table-selection.client.js +84 -0
- package/dist/table-selection/table-selection.d.ts +34 -0
- package/dist/table-selection/table-selection.js +50 -0
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/tabs.client.d.ts +8 -0
- package/dist/tabs/tabs.client.js +68 -0
- package/dist/tabs/tabs.contract.d.ts +89 -0
- package/dist/tabs/tabs.parts.d.ts +6 -0
- package/dist/tabs/tabs.parts.js +11 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.js +1 -0
- package/dist/text/text.d.ts +32 -0
- package/dist/text/text.js +17 -0
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/textarea.client.d.ts +18 -0
- package/dist/textarea/textarea.client.js +31 -0
- package/dist/theme-script/index.d.ts +2 -0
- package/dist/theme-script/index.js +1 -0
- package/dist/theme-script/theme-script.d.ts +43 -0
- package/dist/theme-script/theme-script.js +46 -0
- package/dist/toast/index.d.ts +4 -0
- package/dist/toast/index.js +3 -0
- package/dist/toast/seam.d.ts +2 -0
- package/dist/toast/store.d.ts +19 -0
- package/dist/toast/store.js +136 -0
- package/dist/toast/toast.contract.d.ts +56 -0
- package/dist/toast/toaster.client.d.ts +10 -0
- package/dist/toast/toaster.client.js +305 -0
- package/dist/tooltip/index.d.ts +5 -0
- package/dist/tooltip/index.js +3 -0
- package/dist/tooltip/tooltip.client.d.ts +12 -0
- package/dist/tooltip/tooltip.client.js +51 -0
- package/dist/tooltip/tooltip.contract.d.ts +60 -0
- package/dist/tooltip/tooltip.parts.d.ts +6 -0
- package/dist/tooltip/tooltip.parts.js +10 -0
- package/dist/top-bar/index.d.ts +2 -0
- package/dist/top-bar/index.js +1 -0
- package/dist/top-bar/top-bar.d.ts +17 -0
- package/dist/top-bar/top-bar.js +35 -0
- package/dist/trend-card/index.d.ts +2 -0
- package/dist/trend-card/index.js +1 -0
- package/dist/trend-card/trend-card.d.ts +34 -0
- package/dist/trend-card/trend-card.js +74 -0
- package/package.json +447 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ControlSize } from "../augment.js";
|
|
3
|
+
import { ComponentPropsWithRef, JSX, ReactNode } from "react";
|
|
4
|
+
//#region src/input/input.client.d.ts
|
|
5
|
+
/** Text-like input types; the others (checkbox, file, date, …) are other components. */
|
|
6
|
+
export type InputType = "text" | "email" | "search" | "password" | "number" | "tel" | "url";
|
|
7
|
+
export interface InputState {
|
|
8
|
+
size: ControlSize;
|
|
9
|
+
/** An error message is presented (the Field's, or the `invalid` prop). */
|
|
10
|
+
invalid: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface InputProps extends Omit<ComponentPropsWithRef<"input">, "type" | "size" | "prefix" | "children"> {
|
|
15
|
+
/** @default 'text' */
|
|
16
|
+
type?: InputType;
|
|
17
|
+
/** 32 / 40 / 48 px, as Button and Select. @default 'md' */
|
|
18
|
+
size?: ControlSize;
|
|
19
|
+
/**
|
|
20
|
+
* An error message is presented for this input (§8.3). Inside a Field, the Field sets it; an
|
|
21
|
+
* explicit value here wins.
|
|
22
|
+
*/
|
|
23
|
+
invalid?: boolean;
|
|
24
|
+
/** Decorative icon before the value (`aria-hidden`). */
|
|
25
|
+
leadingIcon?: ReactNode;
|
|
26
|
+
/** Decorative icon after the value (`aria-hidden`). */
|
|
27
|
+
trailingIcon?: ReactNode;
|
|
28
|
+
/** Text before the value, such as a currency sign; joined to the input's `aria-describedby`. */
|
|
29
|
+
prefix?: ReactNode;
|
|
30
|
+
/** Text after the value, such as a unit; joined to the input's `aria-describedby`. */
|
|
31
|
+
suffix?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Composition of the root, the bordered box around the native `<input>`. `className` and `style`
|
|
34
|
+
* go on the root too; every other prop, `ref` included, goes on the `<input>`.
|
|
35
|
+
*/
|
|
36
|
+
render?: RenderProp<InputState>;
|
|
37
|
+
}
|
|
38
|
+
export declare function Input({ type, size, id, name, required, disabled, readOnly, invalid, "aria-invalid": ariaInvalid, "aria-describedby": describedBy, leadingIcon, trailingIcon, prefix, suffix, render, className, style, ...rest }: InputProps): JSX.Element;
|
|
39
|
+
//#endregion
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../_internal/cx.js";
|
|
3
|
+
import { mergeProps } from "../contracts/merge-props.js";
|
|
4
|
+
import { renderElement } from "../contracts/render.js";
|
|
5
|
+
import { stateAttrs } from "../contracts/state.js";
|
|
6
|
+
import { joinIds } from "../_internal/field.js";
|
|
7
|
+
import { useFieldControl } from "../field/field-scope.client.js";
|
|
8
|
+
import { useId } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/input/input.client.tsx
|
|
11
|
+
function Input({ type = "text", size = "md", id, name, required, disabled, readOnly, invalid, "aria-invalid": ariaInvalid, "aria-describedby": describedBy, leadingIcon, trailingIcon, prefix, suffix, render, className, style, ...rest }) {
|
|
12
|
+
const affix = useId();
|
|
13
|
+
const prefixId = prefix == null ? void 0 : `${affix}-prefix`;
|
|
14
|
+
const suffixId = suffix == null ? void 0 : `${affix}-suffix`;
|
|
15
|
+
const field = useFieldControl({
|
|
16
|
+
id,
|
|
17
|
+
name,
|
|
18
|
+
required,
|
|
19
|
+
disabled,
|
|
20
|
+
readOnly,
|
|
21
|
+
invalid: invalid ?? (ariaInvalid === true || ariaInvalid === "true" ? true : void 0),
|
|
22
|
+
"aria-describedby": joinIds(describedBy, prefixId, suffixId)
|
|
23
|
+
});
|
|
24
|
+
const state = {
|
|
25
|
+
size,
|
|
26
|
+
invalid: field.invalid,
|
|
27
|
+
disabled: field.disabled,
|
|
28
|
+
readOnly: field.readOnly
|
|
29
|
+
};
|
|
30
|
+
return renderElement("span", render, state, {
|
|
31
|
+
"data-slot": "input",
|
|
32
|
+
"data-size": size,
|
|
33
|
+
...stateAttrs({
|
|
34
|
+
invalid: state.invalid,
|
|
35
|
+
disabled: state.disabled,
|
|
36
|
+
readOnly: state.readOnly
|
|
37
|
+
}),
|
|
38
|
+
className: cx("nz-input", className),
|
|
39
|
+
style,
|
|
40
|
+
onMouseDown: focusInput,
|
|
41
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
leadingIcon != null && /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "nz-input-icon",
|
|
44
|
+
"data-slot": "input-icon",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
children: leadingIcon
|
|
47
|
+
}),
|
|
48
|
+
prefix != null && /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "nz-input-prefix",
|
|
50
|
+
"data-slot": "input-prefix",
|
|
51
|
+
id: prefixId,
|
|
52
|
+
children: prefix
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx("input", {
|
|
55
|
+
...mergeProps(field.controlProps, rest),
|
|
56
|
+
type,
|
|
57
|
+
className: "nz-input-control",
|
|
58
|
+
"data-slot": "input-control"
|
|
59
|
+
}),
|
|
60
|
+
suffix != null && /* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "nz-input-suffix",
|
|
62
|
+
"data-slot": "input-suffix",
|
|
63
|
+
id: suffixId,
|
|
64
|
+
children: suffix
|
|
65
|
+
}),
|
|
66
|
+
trailingIcon != null && /* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: "nz-input-icon",
|
|
68
|
+
"data-slot": "input-icon",
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
children: trailingIcon
|
|
71
|
+
})
|
|
72
|
+
] })
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function focusInput(event) {
|
|
76
|
+
const input = event.currentTarget.querySelector(":scope > .nz-input-control");
|
|
77
|
+
if (input === null || event.target === input || input.disabled) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
input.focus();
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Input };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Kbd } from "./kbd.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/kbd/kbd.d.ts
|
|
4
|
+
/** The `data-platform` values of the glyph spans; they match `data-nz-platform` (§8.3). */
|
|
5
|
+
export type KbdPlatform = "apple" | "other";
|
|
6
|
+
export interface KbdProps extends ComponentPropsWithRef<"kbd"> {
|
|
7
|
+
/**
|
|
8
|
+
* A shortcut such as `"mod+k"` or `"mod+shift+d"`, drawn for both platforms (`⌘⇧D` and
|
|
9
|
+
* `Ctrl+Shift+D`); CSS shows the one `data-nz-platform` names, and `other` when no ancestor sets it.
|
|
10
|
+
* `mod` is ⌘ on Apple platforms and Ctrl elsewhere; the plus key is `plus` (`"mod+plus"`, or
|
|
11
|
+
* `"mod++"`). Replaces `children`.
|
|
12
|
+
*/
|
|
13
|
+
keys?: string;
|
|
14
|
+
/** Literal key text, for example `<Kbd>esc</Kbd>` or `<Kbd>↑↓</Kbd>`. */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
render?: RenderProp<Record<string, never>>;
|
|
17
|
+
}
|
|
18
|
+
export declare function Kbd({ keys, render, className, children, ...rest }: KbdProps): ReactElement;
|
|
19
|
+
//#endregion
|
package/dist/kbd/kbd.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { splitKeys } from "../_internal/keys.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/kbd/kbd.tsx
|
|
6
|
+
/** Key name → [Apple glyph, other platforms]. Anything else is drawn as written; one letter is uppercased. */
|
|
7
|
+
const KEYS = {
|
|
8
|
+
mod: ["⌘", "Ctrl"],
|
|
9
|
+
cmd: ["⌘", "Win"],
|
|
10
|
+
command: ["⌘", "Win"],
|
|
11
|
+
meta: ["⌘", "Win"],
|
|
12
|
+
ctrl: ["⌃", "Ctrl"],
|
|
13
|
+
control: ["⌃", "Ctrl"],
|
|
14
|
+
alt: ["⌥", "Alt"],
|
|
15
|
+
option: ["⌥", "Alt"],
|
|
16
|
+
shift: ["⇧", "Shift"],
|
|
17
|
+
enter: ["↵", "Enter"],
|
|
18
|
+
return: ["↵", "Enter"],
|
|
19
|
+
esc: ["esc", "esc"],
|
|
20
|
+
escape: ["esc", "esc"],
|
|
21
|
+
tab: ["⇥", "Tab"],
|
|
22
|
+
backspace: ["⌫", "Backspace"],
|
|
23
|
+
delete: ["⌦", "Del"],
|
|
24
|
+
space: ["Space", "Space"],
|
|
25
|
+
plus: ["+", "+"],
|
|
26
|
+
up: ["↑", "↑"],
|
|
27
|
+
down: ["↓", "↓"],
|
|
28
|
+
left: ["←", "←"],
|
|
29
|
+
right: ["→", "→"]
|
|
30
|
+
};
|
|
31
|
+
/** `"mod+shift+d"` → `["⌘⇧D", "Ctrl+Shift+D"]`: Apple glyphs run together, others join with `+`. */
|
|
32
|
+
function formatKeys(keys) {
|
|
33
|
+
const apple = [];
|
|
34
|
+
const other = [];
|
|
35
|
+
for (const key of splitKeys(keys)) {
|
|
36
|
+
const known = KEYS[key.toLowerCase()];
|
|
37
|
+
const text = key.length === 1 ? key.toUpperCase() : key;
|
|
38
|
+
apple.push(known?.[0] ?? text);
|
|
39
|
+
other.push(known?.[1] ?? text);
|
|
40
|
+
}
|
|
41
|
+
return [apple.join(""), other.join("+")];
|
|
42
|
+
}
|
|
43
|
+
function Kbd({ keys, render, className, children, ...rest }) {
|
|
44
|
+
return renderElement("kbd", render, {}, {
|
|
45
|
+
"data-slot": "kbd",
|
|
46
|
+
...rest,
|
|
47
|
+
className: cx("nz-kbd", className),
|
|
48
|
+
children: keys === void 0 ? children : glyphs(keys)
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** One span per platform when they differ; CSS hides the other (kbd.css). */
|
|
52
|
+
function glyphs(keys) {
|
|
53
|
+
const [apple, other] = formatKeys(keys);
|
|
54
|
+
if (apple === other) return apple;
|
|
55
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "nz-kbd-glyphs",
|
|
57
|
+
"data-slot": "kbd-glyphs",
|
|
58
|
+
"data-platform": "apple",
|
|
59
|
+
children: apple
|
|
60
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "nz-kbd-glyphs",
|
|
62
|
+
"data-slot": "kbd-glyphs",
|
|
63
|
+
"data-platform": "other",
|
|
64
|
+
children: other
|
|
65
|
+
})] });
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { Kbd };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { KpiTile } from "./kpi-tile.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { DataStatus } from "../_internal/data-status.js";
|
|
3
|
+
import { MetricDataProps } from "../metric/metric.js";
|
|
4
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
5
|
+
//#region src/kpi-tile/kpi-tile.d.ts
|
|
6
|
+
/** Figma "Tone": Surface, or Tinted as `brand` or `accent` (Card's tones of the same names). */
|
|
7
|
+
export type KpiTileTone = "surface" | "brand" | "accent";
|
|
8
|
+
export interface KpiTileState {
|
|
9
|
+
/** The status as rendered: `'empty'` when a ready tile has no value. */
|
|
10
|
+
status: DataStatus;
|
|
11
|
+
pending: boolean;
|
|
12
|
+
tone: KpiTileTone;
|
|
13
|
+
}
|
|
14
|
+
export interface KpiTileProps extends MetricDataProps, Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
15
|
+
/** The surface; group a row of related KPIs with one tint. @default 'surface' */
|
|
16
|
+
tone?: KpiTileTone;
|
|
17
|
+
/**
|
|
18
|
+
* A small chart beside the value, shown while ready, for example
|
|
19
|
+
* `<Sparkline data={series} label="Sales, last 7 days" />` from `@nizivo/charts`. Drawn at most
|
|
20
|
+
* 88 × 28 px (Figma).
|
|
21
|
+
*/
|
|
22
|
+
chart?: ReactNode;
|
|
23
|
+
render?: RenderProp<KpiTileState>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One number, its change and its shape. A `role="group"` named by the label (not a landmark). The
|
|
27
|
+
* Suspense fallback is the same tile with `status="loading"`: the box does not change (§16.5).
|
|
28
|
+
*/
|
|
29
|
+
export declare function KpiTile({ label, value, format, locale, delta, comparison, chart, tone, status, pending, empty, error, labels, render, className, ...rest }: KpiTileProps): ReactElement;
|
|
30
|
+
//#endregion
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { dataStatusAttrs } from "../_internal/data-status.js";
|
|
4
|
+
import { Metric, resolveStatus } from "../metric/metric.js";
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/kpi-tile/kpi-tile.tsx
|
|
8
|
+
/**
|
|
9
|
+
* One number, its change and its shape. A `role="group"` named by the label (not a landmark). The
|
|
10
|
+
* Suspense fallback is the same tile with `status="loading"`: the box does not change (§16.5).
|
|
11
|
+
*/
|
|
12
|
+
function KpiTile({ label, value, format, locale, delta, comparison, chart, tone = "surface", status = "ready", pending = false, empty, error, labels, render, className, ...rest }) {
|
|
13
|
+
const labelId = useId();
|
|
14
|
+
const st = resolveStatus(status, value);
|
|
15
|
+
const busy = st === "ready" && pending;
|
|
16
|
+
return renderElement("div", render, {
|
|
17
|
+
status: st,
|
|
18
|
+
pending: busy,
|
|
19
|
+
tone
|
|
20
|
+
}, {
|
|
21
|
+
"data-slot": "kpi-tile",
|
|
22
|
+
"data-tone": tone,
|
|
23
|
+
"data-padding": "sm",
|
|
24
|
+
...dataStatusAttrs(st, busy),
|
|
25
|
+
role: "group",
|
|
26
|
+
"aria-labelledby": labelId,
|
|
27
|
+
...rest,
|
|
28
|
+
className: cx("nz-card", "nz-kpi-tile", className),
|
|
29
|
+
children: /* @__PURE__ */ jsx(Metric, {
|
|
30
|
+
labelId,
|
|
31
|
+
label,
|
|
32
|
+
value,
|
|
33
|
+
format,
|
|
34
|
+
locale,
|
|
35
|
+
delta,
|
|
36
|
+
comparison,
|
|
37
|
+
chart,
|
|
38
|
+
status,
|
|
39
|
+
pending,
|
|
40
|
+
empty,
|
|
41
|
+
error,
|
|
42
|
+
labels,
|
|
43
|
+
reserveChange: true
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { KpiTile };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AlertDismissLabels } from "../alert/alert-dismiss.client.js";
|
|
2
|
+
import "../alert/index.js";
|
|
3
|
+
import { AppShellLabels } from "../app-shell/app-shell.js";
|
|
4
|
+
import "../app-shell/index.js";
|
|
5
|
+
import { AvatarGroupLabels } from "../avatar/avatar.js";
|
|
6
|
+
import "../avatar/index.js";
|
|
7
|
+
import { BannerDismissLabels } from "../banner/banner-dismiss.client.js";
|
|
8
|
+
import "../banner/index.js";
|
|
9
|
+
import { BreadcrumbLabels } from "../breadcrumb/breadcrumb.js";
|
|
10
|
+
import "../breadcrumb/index.js";
|
|
11
|
+
import { ButtonLabels } from "../button/button.js";
|
|
12
|
+
import "../button/index.js";
|
|
13
|
+
import { ChipGroupLabels } from "../chip-group/chip-group.client.js";
|
|
14
|
+
import "../chip-group/index.js";
|
|
15
|
+
import { DialogLabels } from "../dialog/dialog.contract.js";
|
|
16
|
+
import "../dialog/index.js";
|
|
17
|
+
import { DrawerLabels } from "../drawer/drawer.contract.js";
|
|
18
|
+
import "../drawer/index.js";
|
|
19
|
+
import { FileUploadLabels } from "../file-upload/file-upload.contract.js";
|
|
20
|
+
import "../file-upload/index.js";
|
|
21
|
+
import { FormLabels } from "../form/form.client.js";
|
|
22
|
+
import "../form/index.js";
|
|
23
|
+
import { MetricLabels } from "../metric/metric.js";
|
|
24
|
+
import "../metric/index.js";
|
|
25
|
+
import { MobileTabBarLabels } from "../mobile-tab-bar/mobile-tab-bar.js";
|
|
26
|
+
import { MobileTabBarMoreLabels } from "../mobile-tab-bar/mobile-tab-bar-more.client.js";
|
|
27
|
+
import "../mobile-tab-bar/index.js";
|
|
28
|
+
import { PaginationLabels } from "../pagination/pagination.js";
|
|
29
|
+
import "../pagination/index.js";
|
|
30
|
+
import { PasswordInputLabels } from "../password-input/password-input.client.js";
|
|
31
|
+
import "../password-input/index.js";
|
|
32
|
+
import { PopoverLabels } from "../popover/popover.contract.js";
|
|
33
|
+
import "../popover/index.js";
|
|
34
|
+
import { RankedListLabels } from "../ranked-list/ranked-list.js";
|
|
35
|
+
import "../ranked-list/index.js";
|
|
36
|
+
import { SearchFieldLabels } from "../search-field/search-field.client.js";
|
|
37
|
+
import "../search-field/index.js";
|
|
38
|
+
import { SidebarLabels } from "../sidebar/sidebar.js";
|
|
39
|
+
import "../sidebar/index.js";
|
|
40
|
+
import { TableSelectionLabels } from "../table-selection/table-selection.js";
|
|
41
|
+
import "../table-selection/index.js";
|
|
42
|
+
import { ToasterLabels } from "../toast/toast.contract.js";
|
|
43
|
+
import "../toast/index.js";
|
|
44
|
+
//#region src/locales/en-US.d.ts
|
|
45
|
+
/**
|
|
46
|
+
* The en-US strings of every component that takes `labels`, keyed by component: pass
|
|
47
|
+
* `labels={enUS.pagination}` or a catalogue of the same shape for another locale
|
|
48
|
+
* (`const deDE: typeof enUS = { … }`). Count-bearing strings (`avatarGroup`) may be plural
|
|
49
|
+
* objects in other locales (`PluralLabel` from `@nizivo/react/i18n`).
|
|
50
|
+
*/
|
|
51
|
+
export declare const enUS: {
|
|
52
|
+
alertDismiss: AlertDismissLabels;
|
|
53
|
+
appShell: AppShellLabels;
|
|
54
|
+
avatarGroup: AvatarGroupLabels;
|
|
55
|
+
bannerDismiss: BannerDismissLabels;
|
|
56
|
+
breadcrumb: BreadcrumbLabels;
|
|
57
|
+
button: ButtonLabels;
|
|
58
|
+
chipGroup: ChipGroupLabels;
|
|
59
|
+
dialog: Pick<DialogLabels, "close">;
|
|
60
|
+
drawer: Pick<DrawerLabels, "close">;
|
|
61
|
+
fileUpload: FileUploadLabels;
|
|
62
|
+
form: FormLabels;
|
|
63
|
+
kpiTile: MetricLabels;
|
|
64
|
+
metric: MetricLabels;
|
|
65
|
+
mobileTabBar: MobileTabBarLabels;
|
|
66
|
+
mobileTabBarMore: MobileTabBarMoreLabels;
|
|
67
|
+
pagination: PaginationLabels;
|
|
68
|
+
passwordInput: PasswordInputLabels;
|
|
69
|
+
popover: Pick<PopoverLabels, "close">;
|
|
70
|
+
rankedList: RankedListLabels;
|
|
71
|
+
searchField: SearchFieldLabels;
|
|
72
|
+
sidebar: SidebarLabels;
|
|
73
|
+
tableSelection: TableSelectionLabels;
|
|
74
|
+
toaster: ToasterLabels;
|
|
75
|
+
trendCard: MetricLabels;
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//#region src/locales/en-US.ts
|
|
2
|
+
/**
|
|
3
|
+
* The en-US strings of every component that takes `labels`, keyed by component: pass
|
|
4
|
+
* `labels={enUS.pagination}` or a catalogue of the same shape for another locale
|
|
5
|
+
* (`const deDE: typeof enUS = { … }`). Count-bearing strings (`avatarGroup`) may be plural
|
|
6
|
+
* objects in other locales (`PluralLabel` from `@nizivo/react/i18n`).
|
|
7
|
+
*/
|
|
8
|
+
const enUS = {
|
|
9
|
+
alertDismiss: { dismiss: "Dismiss" },
|
|
10
|
+
appShell: { skip: "Skip to content" },
|
|
11
|
+
avatarGroup: {
|
|
12
|
+
overflow: "+{count}",
|
|
13
|
+
more: "{count} more"
|
|
14
|
+
},
|
|
15
|
+
bannerDismiss: { dismiss: "Dismiss" },
|
|
16
|
+
breadcrumb: { nav: "Breadcrumb" },
|
|
17
|
+
button: { pending: "Loading…" },
|
|
18
|
+
chipGroup: { unavailable: "Unavailable" },
|
|
19
|
+
dialog: { close: "Close" },
|
|
20
|
+
drawer: { close: "Close" },
|
|
21
|
+
fileUpload: {
|
|
22
|
+
prompt: "Drop files here or {browse}",
|
|
23
|
+
browse: "browse",
|
|
24
|
+
release: "Release to add files",
|
|
25
|
+
summary: "{complete} of {total} uploaded",
|
|
26
|
+
wrongType: "{name} is not an accepted file type.",
|
|
27
|
+
tooLarge: "{name} is larger than {max}.",
|
|
28
|
+
tooMany: "{name} was not added: choose one file.",
|
|
29
|
+
list: "Chosen files",
|
|
30
|
+
remove: "Remove {name}",
|
|
31
|
+
retry: "Retry",
|
|
32
|
+
cancel: "Cancel",
|
|
33
|
+
uploading: "Uploading {name}",
|
|
34
|
+
complete: "Uploaded",
|
|
35
|
+
failed: "Upload failed"
|
|
36
|
+
},
|
|
37
|
+
form: { summaryTitle: "There is a problem" },
|
|
38
|
+
kpiTile: {
|
|
39
|
+
loading: "Loading {label}",
|
|
40
|
+
empty: "No data",
|
|
41
|
+
error: "Could not load {label}"
|
|
42
|
+
},
|
|
43
|
+
metric: {
|
|
44
|
+
loading: "Loading {label}",
|
|
45
|
+
empty: "No data",
|
|
46
|
+
error: "Could not load {label}"
|
|
47
|
+
},
|
|
48
|
+
mobileTabBar: { nav: "Primary" },
|
|
49
|
+
mobileTabBarMore: {
|
|
50
|
+
more: "More",
|
|
51
|
+
close: "Close"
|
|
52
|
+
},
|
|
53
|
+
pagination: {
|
|
54
|
+
nav: "Pagination",
|
|
55
|
+
previous: "Previous page",
|
|
56
|
+
next: "Next page",
|
|
57
|
+
page: "Page {page}"
|
|
58
|
+
},
|
|
59
|
+
passwordInput: { toggle: "Show password" },
|
|
60
|
+
popover: { close: "Close" },
|
|
61
|
+
rankedList: {
|
|
62
|
+
loading: "Loading {label}",
|
|
63
|
+
empty: "No data",
|
|
64
|
+
error: "Could not load {label}"
|
|
65
|
+
},
|
|
66
|
+
searchField: {
|
|
67
|
+
label: "Search",
|
|
68
|
+
clear: "Clear search"
|
|
69
|
+
},
|
|
70
|
+
sidebar: { nav: "Primary" },
|
|
71
|
+
tableSelection: { selectAll: "Select all rows" },
|
|
72
|
+
toaster: {
|
|
73
|
+
region: "Notifications (F8)",
|
|
74
|
+
dismiss: "Dismiss"
|
|
75
|
+
},
|
|
76
|
+
trendCard: {
|
|
77
|
+
loading: "Loading {label}",
|
|
78
|
+
empty: "No data",
|
|
79
|
+
error: "Could not load {label}"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { enUS };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OpenReason } from "../contracts/details.js";
|
|
2
|
+
import { MenuCheckboxItemProps, MenuCheckedReason, MenuGroupLabelProps, MenuGroupProps, MenuItemProps, MenuItemState, MenuItemTone, MenuLabels, MenuPopupProps, MenuPopupState, MenuRadioGroupProps, MenuRadioItemProps, MenuRootProps, MenuSeparatorProps, MenuSide, MenuTriggerProps, MenuTriggerState } from "./menu.contract.js";
|
|
3
|
+
import { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger } from "./menu.client.js";
|
|
4
|
+
import { menu_parts_d_exports } from "./menu.parts.js";
|
|
5
|
+
export { menu_parts_d_exports as Menu, MenuCheckboxItem, type MenuCheckboxItemProps, type MenuCheckedReason, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, MenuItem, type MenuItemProps, type MenuItemState, type MenuItemTone, type MenuLabels, MenuPopup, type MenuPopupProps, type MenuPopupState, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuRoot, type MenuRootProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuTrigger, type MenuTriggerProps, type MenuTriggerState, type OpenReason };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger } from "./menu.client.js";
|
|
2
|
+
import { menu_parts_exports } from "./menu.parts.js";
|
|
3
|
+
export { menu_parts_exports as Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MenuCheckboxItemProps, MenuGroupLabelProps, MenuGroupProps, MenuItemProps, MenuPopupProps, MenuRadioGroupProps, MenuRadioItemProps, MenuRootProps, MenuSeparatorProps, MenuTriggerProps } from "./menu.contract.js";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
//#region src/menu/menu.client.d.ts
|
|
4
|
+
export declare function MenuRoot(props: MenuRootProps): JSX.Element;
|
|
5
|
+
export declare function MenuTrigger({ className, render, ...rest }: MenuTriggerProps): JSX.Element;
|
|
6
|
+
export declare function MenuPopup({ side, align, sideOffset, container, "aria-label": label, className, style, children }: MenuPopupProps): JSX.Element;
|
|
7
|
+
export declare function MenuItem({ className, tone, icon, shortcut, textValue, "aria-keyshortcuts": keyshortcuts, href, render, children, ...rest }: MenuItemProps): JSX.Element;
|
|
8
|
+
export declare function MenuCheckboxItem({ className, tone, icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }: MenuCheckboxItemProps): JSX.Element;
|
|
9
|
+
export declare function MenuRadioGroup({ className, render, ...rest }: MenuRadioGroupProps): JSX.Element;
|
|
10
|
+
export declare function MenuRadioItem({ className, tone, icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }: MenuRadioItemProps): JSX.Element;
|
|
11
|
+
export declare function MenuGroup({ className, render, ...rest }: MenuGroupProps): JSX.Element;
|
|
12
|
+
export declare function MenuGroupLabel({ className, render, ...rest }: MenuGroupLabelProps): JSX.Element;
|
|
13
|
+
export declare function MenuSeparator({ className, render, ...rest }: MenuSeparatorProps): JSX.Element;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../_internal/cx.js";
|
|
3
|
+
import { toRenderFn } from "../contracts/render.js";
|
|
4
|
+
import { CheckGlyph } from "../_internal/glyphs.js";
|
|
5
|
+
import { ariaKeyShortcuts } from "../_internal/keys.js";
|
|
6
|
+
import { Kbd } from "../kbd/kbd.js";
|
|
7
|
+
import { CheckboxItem, Group, GroupLabel, Item, Popup, RadioGroup, RadioItem, Root, Separator, Trigger } from "../_engines/react-aria/menu.client.js";
|
|
8
|
+
import { isValidElement } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/menu/menu.client.tsx
|
|
11
|
+
const renderDiv = toRenderFn(void 0, "div");
|
|
12
|
+
function MenuRoot(props) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Root, { ...props });
|
|
14
|
+
}
|
|
15
|
+
function MenuTrigger({ className, render, ...rest }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(Trigger, {
|
|
17
|
+
...rest,
|
|
18
|
+
className: cx("nz-menu-trigger", className),
|
|
19
|
+
"data-slot": "menu-trigger",
|
|
20
|
+
render: toRenderFn(render, "button")
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function MenuPopup({ side = "bottom", align = "start", sideOffset = 8, container, "aria-label": label, className, style, children }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(Popup, {
|
|
25
|
+
side,
|
|
26
|
+
align,
|
|
27
|
+
sideOffset,
|
|
28
|
+
container,
|
|
29
|
+
className: cx("nz-menu-popup", className),
|
|
30
|
+
style,
|
|
31
|
+
"data-slot": "menu-popup",
|
|
32
|
+
render: renderDiv,
|
|
33
|
+
list: {
|
|
34
|
+
className: "nz-menu-list",
|
|
35
|
+
"data-slot": "menu-list",
|
|
36
|
+
"aria-label": label
|
|
37
|
+
},
|
|
38
|
+
children
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The row's content in Figma order. The inner spans carry classes only: every item kind shares them,
|
|
43
|
+
* and a `data-slot` belongs to one component. `indicator` is set only on checkbox and radio items.
|
|
44
|
+
*/
|
|
45
|
+
function itemContent(icon, children, shortcut, indicator) {
|
|
46
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
icon != null && /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: "nz-menu-item-icon",
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
children: icon
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: "nz-menu-item-label",
|
|
54
|
+
children
|
|
55
|
+
}),
|
|
56
|
+
shortcut !== void 0 && /* @__PURE__ */ jsx(Kbd, {
|
|
57
|
+
keys: shortcut,
|
|
58
|
+
className: "nz-menu-item-shortcut",
|
|
59
|
+
"aria-hidden": "true"
|
|
60
|
+
}),
|
|
61
|
+
indicator !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: "nz-menu-item-indicator",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
children: indicator ?? /* @__PURE__ */ jsx(CheckGlyph, {})
|
|
65
|
+
})
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
/** Typeahead text and the announced shortcut, shared by every item kind. */
|
|
69
|
+
function itemBehaviour(children, textValue, shortcut, keyshortcuts) {
|
|
70
|
+
return {
|
|
71
|
+
textValue: textValue ?? (typeof children === "string" ? children : void 0),
|
|
72
|
+
"aria-keyshortcuts": keyshortcuts ?? (shortcut === void 0 ? void 0 : ariaKeyShortcuts(shortcut))
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** The `href` of a `render={<Link href="…" />}` element, which makes the item a link item (§9.3 rule 3). */
|
|
76
|
+
function elementHref(render) {
|
|
77
|
+
if (!isValidElement(render)) return void 0;
|
|
78
|
+
const { href } = render.props;
|
|
79
|
+
return typeof href === "string" ? href : void 0;
|
|
80
|
+
}
|
|
81
|
+
function MenuItem({ className, tone = "neutral", icon, shortcut, textValue, "aria-keyshortcuts": keyshortcuts, href, render, children, ...rest }) {
|
|
82
|
+
const link = href ?? elementHref(render);
|
|
83
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
84
|
+
...rest,
|
|
85
|
+
...itemBehaviour(children, textValue, shortcut, keyshortcuts),
|
|
86
|
+
className: cx("nz-menu-item", className),
|
|
87
|
+
"data-slot": "menu-item",
|
|
88
|
+
"data-tone": tone,
|
|
89
|
+
"data-focus-inset": "",
|
|
90
|
+
href: link,
|
|
91
|
+
render: toRenderFn(render, link === void 0 ? "div" : "a"),
|
|
92
|
+
children: itemContent(icon, children, shortcut)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function MenuCheckboxItem({ className, tone = "neutral", icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(CheckboxItem, {
|
|
97
|
+
...rest,
|
|
98
|
+
...itemBehaviour(children, textValue, shortcut, keyshortcuts),
|
|
99
|
+
className: cx("nz-menu-checkbox-item", className),
|
|
100
|
+
"data-slot": "menu-checkbox-item",
|
|
101
|
+
"data-tone": tone,
|
|
102
|
+
"data-focus-inset": "",
|
|
103
|
+
render: toRenderFn(render, "div"),
|
|
104
|
+
children: itemContent(icon, children, shortcut, indicator ?? null)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function MenuRadioGroup({ className, render, ...rest }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
109
|
+
...rest,
|
|
110
|
+
className: cx("nz-menu-radio-group", className),
|
|
111
|
+
"data-slot": "menu-radio-group",
|
|
112
|
+
render: toRenderFn(render, "section")
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function MenuRadioItem({ className, tone = "neutral", icon, shortcut, indicator, textValue, "aria-keyshortcuts": keyshortcuts, render, children, ...rest }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(RadioItem, {
|
|
117
|
+
...rest,
|
|
118
|
+
...itemBehaviour(children, textValue, shortcut, keyshortcuts),
|
|
119
|
+
className: cx("nz-menu-radio-item", className),
|
|
120
|
+
"data-slot": "menu-radio-item",
|
|
121
|
+
"data-tone": tone,
|
|
122
|
+
"data-focus-inset": "",
|
|
123
|
+
render: toRenderFn(render, "div"),
|
|
124
|
+
children: itemContent(icon, children, shortcut, indicator ?? null)
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function MenuGroup({ className, render, ...rest }) {
|
|
128
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
129
|
+
...rest,
|
|
130
|
+
className: cx("nz-menu-group", className),
|
|
131
|
+
"data-slot": "menu-group",
|
|
132
|
+
render: toRenderFn(render, "section")
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function MenuGroupLabel({ className, render, ...rest }) {
|
|
136
|
+
return /* @__PURE__ */ jsx(GroupLabel, {
|
|
137
|
+
...rest,
|
|
138
|
+
className: cx("nz-menu-group-label", className),
|
|
139
|
+
"data-slot": "menu-group-label",
|
|
140
|
+
render: toRenderFn(render, "header")
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function MenuSeparator({ className, render, ...rest }) {
|
|
144
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
145
|
+
...rest,
|
|
146
|
+
className: cx("nz-menu-separator", className),
|
|
147
|
+
"data-slot": "menu-separator",
|
|
148
|
+
render: toRenderFn(render, "div")
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
export { MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuRoot, MenuSeparator, MenuTrigger };
|