@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,54 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { MobileTabBarInset } from "./mobile-tab-bar-inset.client.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/mobile-tab-bar/mobile-tab-bar.tsx
|
|
6
|
+
/** The `<nav>` and its list, with the bottom-inset island. */
|
|
7
|
+
function MobileTabBarRoot({ labels, className, children, ...rest }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
9
|
+
"aria-label": labels?.nav ?? "Primary",
|
|
10
|
+
"data-slot": "mobile-tab-bar",
|
|
11
|
+
...rest,
|
|
12
|
+
className: cx("nz-mobile-tab-bar", className),
|
|
13
|
+
children: [/* @__PURE__ */ jsx("ul", {
|
|
14
|
+
className: "nz-mobile-tab-bar-list",
|
|
15
|
+
"data-slot": "mobile-tab-bar-list",
|
|
16
|
+
children
|
|
17
|
+
}), /* @__PURE__ */ jsx(MobileTabBarInset, {})]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One destination: a list item around a link, with its icon in Figma's indicator pill and its label
|
|
22
|
+
* under it. Props other than `icon`, `count` and `current` go to the link.
|
|
23
|
+
*/
|
|
24
|
+
function MobileTabBarItem({ current = false, icon, count, render, className, children, ...rest }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("li", {
|
|
26
|
+
className: "nz-mobile-tab-bar-item",
|
|
27
|
+
"data-slot": "mobile-tab-bar-item",
|
|
28
|
+
children: renderElement("a", render, { current }, {
|
|
29
|
+
"data-slot": "mobile-tab-bar-link",
|
|
30
|
+
...rest,
|
|
31
|
+
"aria-current": current ? "page" : rest["aria-current"],
|
|
32
|
+
className: cx("nz-mobile-tab-bar-link", className),
|
|
33
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
34
|
+
className: "nz-mobile-tab-bar-indicator",
|
|
35
|
+
"data-slot": "mobile-tab-bar-indicator",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "nz-mobile-tab-bar-icon",
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
children: icon
|
|
40
|
+
}), count != null && /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: "nz-mobile-tab-bar-count",
|
|
42
|
+
"data-slot": "mobile-tab-bar-count",
|
|
43
|
+
children: count
|
|
44
|
+
})]
|
|
45
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "nz-mobile-tab-bar-label",
|
|
47
|
+
"data-slot": "mobile-tab-bar-label",
|
|
48
|
+
children
|
|
49
|
+
})] })
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { MobileTabBarItem, MobileTabBarRoot };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MobileTabBarItem, MobileTabBarRoot } from "./mobile-tab-bar.js";
|
|
2
|
+
declare namespace mobile_tab_bar_parts_d_exports {
|
|
3
|
+
export { MobileTabBarItem as Item, MobileTabBarRoot as Root };
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { MobileTabBarItem as Item, MobileTabBarRoot as Root, mobile_tab_bar_parts_d_exports };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { MobileTabBarItem, MobileTabBarRoot } from "./mobile-tab-bar.js";
|
|
3
|
+
//#region src/mobile-tab-bar/mobile-tab-bar.parts.ts
|
|
4
|
+
var mobile_tab_bar_parts_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Item: () => MobileTabBarItem,
|
|
6
|
+
Root: () => MobileTabBarRoot
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { MobileTabBarItem as Item, MobileTabBarRoot as Root, mobile_tab_bar_parts_exports };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileTopBar } from "./mobile-top-bar.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/mobile-top-bar/mobile-top-bar.d.ts
|
|
4
|
+
export interface MobileTopBarProps extends Omit<ComponentPropsWithRef<"header">, "title" | "children"> {
|
|
5
|
+
/** The page's name, in Heading/H4's look (Figma's Title). Not a heading element. */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** The store's mark, drawn as Figma's 32 px Store mark: an initial, or a logo image that fills it. */
|
|
8
|
+
mark?: ReactNode;
|
|
9
|
+
/** In place of `mark`, for example a back link on a detail page. */
|
|
10
|
+
leading?: ReactNode;
|
|
11
|
+
/** At the end, usually a search IconButton and a notifications IconButton. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
render?: RenderProp<Record<string, never>>;
|
|
14
|
+
}
|
|
15
|
+
/** The bar above the page below 640 px (AppShell's `mobileTopBar`). */
|
|
16
|
+
export declare function MobileTopBar({ title, mark, leading, actions, render, className, ...rest }: MobileTopBarProps): ReactElement;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/mobile-top-bar/mobile-top-bar.tsx
|
|
5
|
+
/** The bar above the page below 640 px (AppShell's `mobileTopBar`). */
|
|
6
|
+
function MobileTopBar({ title, mark, leading, actions, render, className, ...rest }) {
|
|
7
|
+
return renderElement("header", render, {}, {
|
|
8
|
+
"data-slot": "mobile-top-bar",
|
|
9
|
+
...rest,
|
|
10
|
+
className: cx("nz-mobile-top-bar", className),
|
|
11
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
leading ?? (mark != null && /* @__PURE__ */ jsx("span", {
|
|
13
|
+
className: "nz-mobile-top-bar-mark",
|
|
14
|
+
"data-slot": "mobile-top-bar-mark",
|
|
15
|
+
children: mark
|
|
16
|
+
})),
|
|
17
|
+
/* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "nz-mobile-top-bar-title",
|
|
19
|
+
"data-slot": "mobile-top-bar-title",
|
|
20
|
+
children: title
|
|
21
|
+
}),
|
|
22
|
+
actions != null && /* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "nz-mobile-top-bar-actions",
|
|
24
|
+
"data-slot": "mobile-top-bar-actions",
|
|
25
|
+
children: actions
|
|
26
|
+
})
|
|
27
|
+
] })
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { MobileTopBar };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, RefObject } from "react";
|
|
3
|
+
//#region src/motion/count-up.client.d.ts
|
|
4
|
+
export interface CountUpOptions {
|
|
5
|
+
/** `Intl.NumberFormat` options, as NumberValue takes them. @default {} */
|
|
6
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
7
|
+
/** BCP 47 tag for the number. @default 'en-US' */
|
|
8
|
+
locale?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Milliseconds. The default reads `--nz-duration-count-up` from the element (900 ms). Under reduced
|
|
11
|
+
* motion that token is 0 ms and the value is shown at once, whatever this says.
|
|
12
|
+
*/
|
|
13
|
+
duration?: number | undefined;
|
|
14
|
+
/** Where the first count starts. Later counts start from the number on screen. @default 0 */
|
|
15
|
+
from?: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** NumberValue's state: the final value and its formatted text. */
|
|
18
|
+
export interface CountUpState {
|
|
19
|
+
value: number;
|
|
20
|
+
/** The final formatted text, which the server renders and assistive tech reads. */
|
|
21
|
+
text: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CountUpProps extends CountUpOptions, Omit<ComponentPropsWithRef<"data">, "children" | "value"> {
|
|
24
|
+
value: number;
|
|
25
|
+
render?: RenderProp<CountUpState>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Counts the text of `ref`'s element up to `value`, formatted with `formatNumber` (so every frame
|
|
29
|
+
* reads like the server's text). Render the final formatted value in that element yourself; the hook
|
|
30
|
+
* only writes frames and gives the element the final string's width while it counts (make it
|
|
31
|
+
* `inline-block`). Keep it `aria-hidden` and put the final value in visually hidden text beside it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useCountUp(ref: RefObject<HTMLElement | null>, value: number, options?: CountUpOptions): void;
|
|
34
|
+
/**
|
|
35
|
+
* NumberValue's `<data>` with the final value, counted up on the client. A client leaf: under RSC it
|
|
36
|
+
* is the one dashboard part that ships JavaScript (§17.2).
|
|
37
|
+
*/
|
|
38
|
+
export declare function CountUp(props: CountUpProps): ReactElement;
|
|
39
|
+
//#endregion
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../_internal/cx.js";
|
|
3
|
+
import { renderElement } from "../contracts/render.js";
|
|
4
|
+
import { formatNumber } from "../number-value/number-value.js";
|
|
5
|
+
import { useEffectEvent, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/motion/count-up.client.tsx
|
|
8
|
+
const noop = () => () => {};
|
|
9
|
+
const decimals = (n) => (String(n).split(".")[1] ?? "").length;
|
|
10
|
+
/**
|
|
11
|
+
* Counts the text of `ref`'s element up to `value`, formatted with `formatNumber` (so every frame
|
|
12
|
+
* reads like the server's text). Render the final formatted value in that element yourself; the hook
|
|
13
|
+
* only writes frames and gives the element the final string's width while it counts (make it
|
|
14
|
+
* `inline-block`). Keep it `aria-hidden` and put the final value in visually hidden text beside it.
|
|
15
|
+
*/
|
|
16
|
+
function useCountUp(ref, value, options = {}) {
|
|
17
|
+
const [hydrated] = useState(useSyncExternalStore(noop, () => false, () => true));
|
|
18
|
+
const read = useEffectEvent(() => options);
|
|
19
|
+
const memory = useRef({});
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
const el = ref.current;
|
|
22
|
+
if (el === null) return void 0;
|
|
23
|
+
const state = memory.current;
|
|
24
|
+
const { format, locale, duration, from = 0 } = read();
|
|
25
|
+
const write = (n) => {
|
|
26
|
+
state.shown = n;
|
|
27
|
+
el.textContent = formatNumber(n, format, locale);
|
|
28
|
+
};
|
|
29
|
+
const begin = state.shown ?? from;
|
|
30
|
+
const step = 10 ** Math.max(decimals(begin), decimals(value));
|
|
31
|
+
let frame = 0;
|
|
32
|
+
const count = () => {
|
|
33
|
+
const token = getComputedStyle(el).getPropertyValue("--nz-duration-count-up");
|
|
34
|
+
const ms = Number.parseFloat(token) * (token.includes("ms") ? 1 : 1e3);
|
|
35
|
+
const total = ms === 0 ? 0 : duration ?? ms;
|
|
36
|
+
write(value);
|
|
37
|
+
if (!(total > 0) || begin === value) return;
|
|
38
|
+
el.style.inlineSize = `${Number.parseFloat(getComputedStyle(el).inlineSize) + .005}px`;
|
|
39
|
+
let start;
|
|
40
|
+
const tick = (now) => {
|
|
41
|
+
start ??= now;
|
|
42
|
+
const x = Math.min((now - start) / total, 1);
|
|
43
|
+
const s = Math.cbrt(x);
|
|
44
|
+
write(x < 1 ? Math.round((begin + (value - begin) * s * s * (3 - 2 * s)) * step) / step : value);
|
|
45
|
+
if (x < 1) frame = requestAnimationFrame(tick);
|
|
46
|
+
else el.style.inlineSize = "";
|
|
47
|
+
};
|
|
48
|
+
write(begin);
|
|
49
|
+
frame = requestAnimationFrame(tick);
|
|
50
|
+
};
|
|
51
|
+
if (state.shown === void 0) {
|
|
52
|
+
const box = el.getBoundingClientRect();
|
|
53
|
+
state.seen = box.width > 0 && box.bottom > 0 && box.top < innerHeight;
|
|
54
|
+
if (!state.seen) state.wait = count;
|
|
55
|
+
else if (hydrated) write(value);
|
|
56
|
+
else count();
|
|
57
|
+
} else if (state.seen) count();
|
|
58
|
+
else write(value);
|
|
59
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
60
|
+
state.seen = entry?.isIntersecting;
|
|
61
|
+
if (state.seen && state.wait) {
|
|
62
|
+
state.wait();
|
|
63
|
+
state.wait = void 0;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
observer.observe(el);
|
|
67
|
+
return () => {
|
|
68
|
+
observer.disconnect();
|
|
69
|
+
cancelAnimationFrame(frame);
|
|
70
|
+
state.wait = void 0;
|
|
71
|
+
el.style.inlineSize = "";
|
|
72
|
+
};
|
|
73
|
+
}, [
|
|
74
|
+
ref,
|
|
75
|
+
hydrated,
|
|
76
|
+
value
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* NumberValue's `<data>` with the final value, counted up on the client. A client leaf: under RSC it
|
|
81
|
+
* is the one dashboard part that ships JavaScript (§17.2).
|
|
82
|
+
*/
|
|
83
|
+
function CountUp(props) {
|
|
84
|
+
const { value, format, locale, duration: _duration, from: _from, render, className, ...rest } = props;
|
|
85
|
+
const digits = useRef(null);
|
|
86
|
+
useCountUp(digits, value, props);
|
|
87
|
+
const text = formatNumber(value, format, locale);
|
|
88
|
+
return renderElement("data", render, {
|
|
89
|
+
value,
|
|
90
|
+
text
|
|
91
|
+
}, {
|
|
92
|
+
"data-slot": "count-up",
|
|
93
|
+
...rest,
|
|
94
|
+
value: String(value),
|
|
95
|
+
className: cx("nz-number-value", "nz-count-up", className),
|
|
96
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
97
|
+
ref: digits,
|
|
98
|
+
className: "nz-count-up-value",
|
|
99
|
+
"data-slot": "count-up-value",
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
children: text
|
|
102
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
103
|
+
className: "nz-visually-hidden nz-count-up-label",
|
|
104
|
+
children: text
|
|
105
|
+
})] })
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { CountUp, useCountUp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CountUp, useCountUp } from "./count-up.client.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NativeSelect } from "./native-select.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ControlSize } from "../augment.js";
|
|
3
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
4
|
+
//#region src/native-select/native-select.d.ts
|
|
5
|
+
export interface NativeSelectState {
|
|
6
|
+
size: ControlSize;
|
|
7
|
+
/** An error message is presented: the `invalid` prop, or `aria-invalid` from a Field. */
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NativeSelectProps extends Omit<ComponentPropsWithRef<"select">, "size" | "multiple" | "readOnly"> {
|
|
12
|
+
/** 32 / 40 / 48 px, the Select trigger's heights. @default 'md' */
|
|
13
|
+
size?: ControlSize;
|
|
14
|
+
/**
|
|
15
|
+
* An error message is presented for this select (§8.3). A Field's function child passes
|
|
16
|
+
* `aria-invalid`, which counts too.
|
|
17
|
+
*/
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Text of a first, empty option shown until a value is chosen (`value=""`). With `required`,
|
|
21
|
+
* submitting it fails `valueMissing`. When neither `value` nor `defaultValue` is given, it is
|
|
22
|
+
* selected initially.
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Decorative icon before the value (`aria-hidden`), as on the Select trigger. */
|
|
26
|
+
leadingIcon?: ReactNode;
|
|
27
|
+
/** Replaces the chevron glyph. Decorative. */
|
|
28
|
+
indicator?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* `readOnly` is accepted and dropped, so a Field function child can be spread as it is: a
|
|
31
|
+
* `<select>` has no read-only state.
|
|
32
|
+
*/
|
|
33
|
+
readOnly?: boolean | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Composition of the wrapper. `className` and `style` go on the wrapper too; every other prop,
|
|
36
|
+
* `ref` included, goes on the native `<select>`.
|
|
37
|
+
*/
|
|
38
|
+
render?: RenderProp<NativeSelectState>;
|
|
39
|
+
/** `<option>` and `<optgroup>` elements. */
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export declare function NativeSelect({ size, invalid, placeholder, leadingIcon, indicator, readOnly: _readOnly, render, className, style, value, defaultValue, disabled, "aria-invalid": ariaInvalid, children, ...rest }: NativeSelectProps): ReactElement;
|
|
43
|
+
//#endregion
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { ChevronsUpDownGlyph } from "../_internal/glyphs.js";
|
|
4
|
+
import { stateAttrs } from "../contracts/state.js";
|
|
5
|
+
import { FIELD_CONTROL } from "../_internal/field.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/native-select/native-select.tsx
|
|
8
|
+
function NativeSelect({ size = "md", invalid, placeholder, leadingIcon, indicator, readOnly: _readOnly, render, className, style, value, defaultValue, disabled = false, "aria-invalid": ariaInvalid, children, ...rest }) {
|
|
9
|
+
const state = {
|
|
10
|
+
size,
|
|
11
|
+
invalid: invalid ?? (ariaInvalid === true || ariaInvalid === "true"),
|
|
12
|
+
disabled
|
|
13
|
+
};
|
|
14
|
+
const initial = placeholder !== void 0 && value === void 0 && defaultValue === void 0 ? "" : defaultValue;
|
|
15
|
+
return renderElement("span", render, state, {
|
|
16
|
+
"data-slot": "native-select",
|
|
17
|
+
"data-size": size,
|
|
18
|
+
...stateAttrs({
|
|
19
|
+
invalid: state.invalid,
|
|
20
|
+
disabled
|
|
21
|
+
}),
|
|
22
|
+
className: cx("nz-native-select", className),
|
|
23
|
+
style,
|
|
24
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
leadingIcon != null && /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "nz-native-select-icon",
|
|
27
|
+
"data-slot": "native-select-icon",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: leadingIcon
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ jsxs("select", {
|
|
32
|
+
...rest,
|
|
33
|
+
...value !== void 0 && { value },
|
|
34
|
+
...initial !== void 0 && { defaultValue: initial },
|
|
35
|
+
...disabled && { disabled: true },
|
|
36
|
+
"aria-invalid": state.invalid || void 0,
|
|
37
|
+
className: "nz-native-select-trigger",
|
|
38
|
+
"data-slot": "native-select-trigger",
|
|
39
|
+
children: [placeholder !== void 0 && /* @__PURE__ */ jsx("option", {
|
|
40
|
+
value: "",
|
|
41
|
+
disabled: true,
|
|
42
|
+
children: placeholder
|
|
43
|
+
}), children]
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "nz-native-select-chevron",
|
|
47
|
+
"data-slot": "native-select-chevron",
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
children: indicator ?? /* @__PURE__ */ jsx(ChevronsUpDownGlyph, {})
|
|
50
|
+
})
|
|
51
|
+
] })
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
Object.defineProperty(NativeSelect, FIELD_CONTROL, { value: true });
|
|
55
|
+
//#endregion
|
|
56
|
+
export { NativeSelect };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavItem } from "./nav-item.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/nav-item/nav-item.d.ts
|
|
4
|
+
export interface NavItemState {
|
|
5
|
+
current: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface NavItemProps extends Omit<ComponentPropsWithRef<"a">, "children"> {
|
|
9
|
+
/**
|
|
10
|
+
* The destination being shown: sets `aria-current="page"` and draws the filled state (Figma
|
|
11
|
+
* State=Active). The page knows its own route, so it says which item is current. @default false
|
|
12
|
+
*/
|
|
13
|
+
current?: boolean;
|
|
14
|
+
/** A decorative glyph before the label (20 px, Figma's Icon slot); it is `aria-hidden`. */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* A count after the label, such as the number of open orders (Figma's Count). Absent, or `null`,
|
|
18
|
+
* shows none. It is part of the link's text, so it is announced with the label.
|
|
19
|
+
*/
|
|
20
|
+
count?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Not available: renders a `<span role="link" aria-disabled="true">` with no `href`, so it is out
|
|
23
|
+
* of the Tab order and cannot be followed. `render` is ignored. @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The router's link, for example `render={<Link href="/orders" />}` (Next.js, React Router,
|
|
28
|
+
* TanStack Router). It must render an `<a>`.
|
|
29
|
+
*/
|
|
30
|
+
render?: RenderProp<NavItemState>;
|
|
31
|
+
/** The label (Figma's Label). It stays the accessible name in the collapsed rail. */
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export declare function NavItem({ current, icon, count, disabled, render, className, children, ...rest }: NavItemProps): ReactElement;
|
|
35
|
+
//#endregion
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { stateAttrs } from "../contracts/state.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/nav-item/nav-item.tsx
|
|
6
|
+
function NavItem({ current = false, icon, count, disabled = false, render, className, children, ...rest }) {
|
|
7
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8
|
+
icon != null && /* @__PURE__ */ jsx("span", {
|
|
9
|
+
className: "nz-nav-item-icon",
|
|
10
|
+
"data-slot": "nav-item-icon",
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
children: icon
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ jsx("span", {
|
|
15
|
+
className: "nz-nav-item-label",
|
|
16
|
+
"data-slot": "nav-item-label",
|
|
17
|
+
children
|
|
18
|
+
}),
|
|
19
|
+
count != null && /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "nz-nav-item-count",
|
|
21
|
+
"data-slot": "nav-item-count",
|
|
22
|
+
children: count
|
|
23
|
+
})
|
|
24
|
+
] });
|
|
25
|
+
if (disabled) {
|
|
26
|
+
const { href: _href, target: _target, rel: _rel, download: _download, ...attributes } = rest;
|
|
27
|
+
return /* @__PURE__ */ jsx("span", {
|
|
28
|
+
...attributes,
|
|
29
|
+
"data-slot": "nav-item",
|
|
30
|
+
...stateAttrs({ disabled: true }),
|
|
31
|
+
role: "link",
|
|
32
|
+
"aria-disabled": "true",
|
|
33
|
+
"aria-current": current ? "page" : rest["aria-current"],
|
|
34
|
+
className: cx("nz-nav-item", className),
|
|
35
|
+
children: content
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return renderElement("a", render, {
|
|
39
|
+
current,
|
|
40
|
+
disabled
|
|
41
|
+
}, {
|
|
42
|
+
"data-slot": "nav-item",
|
|
43
|
+
...rest,
|
|
44
|
+
"aria-current": current ? "page" : rest["aria-current"],
|
|
45
|
+
className: cx("nz-nav-item", className),
|
|
46
|
+
children: content
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { NavItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NumberValue, formatNumber } from "./number-value.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
3
|
+
//#region src/number-value/number-value.d.ts
|
|
4
|
+
export interface NumberValueState {
|
|
5
|
+
value: number;
|
|
6
|
+
/** The formatted text the element shows. */
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NumberValueProps extends Omit<ComponentPropsWithRef<"data">, "value" | "children"> {
|
|
10
|
+
/** The number. The element's `value` attribute carries it unformatted, for machines. */
|
|
11
|
+
value: number;
|
|
12
|
+
/** `Intl.NumberFormat` options (serialisable, so a Server Component can pass them). @default {} */
|
|
13
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
14
|
+
/** BCP 47 tag for the number. @default 'en-US' */
|
|
15
|
+
locale?: string | undefined;
|
|
16
|
+
render?: RenderProp<NumberValueState>;
|
|
17
|
+
}
|
|
18
|
+
/** The text NumberValue renders for `value`: `Intl.NumberFormat(locale, format)`, nothing else. */
|
|
19
|
+
export declare function formatNumber(value: number, format?: Intl.NumberFormatOptions, locale?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* A formatted number in a `<data>` element: tabular figures, isolated from the surrounding direction,
|
|
22
|
+
* never wrapped inside the number (§16.4). It takes the surrounding font; Metric gives it Numeric/*.
|
|
23
|
+
*/
|
|
24
|
+
export declare function NumberValue({ value, format, locale, render, className, ...rest }: NumberValueProps): ReactElement;
|
|
25
|
+
//#endregion
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
//#region src/number-value/number-value.tsx
|
|
4
|
+
/** The text NumberValue renders for `value`: `Intl.NumberFormat(locale, format)`, nothing else. */
|
|
5
|
+
function formatNumber(value, format = {}, locale = "en-US") {
|
|
6
|
+
return new Intl.NumberFormat(locale, format).format(value);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A formatted number in a `<data>` element: tabular figures, isolated from the surrounding direction,
|
|
10
|
+
* never wrapped inside the number (§16.4). It takes the surrounding font; Metric gives it Numeric/*.
|
|
11
|
+
*/
|
|
12
|
+
function NumberValue({ value, format, locale = "en-US", render, className, ...rest }) {
|
|
13
|
+
const text = formatNumber(value, format, locale);
|
|
14
|
+
return renderElement("data", render, {
|
|
15
|
+
value,
|
|
16
|
+
text
|
|
17
|
+
}, {
|
|
18
|
+
"data-slot": "number-value",
|
|
19
|
+
...rest,
|
|
20
|
+
value: String(value),
|
|
21
|
+
className: cx("nz-number-value", className),
|
|
22
|
+
children: text
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { NumberValue, formatNumber };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageHeader } from "./page-header.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/page-header/page-header.d.ts
|
|
4
|
+
export type PageHeaderTitleLevel = 1 | 2;
|
|
5
|
+
export interface PageHeaderProps extends Omit<ComponentPropsWithRef<"header">, "title" | "children"> {
|
|
6
|
+
/** The page's title. One `<h1>` per page: the shell's top bar does not repeat it as a heading. */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** `2` for a page whose `<h1>` is elsewhere. Its look stays Heading/H1. @default 1 */
|
|
9
|
+
level?: PageHeaderTitleLevel;
|
|
10
|
+
/** Beside the title, for example a status `<Badge>`. */
|
|
11
|
+
meta?: ReactNode;
|
|
12
|
+
/** A line under the title, Body/M in `text/secondary`. */
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
/** The page's controls at the row's end, for example a SegmentedControl and Buttons. */
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
render?: RenderProp<Record<string, never>>;
|
|
17
|
+
}
|
|
18
|
+
export declare function PageHeader({ title, level, meta, description, actions, render, className, ...rest }: PageHeaderProps): ReactElement;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/page-header/page-header.tsx
|
|
5
|
+
function PageHeader({ title, level = 1, meta, description, actions, render, className, ...rest }) {
|
|
6
|
+
const Title = `h${level}`;
|
|
7
|
+
return renderElement("header", render, {}, {
|
|
8
|
+
"data-slot": "page-header",
|
|
9
|
+
...rest,
|
|
10
|
+
className: cx("nz-page-header", className),
|
|
11
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: "nz-page-header-content",
|
|
13
|
+
"data-slot": "page-header-content",
|
|
14
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: "nz-page-header-heading",
|
|
16
|
+
"data-slot": "page-header-heading",
|
|
17
|
+
children: [/* @__PURE__ */ jsx(Title, {
|
|
18
|
+
className: "nz-page-header-title",
|
|
19
|
+
"data-slot": "page-header-title",
|
|
20
|
+
children: title
|
|
21
|
+
}), meta != null && /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: "nz-page-header-meta",
|
|
23
|
+
"data-slot": "page-header-meta",
|
|
24
|
+
children: meta
|
|
25
|
+
})]
|
|
26
|
+
}), description != null && /* @__PURE__ */ jsx("p", {
|
|
27
|
+
className: "nz-page-header-description",
|
|
28
|
+
"data-slot": "page-header-description",
|
|
29
|
+
children: description
|
|
30
|
+
})]
|
|
31
|
+
}), actions != null && /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: "nz-page-header-actions",
|
|
33
|
+
"data-slot": "page-header-actions",
|
|
34
|
+
children: actions
|
|
35
|
+
})] })
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PageHeader };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Pagination, PaginationChangeReason, PaginationLabels, PaginationLinkState, PaginationProps, PaginationSize, PaginationSlot, PaginationState } from "./pagination.js";
|
|
2
|
+
export { Pagination, type PaginationChangeReason, type PaginationLabels, type PaginationLinkState, type PaginationProps, type PaginationSize, type PaginationSlot, type PaginationState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from "./pagination.js";
|