@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,94 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { formatLabel } from "../i18n/format-label.js";
|
|
4
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/avatar/avatar.tsx
|
|
7
|
+
/** A word's first character (a whole code point, so an astral letter is not split). */
|
|
8
|
+
const letter = (word) => Array.from(word)[0] ?? "";
|
|
9
|
+
/** The first and last words' first letters, upper-cased; one word gives one letter. */
|
|
10
|
+
function avatarInitials(name) {
|
|
11
|
+
const words = name.trim().split(/\s+/u).filter((word) => word !== "");
|
|
12
|
+
const first = words[0];
|
|
13
|
+
if (first === void 0) return "";
|
|
14
|
+
const last = words.length > 1 ? words[words.length - 1] : void 0;
|
|
15
|
+
return (letter(first) + (last === void 0 ? "" : letter(last))).toUpperCase();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A person's or store's photo laid over their initials, with no script: the initials are always
|
|
19
|
+
* rendered, so a missing photo needs no `onError`. Known limit: a `src` that fails to load shows
|
|
20
|
+
* WebKit's (Safari's) broken-image mark over the initials, with no script-free fix; pass `src` only
|
|
21
|
+
* when it is known to load, or leave it out and the initials show.
|
|
22
|
+
*/
|
|
23
|
+
function Avatar({ name, src, srcSet, sizes, image, initials, size = "md", decorative = false, render, className, ...rest }) {
|
|
24
|
+
return renderElement("span", render, {
|
|
25
|
+
size,
|
|
26
|
+
image: src !== void 0 || image !== void 0,
|
|
27
|
+
decorative
|
|
28
|
+
}, {
|
|
29
|
+
"data-slot": "avatar",
|
|
30
|
+
"data-size": size,
|
|
31
|
+
...decorative ? { "aria-hidden": true } : {
|
|
32
|
+
role: "img",
|
|
33
|
+
"aria-label": name
|
|
34
|
+
},
|
|
35
|
+
...rest,
|
|
36
|
+
className: cx("nz-avatar", className),
|
|
37
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "nz-avatar-initials",
|
|
39
|
+
"data-slot": "avatar-initials",
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: initials ?? avatarInitials(name)
|
|
42
|
+
}), image !== void 0 ? cloneElement(image, {
|
|
43
|
+
"data-slot": "avatar-image",
|
|
44
|
+
alt: "",
|
|
45
|
+
className: cx("nz-avatar-image", image.props.className)
|
|
46
|
+
}) : src !== void 0 && /* @__PURE__ */ jsx("img", {
|
|
47
|
+
className: "nz-avatar-image",
|
|
48
|
+
"data-slot": "avatar-image",
|
|
49
|
+
alt: "",
|
|
50
|
+
src,
|
|
51
|
+
srcSet,
|
|
52
|
+
sizes,
|
|
53
|
+
loading: "lazy",
|
|
54
|
+
decoding: "async"
|
|
55
|
+
})] })
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A stack of avatars and a count, announced as one item (Figma: "Maya, Jonah, Priya and 4 more"):
|
|
60
|
+
* the root is `role="img"` named by the list of names, and every avatar inside is decorative.
|
|
61
|
+
*/
|
|
62
|
+
function AvatarGroup({ max = 3, total, size = "md", locale = "en-US", labels, render, className, children, ...rest }) {
|
|
63
|
+
const avatars = Children.toArray(children).filter((child) => isValidElement(child));
|
|
64
|
+
const shown = avatars.slice(0, Math.max(0, max));
|
|
65
|
+
const hidden = Math.max(0, (total ?? avatars.length) - shown.length);
|
|
66
|
+
const names = shown.map((avatar) => avatar.props.name);
|
|
67
|
+
if (hidden > 0) names.push(formatLabel(labels?.more ?? "{count} more", { count: hidden }, locale));
|
|
68
|
+
const label = new Intl.ListFormat(locale, {
|
|
69
|
+
style: "long",
|
|
70
|
+
type: "conjunction"
|
|
71
|
+
}).format(names);
|
|
72
|
+
return renderElement("span", render, {
|
|
73
|
+
size,
|
|
74
|
+
hidden
|
|
75
|
+
}, {
|
|
76
|
+
"data-slot": "avatar-group",
|
|
77
|
+
"data-size": size,
|
|
78
|
+
role: "img",
|
|
79
|
+
"aria-label": label,
|
|
80
|
+
...rest,
|
|
81
|
+
className: cx("nz-avatar-group", className),
|
|
82
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [shown.map((avatar) => cloneElement(avatar, {
|
|
83
|
+
size,
|
|
84
|
+
decorative: true
|
|
85
|
+
})), hidden > 0 && /* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "nz-avatar-group-more",
|
|
87
|
+
"data-slot": "avatar-group-more",
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
children: formatLabel(labels?.overflow ?? "+{count}", { count: hidden }, locale)
|
|
90
|
+
})] })
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Avatar, AvatarGroup, avatarInitials };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarGroupState, AvatarProps, AvatarSize, AvatarState } from "./avatar.js";
|
|
2
|
+
export { Avatar, AvatarGroup, type AvatarGroupLabels, type AvatarGroupProps, type AvatarGroupState, type AvatarProps, type AvatarSize, type AvatarState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, AvatarGroup } from "./avatar.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
3
|
+
//#region src/badge/badge.d.ts
|
|
4
|
+
/** Figma "Tone". `brand` is the only solid fill. */
|
|
5
|
+
export type BadgeTone = "neutral" | "success" | "warning" | "critical" | "info" | "brand";
|
|
6
|
+
export interface BadgeState {
|
|
7
|
+
tone: BadgeTone;
|
|
8
|
+
dot: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface BadgeProps extends ComponentPropsWithRef<"span"> {
|
|
11
|
+
/** @default 'neutral' */
|
|
12
|
+
tone?: BadgeTone;
|
|
13
|
+
/** Figma "Dot": a decorative status dot before the label. The label carries the meaning. @default true */
|
|
14
|
+
dot?: boolean;
|
|
15
|
+
/** Composition, for example `render={<a href="/orders?status=paid" />}`. */
|
|
16
|
+
render?: RenderProp<BadgeState>;
|
|
17
|
+
}
|
|
18
|
+
export declare function Badge({ tone, dot, render, className, children, ...rest }: BadgeProps): ReactElement;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1,22 @@
|
|
|
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/badge/badge.tsx
|
|
5
|
+
function Badge({ tone = "neutral", dot = true, render, className, children, ...rest }) {
|
|
6
|
+
return renderElement("span", render, {
|
|
7
|
+
tone,
|
|
8
|
+
dot
|
|
9
|
+
}, {
|
|
10
|
+
"data-slot": "badge",
|
|
11
|
+
"data-tone": tone,
|
|
12
|
+
...rest,
|
|
13
|
+
className: cx("nz-badge", className),
|
|
14
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [dot && /* @__PURE__ */ jsx("span", {
|
|
15
|
+
className: "nz-badge-dot",
|
|
16
|
+
"data-slot": "badge-dot",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}), children] })
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Badge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from "./badge.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/banner/banner-dismiss.client.d.ts
|
|
4
|
+
/** Strings this part renders (§16.4). */
|
|
5
|
+
export interface BannerDismissLabels {
|
|
6
|
+
/** The button's accessible name. @default 'Dismiss' */
|
|
7
|
+
dismiss: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BannerDismissProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
|
|
10
|
+
/**
|
|
11
|
+
* Called with no arguments, so a Server Component can pass a Server Action. The Banner does not hide
|
|
12
|
+
* itself: the caller stops rendering it.
|
|
13
|
+
*/
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
labels?: Partial<BannerDismissLabels>;
|
|
16
|
+
/** The close glyph, decorative. Defaults to the internal `close` glyph (Lucide's `x`). */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Your element in place of the default IconButton; it must render a `<button>`. A plain element
|
|
20
|
+
* keeps its own look. An IconButton, for example
|
|
21
|
+
* `render={<IconButton icon={<X />} label="Dismiss" variant="tertiary" />}` to add its
|
|
22
|
+
* tooltip, keeps its variant and size, and in a Banner takes the icon/secondary glyph colour, as a
|
|
23
|
+
* composed IconButton does in `Dialog.Close`.
|
|
24
|
+
*/
|
|
25
|
+
render?: RenderProp<Record<string, never>>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* With no `render`, an IconButton (tertiary, `md`: a 20 px glyph, Figma draws 18, in a 40 px target,
|
|
29
|
+
* the height of the Banner's action) with no tooltip, as `Dialog.Close` does.
|
|
30
|
+
*/
|
|
31
|
+
export declare function BannerDismiss({ onDismiss, labels: labelsProp, "aria-label": ariaLabel, type, render, className, onClick, children, ...rest }: BannerDismissProps): ReactElement;
|
|
32
|
+
//#endregion
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../_internal/cx.js";
|
|
3
|
+
import { renderElement } from "../contracts/render.js";
|
|
4
|
+
import { useLabels } from "../config/config.client.js";
|
|
5
|
+
import { CloseGlyph } from "../_internal/glyphs.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/banner/banner-dismiss.client.tsx
|
|
8
|
+
/**
|
|
9
|
+
* With no `render`, an IconButton (tertiary, `md`: a 20 px glyph, Figma draws 18, in a 40 px target,
|
|
10
|
+
* the height of the Banner's action) with no tooltip, as `Dialog.Close` does.
|
|
11
|
+
*/
|
|
12
|
+
function BannerDismiss({ onDismiss, labels: labelsProp, "aria-label": ariaLabel, type, render, className, onClick, children, ...rest }) {
|
|
13
|
+
const labels = useLabels("bannerDismiss", labelsProp);
|
|
14
|
+
const own = render === void 0;
|
|
15
|
+
return renderElement("button", render, {}, {
|
|
16
|
+
"data-slot": "banner-dismiss",
|
|
17
|
+
...own && {
|
|
18
|
+
"data-variant": "tertiary",
|
|
19
|
+
"data-size": "md"
|
|
20
|
+
},
|
|
21
|
+
...rest,
|
|
22
|
+
type: own ? type ?? "button" : void 0,
|
|
23
|
+
"aria-label": ariaLabel ?? labels?.dismiss ?? "Dismiss",
|
|
24
|
+
className: cx("nz-banner-dismiss", own && "nz-icon-button", "nz-hit-target", className),
|
|
25
|
+
onClick: (event) => {
|
|
26
|
+
onClick?.(event);
|
|
27
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "nz-icon-button-icon",
|
|
31
|
+
"data-slot": "icon-button-icon",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: children ?? /* @__PURE__ */ jsx(CloseGlyph, {})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { BannerDismiss };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/banner/banner.d.ts
|
|
4
|
+
/** Figma "Tone": `brand` is Figma's Promo (handoff Q25, D-bq). */
|
|
5
|
+
export type BannerTone = "brand" | "warning";
|
|
6
|
+
export interface BannerState {
|
|
7
|
+
tone: BannerTone;
|
|
8
|
+
}
|
|
9
|
+
export interface BannerProps extends Omit<ComponentPropsWithRef<"div">, "title"> {
|
|
10
|
+
/** @default 'brand' */
|
|
11
|
+
tone?: BannerTone;
|
|
12
|
+
/** One line, Heading/H4. The description is `children`. */
|
|
13
|
+
title?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* A 72 px picture before the text, such as Figma's product render on the brand banner:
|
|
16
|
+
* `<img src="…" alt="" width={72} height={72} />`. Decorative; the text carries the message.
|
|
17
|
+
*/
|
|
18
|
+
media?: ReactNode;
|
|
19
|
+
/** Decorative tone glyph at 24 px, such as a triangle for `warning`; used when there is no `media`. */
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/** One control after the text, such as `<Button variant="primary">Add storefront</Button>`. */
|
|
22
|
+
action?: ReactNode;
|
|
23
|
+
/** `<BannerDismiss onDismiss={…} />`; leave it out for a banner that blocks work and stays. */
|
|
24
|
+
dismiss?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* No live role by default: a banner present on page load must not interrupt. Pass `role="status"`
|
|
27
|
+
* for one added after a user action.
|
|
28
|
+
*/
|
|
29
|
+
role?: ComponentPropsWithRef<"div">["role"];
|
|
30
|
+
render?: RenderProp<BannerState>;
|
|
31
|
+
}
|
|
32
|
+
/** A page-wide message under the header (Figma Banner 7275:15120): one at a time. */
|
|
33
|
+
export declare function Banner({ tone, title, media, icon, action, dismiss, render, className, children, ...rest }: BannerProps): ReactElement;
|
|
34
|
+
//#endregion
|
|
@@ -0,0 +1,47 @@
|
|
|
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/banner/banner.tsx
|
|
5
|
+
/** A page-wide message under the header (Figma Banner 7275:15120): one at a time. */
|
|
6
|
+
function Banner({ tone = "brand", title, media, icon, action, dismiss, render, className, children, ...rest }) {
|
|
7
|
+
return renderElement("div", render, { tone }, {
|
|
8
|
+
"data-slot": "banner",
|
|
9
|
+
"data-tone": tone,
|
|
10
|
+
...rest,
|
|
11
|
+
className: cx("nz-banner", className),
|
|
12
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
+
media != null ? /* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: "nz-banner-media",
|
|
15
|
+
"data-slot": "banner-media",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
children: media
|
|
18
|
+
}) : icon != null && /* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "nz-banner-icon",
|
|
20
|
+
"data-slot": "banner-icon",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: icon
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "nz-banner-content",
|
|
26
|
+
"data-slot": "banner-content",
|
|
27
|
+
children: [title != null && /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: "nz-banner-title",
|
|
29
|
+
"data-slot": "banner-title",
|
|
30
|
+
children: title
|
|
31
|
+
}), children != null && children !== false && children !== "" && /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: "nz-banner-description",
|
|
33
|
+
"data-slot": "banner-description",
|
|
34
|
+
children
|
|
35
|
+
})]
|
|
36
|
+
}),
|
|
37
|
+
action != null && /* @__PURE__ */ jsx("div", {
|
|
38
|
+
className: "nz-banner-action",
|
|
39
|
+
"data-slot": "banner-action",
|
|
40
|
+
children: action
|
|
41
|
+
}),
|
|
42
|
+
dismiss
|
|
43
|
+
] })
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Banner };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Banner, BannerProps, BannerState, BannerTone } from "./banner.js";
|
|
2
|
+
import { BannerDismiss, BannerDismissLabels, BannerDismissProps } from "./banner-dismiss.client.js";
|
|
3
|
+
export { Banner, BannerDismiss, type BannerDismissLabels, type BannerDismissProps, type BannerProps, type BannerState, type BannerTone };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/breadcrumb/breadcrumb.d.ts
|
|
4
|
+
/** Breadcrumb's own strings (§16.4): serialisable, English defaults. */
|
|
5
|
+
export interface BreadcrumbLabels {
|
|
6
|
+
/** The landmark's name. @default 'Breadcrumb' */
|
|
7
|
+
nav: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BreadcrumbRootProps extends ComponentPropsWithRef<"nav"> {
|
|
10
|
+
/**
|
|
11
|
+
* Replaces the chevron between levels on every `Breadcrumb.Item` that sets none. It is decorative
|
|
12
|
+
* (`aria-hidden`), so a character such as "/" is fine. It is not mirrored under `dir="rtl"`.
|
|
13
|
+
*/
|
|
14
|
+
separator?: ReactNode;
|
|
15
|
+
/** An `aria-label` wins over `labels.nav`. */
|
|
16
|
+
labels?: Partial<BreadcrumbLabels>;
|
|
17
|
+
/** Must render a navigation landmark (a `<nav>`, or an element with `role="navigation"`). */
|
|
18
|
+
render?: RenderProp<Record<string, never>>;
|
|
19
|
+
/** `Breadcrumb.Item` elements, the root of the site first. */
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export interface BreadcrumbItemState {
|
|
23
|
+
current: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface BreadcrumbItemProps extends Omit<ComponentPropsWithRef<"a">, "children"> {
|
|
26
|
+
/**
|
|
27
|
+
* The page being shown: renders text with `aria-current="page"` instead of a link (Figma: the last
|
|
28
|
+
* item, Label/M Strong). @default false
|
|
29
|
+
*/
|
|
30
|
+
current?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The router's link, for example `render={<Link href="/products" />}`. It must render an `<a>`.
|
|
33
|
+
* Ignored on the current item, which is not a link; so are the other anchor props (`href`), while
|
|
34
|
+
* `className` goes on whichever element renders.
|
|
35
|
+
*/
|
|
36
|
+
render?: RenderProp<BreadcrumbItemState>;
|
|
37
|
+
/**
|
|
38
|
+
* The mark before this level (none is drawn before the first). Only the default chevron mirrors
|
|
39
|
+
* under `dir="rtl"`. @default the chevron glyph
|
|
40
|
+
*/
|
|
41
|
+
separator?: ReactNode;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export declare function BreadcrumbRoot({ separator, labels, render, className, children, ...rest }: BreadcrumbRootProps): ReactElement;
|
|
45
|
+
export declare function BreadcrumbItem({ current, render, separator, className, children, ...rest }: BreadcrumbItemProps): ReactElement;
|
|
46
|
+
//#endregion
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { ChevronGlyph } from "../_internal/glyphs.js";
|
|
4
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/breadcrumb/breadcrumb.tsx
|
|
7
|
+
function BreadcrumbRoot({ separator, labels, render, className, children, ...rest }) {
|
|
8
|
+
const items = separator === void 0 ? children : Children.map(children, (child) => isValidElement(child) && child.type === BreadcrumbItem && child.props.separator === void 0 ? cloneElement(child, { separator }) : child);
|
|
9
|
+
return renderElement("nav", render, {}, {
|
|
10
|
+
"data-slot": "breadcrumb",
|
|
11
|
+
"aria-label": labels?.nav ?? "Breadcrumb",
|
|
12
|
+
...rest,
|
|
13
|
+
className: cx("nz-breadcrumb", className),
|
|
14
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
15
|
+
className: "nz-breadcrumb-list",
|
|
16
|
+
"data-slot": "breadcrumb-list",
|
|
17
|
+
children: items
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function BreadcrumbItem({ current = false, render, separator, className, children, ...rest }) {
|
|
22
|
+
const level = current ? /* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: cx("nz-breadcrumb-current", className),
|
|
24
|
+
"data-slot": "breadcrumb-current",
|
|
25
|
+
"aria-current": "page",
|
|
26
|
+
children
|
|
27
|
+
}) : renderElement("a", render, { current }, {
|
|
28
|
+
"data-slot": "breadcrumb-link",
|
|
29
|
+
...rest,
|
|
30
|
+
className: cx("nz-breadcrumb-link", className),
|
|
31
|
+
children
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
34
|
+
className: "nz-breadcrumb-item",
|
|
35
|
+
"data-slot": "breadcrumb-item",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "nz-breadcrumb-separator",
|
|
38
|
+
"data-slot": "breadcrumb-separator",
|
|
39
|
+
"data-mirror": separator === void 0 ? "rtl" : void 0,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: separator ?? /* @__PURE__ */ jsx(ChevronGlyph, {})
|
|
42
|
+
}), level]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { BreadcrumbItem, BreadcrumbRoot };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BreadcrumbItem, BreadcrumbRoot } from "./breadcrumb.js";
|
|
2
|
+
declare namespace breadcrumb_parts_d_exports {
|
|
3
|
+
export { BreadcrumbItem as Item, BreadcrumbRoot as Root };
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { BreadcrumbItem as Item, BreadcrumbRoot as Root, breadcrumb_parts_d_exports };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { BreadcrumbItem, BreadcrumbRoot } from "./breadcrumb.js";
|
|
3
|
+
//#region src/breadcrumb/breadcrumb.parts.ts
|
|
4
|
+
var breadcrumb_parts_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Item: () => BreadcrumbItem,
|
|
6
|
+
Root: () => BreadcrumbRoot
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BreadcrumbItem as Item, BreadcrumbRoot as Root, breadcrumb_parts_exports };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BreadcrumbItem, BreadcrumbItemProps, BreadcrumbItemState, BreadcrumbLabels, BreadcrumbRoot, BreadcrumbRootProps } from "./breadcrumb.js";
|
|
2
|
+
import { breadcrumb_parts_d_exports } from "./breadcrumb.parts.js";
|
|
3
|
+
export { breadcrumb_parts_d_exports as Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbItemState, type BreadcrumbLabels, BreadcrumbRoot, type BreadcrumbRootProps };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ButtonVariant, ControlSize } from "../augment.js";
|
|
3
|
+
import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
|
|
4
|
+
//#region src/button/button.d.ts
|
|
5
|
+
export interface ButtonState {
|
|
6
|
+
variant: ButtonVariant;
|
|
7
|
+
size: ControlSize;
|
|
8
|
+
pending: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Button's own strings (§16.4): serialisable, English defaults. */
|
|
12
|
+
export interface ButtonLabels {
|
|
13
|
+
/**
|
|
14
|
+
* The text a pending button shows in place of its label under Reduced motion, where the spinner stops
|
|
15
|
+
* (Figma: "Spinner and skeleton loops stop; a text label shows").
|
|
16
|
+
* @default 'Loading…'
|
|
17
|
+
*/
|
|
18
|
+
pending: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
|
|
21
|
+
/**
|
|
22
|
+
* Figma "Variant". One primary per view; secondary for everything else; tertiary inside dense rows.
|
|
23
|
+
* @default 'secondary'
|
|
24
|
+
*/
|
|
25
|
+
variant?: ButtonVariant;
|
|
26
|
+
/** 32 / 40 / 48 px. @default 'md' */
|
|
27
|
+
size?: ControlSize;
|
|
28
|
+
leadingIcon?: ReactNode;
|
|
29
|
+
trailingIcon?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* An action is in flight: the spinner replaces the leading icon, the label stays, and the button
|
|
32
|
+
* stays focusable with `aria-disabled` and swallows clicks. The spinner turns once per
|
|
33
|
+
* `--nz-duration-spin`; under Reduced motion it stops and `labels.pending` ("Loading…") shows in
|
|
34
|
+
* the label's place, in a button that keeps its width. The label stays in the accessible name,
|
|
35
|
+
* after that text ("Loading… Publish").
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
pending?: boolean;
|
|
39
|
+
/** Replaces the internal spinner glyph. */
|
|
40
|
+
pendingIndicator?: ReactNode;
|
|
41
|
+
/** Fills the width of its container. @default false */
|
|
42
|
+
fullWidth?: boolean;
|
|
43
|
+
/** Composition, for example `render={<Link href="/orders" />}`. */
|
|
44
|
+
render?: RenderProp<ButtonState>;
|
|
45
|
+
/**
|
|
46
|
+
* Overrides Button's strings, for example `labels={{ pending: 'Wird geladen…' }}`; `pending: ''`
|
|
47
|
+
* shows no text and keeps the label visible. Translation is per instance: Button is a server
|
|
48
|
+
* part, so `NizivoConfig labels` does not reach it, and an app wraps Button once to pass its own.
|
|
49
|
+
* SubmitButton, its client twin, does read them (`button.pending`).
|
|
50
|
+
*/
|
|
51
|
+
labels?: Partial<ButtonLabels>;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export declare function Button({ variant, size, leadingIcon, trailingIcon, pending, pendingIndicator, fullWidth, disabled, type, render, className, onClick, labels, children, ...rest }: ButtonProps): ReactElement;
|
|
55
|
+
//#endregion
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cx } from "../_internal/cx.js";
|
|
2
|
+
import { renderElement } from "../contracts/render.js";
|
|
3
|
+
import { SpinnerGlyph } from "../_internal/glyphs.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/button/button.tsx
|
|
6
|
+
function Button({ variant = "secondary", size = "md", leadingIcon, trailingIcon, pending = false, pendingIndicator, fullWidth = false, disabled = false, type, render, className, onClick, labels, children, ...rest }) {
|
|
7
|
+
const native = render === void 0;
|
|
8
|
+
const empty = children == null && leadingIcon == null && trailingIcon == null && !pending;
|
|
9
|
+
return renderElement("button", render, {
|
|
10
|
+
variant,
|
|
11
|
+
size,
|
|
12
|
+
pending,
|
|
13
|
+
disabled
|
|
14
|
+
}, {
|
|
15
|
+
"data-slot": "button",
|
|
16
|
+
"data-variant": variant,
|
|
17
|
+
"data-size": size,
|
|
18
|
+
"data-pending": pending ? "" : void 0,
|
|
19
|
+
"data-disabled": disabled ? "" : void 0,
|
|
20
|
+
"data-full-width": fullWidth ? "" : void 0,
|
|
21
|
+
...rest,
|
|
22
|
+
className: cx("nz-button nz-hit-target", className),
|
|
23
|
+
type: native ? pending ? "button" : type ?? "button" : void 0,
|
|
24
|
+
disabled: native && disabled && !pending ? true : void 0,
|
|
25
|
+
"aria-disabled": pending || !native && disabled ? true : void 0,
|
|
26
|
+
onClick: pending && onClick ? swallow : onClick,
|
|
27
|
+
children: empty ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
pending ? /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "nz-button-icon",
|
|
30
|
+
"data-slot": "button-icon",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: pendingIndicator ?? /* @__PURE__ */ jsx(SpinnerGlyph, {})
|
|
33
|
+
}) : leadingIcon != null && /* @__PURE__ */ jsx("span", {
|
|
34
|
+
className: "nz-button-icon",
|
|
35
|
+
"data-slot": "button-icon",
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
children: leadingIcon
|
|
38
|
+
}),
|
|
39
|
+
pending && labels?.pending !== "" && /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "nz-button-pending-label",
|
|
41
|
+
"data-slot": "button-pending-label",
|
|
42
|
+
children: labels?.pending ?? "Loading…"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "nz-button-label",
|
|
46
|
+
"data-slot": "button-label",
|
|
47
|
+
children
|
|
48
|
+
}),
|
|
49
|
+
trailingIcon != null && /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "nz-button-icon",
|
|
51
|
+
"data-slot": "button-icon",
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
children: trailingIcon
|
|
54
|
+
})
|
|
55
|
+
] })
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function swallow(event) {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Button };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "./button.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { RenderProp } from "../contracts/render.js";
|
|
2
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
3
|
+
//#region src/card/card.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Figma "Style": Surface | Subtle | Inverse, plus the tinted surfaces of the dashboard widgets (KPI
|
|
6
|
+
* Tile "Tinted", Insight Card Brand and Accent; figma/04 §2/§3, M41): `brand` (bg/brand-subtle) and
|
|
7
|
+
* `accent` (bg/accent-subtle).
|
|
8
|
+
*/
|
|
9
|
+
export type CardTone = "surface" | "subtle" | "inverse" | "brand" | "accent";
|
|
10
|
+
export type CardTitleLevel = 2 | 3 | 4 | 5 | 6;
|
|
11
|
+
/** 24 px (`md`, Figma) or 20 px (`sm`). */
|
|
12
|
+
export type CardPadding = "sm" | "md";
|
|
13
|
+
/** 0 draws no shadow (the rest elevation); 1 draws `--nz-elevation-1`. */
|
|
14
|
+
export type CardElevation = 0 | 1;
|
|
15
|
+
export interface CardRootState {
|
|
16
|
+
tone: CardTone;
|
|
17
|
+
padding: CardPadding;
|
|
18
|
+
elevation: CardElevation;
|
|
19
|
+
}
|
|
20
|
+
export interface CardRootProps extends ComponentPropsWithRef<"div"> {
|
|
21
|
+
/**
|
|
22
|
+
* `inverse` sets `data-nz-scheme="inverse"`, so every token inside resolves in the inverse scheme.
|
|
23
|
+
* Every tone declares `--nz-surface`, the colour the card paints, for children to read with a
|
|
24
|
+
* fallback (`var(--nz-surface, var(--nz-bg-surface))`); on `brand` and `accent` a Delta pill
|
|
25
|
+
* inside is `bg/surface`, so it shows on the tint (M42).
|
|
26
|
+
* @default 'surface'
|
|
27
|
+
*/
|
|
28
|
+
tone?: CardTone;
|
|
29
|
+
/** @default 'md' */
|
|
30
|
+
padding?: CardPadding;
|
|
31
|
+
/** No shadow at rest until design says otherwise (decision 8j). @default 0 */
|
|
32
|
+
elevation?: CardElevation;
|
|
33
|
+
render?: RenderProp<CardRootState>;
|
|
34
|
+
}
|
|
35
|
+
export interface CardHeaderProps extends ComponentPropsWithRef<"div"> {
|
|
36
|
+
render?: RenderProp<Record<string, never>>;
|
|
37
|
+
}
|
|
38
|
+
export interface CardTitleProps extends ComponentPropsWithRef<"h3"> {
|
|
39
|
+
/** The heading level; its look is Heading/H4 at every level. @default 3 */
|
|
40
|
+
level?: CardTitleLevel;
|
|
41
|
+
render?: RenderProp<Record<string, never>>;
|
|
42
|
+
}
|
|
43
|
+
export interface CardDescriptionProps extends ComponentPropsWithRef<"p"> {
|
|
44
|
+
render?: RenderProp<Record<string, never>>;
|
|
45
|
+
}
|
|
46
|
+
/** Figma "Show action": the control at the end of the header, for example an IconButton. */
|
|
47
|
+
export interface CardActionProps extends ComponentPropsWithRef<"div"> {
|
|
48
|
+
render?: RenderProp<Record<string, never>>;
|
|
49
|
+
}
|
|
50
|
+
/** Figma's "Slot" frame. */
|
|
51
|
+
export interface CardBodyProps extends ComponentPropsWithRef<"div"> {
|
|
52
|
+
render?: RenderProp<Record<string, never>>;
|
|
53
|
+
}
|
|
54
|
+
export interface CardFooterProps extends ComponentPropsWithRef<"div"> {
|
|
55
|
+
render?: RenderProp<Record<string, never>>;
|
|
56
|
+
}
|
|
57
|
+
export declare function CardRoot({ tone, padding, elevation, render, className, ...rest }: CardRootProps): ReactElement;
|
|
58
|
+
export declare function CardHeader({ render, className, ...rest }: CardHeaderProps): ReactElement;
|
|
59
|
+
export declare function CardTitle({ level, render, className, ...rest }: CardTitleProps): ReactElement;
|
|
60
|
+
export declare function CardDescription({ render, className, ...rest }: CardDescriptionProps): ReactElement;
|
|
61
|
+
export declare function CardAction({ render, className, ...rest }: CardActionProps): ReactElement;
|
|
62
|
+
export declare function CardBody({ render, className, ...rest }: CardBodyProps): ReactElement;
|
|
63
|
+
export declare function CardFooter({ render, className, ...rest }: CardFooterProps): ReactElement;
|
|
64
|
+
//#endregion
|