@nordhealth/components 4.26.2 → 5.0.0-alpha.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/custom-elements.json +53898 -21499
- package/lib/Accordion.js +2 -0
- package/lib/Accordion.js.map +1 -0
- package/lib/AccordionHeader.js +2 -0
- package/lib/AccordionHeader.js.map +1 -0
- package/lib/AccordionItem.js +2 -0
- package/lib/AccordionItem.js.map +1 -0
- package/lib/AccordionPanel.js +2 -0
- package/lib/AccordionPanel.js.map +1 -0
- package/lib/AccordionTrigger.js +2 -0
- package/lib/AccordionTrigger.js.map +1 -0
- package/lib/ActiveDescendantController-BnMqM79O.js +2 -0
- package/lib/ActiveDescendantController-BnMqM79O.js.map +1 -0
- package/lib/Aside.js +5 -7
- package/lib/Aside.js.map +1 -1
- package/lib/AsideDrawer.js +7 -11
- package/lib/AsideDrawer.js.map +1 -1
- package/lib/AsideTrigger.js +3 -4
- package/lib/AsideTrigger.js.map +1 -1
- package/lib/Autocomplete.js +2 -0
- package/lib/Autocomplete.js.map +1 -0
- package/lib/Avatar.js +1 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +1 -1
- package/lib/Badge.js.map +1 -1
- package/lib/Banner.js +1 -1
- package/lib/Banner.js.map +1 -1
- package/lib/Button.js +7 -12
- package/lib/Button.js.map +1 -1
- package/lib/ButtonGroup.js +1 -1
- package/lib/ButtonGroup.js.map +1 -1
- package/lib/Calendar-C1SxrlzN.js +2 -0
- package/lib/Calendar-C1SxrlzN.js.map +1 -0
- package/lib/Calendar.js +1 -1
- package/lib/Card.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/Checkbox.js +1 -1
- package/lib/Checkbox.js.map +1 -1
- package/lib/CollapseController-BtKNFNyJ.js +2 -0
- package/lib/CollapseController-BtKNFNyJ.js.map +1 -0
- package/lib/Collapsible.js +2 -0
- package/lib/Collapsible.js.map +1 -0
- package/lib/CollapsiblePanel.js +2 -0
- package/lib/CollapsiblePanel.js.map +1 -0
- package/lib/CollapsibleTrigger.js +2 -0
- package/lib/CollapsibleTrigger.js.map +1 -0
- package/lib/Combobox-By4h1Sp-.js +2 -0
- package/lib/Combobox-By4h1Sp-.js.map +1 -0
- package/lib/Combobox.js +2 -0
- package/lib/Combobox.js.map +1 -0
- package/lib/ComboboxBase.js +2 -0
- package/lib/ComboboxBase.js.map +1 -0
- package/lib/ComboboxEvents.js +2 -0
- package/lib/ComboboxEvents.js.map +1 -0
- package/lib/ComboboxGroup.js +2 -0
- package/lib/ComboboxGroup.js.map +1 -0
- package/lib/ComboboxOption.js +2 -0
- package/lib/ComboboxOption.js.map +1 -0
- package/lib/CommandMenu.js +1 -1
- package/lib/CommandMenu.js.map +1 -1
- package/lib/CommandMenuAction.js +1 -1
- package/lib/CommandMenuAction.js.map +1 -1
- package/lib/Component-BJ5O5n8k.js +2 -0
- package/lib/Component-BJ5O5n8k.js.map +1 -0
- package/lib/DatePicker.js +1 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/DateRangeChangeEvent.js +2 -0
- package/lib/DateRangeChangeEvent.js.map +1 -0
- package/lib/DateRangePicker.js +2 -0
- package/lib/DateRangePicker.js.map +1 -0
- package/lib/DateRangeSelectEvent.js +2 -0
- package/lib/DateRangeSelectEvent.js.map +1 -0
- package/lib/Divider.js +1 -1
- package/lib/Divider.js.map +1 -1
- package/lib/DraftComponentMixin-4qug5Rky.js +2 -0
- package/lib/DraftComponentMixin-4qug5Rky.js.map +1 -0
- package/lib/Drawer.js +1 -1
- package/lib/Drawer.js.map +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/Dropdown.js.map +1 -1
- package/lib/DropdownGroup.js +1 -1
- package/lib/DropdownGroup.js.map +1 -1
- package/lib/DropdownItem-BYbOLth6.js +2 -0
- package/lib/DropdownItem-BYbOLth6.js.map +1 -0
- package/lib/DropdownItem.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- package/lib/DropdownSubmenu.js +1 -1
- package/lib/DropdownSubmenu.js.map +1 -1
- package/lib/EmptyState.js +1 -1
- package/lib/EmptyState.js.map +1 -1
- package/lib/Field.js +2 -0
- package/lib/Field.js.map +1 -0
- package/lib/FieldContent.js +2 -0
- package/lib/FieldContent.js.map +1 -0
- package/lib/FieldControlMixin-BXNZJXu9.js +2 -0
- package/lib/FieldControlMixin-BXNZJXu9.js.map +1 -0
- package/lib/FieldDescription.js +2 -0
- package/lib/FieldDescription.js.map +1 -0
- package/lib/FieldError.js +2 -0
- package/lib/FieldError.js.map +1 -0
- package/lib/FieldGroup.js +2 -0
- package/lib/FieldGroup.js.map +1 -0
- package/lib/FieldLabel.js +2 -0
- package/lib/FieldLabel.js.map +1 -0
- package/lib/FieldLegend.js +2 -0
- package/lib/FieldLegend.js.map +1 -0
- package/lib/FieldSeparator.js +2 -0
- package/lib/FieldSeparator.js.map +1 -0
- package/lib/FieldSet.js +2 -0
- package/lib/FieldSet.js.map +1 -0
- package/lib/FieldTitle.js +2 -0
- package/lib/FieldTitle.js.map +1 -0
- package/lib/Fieldset2.js +2 -0
- package/lib/Fieldset2.js.map +1 -0
- package/lib/FilterAddButton.js +2 -0
- package/lib/FilterAddButton.js.map +1 -0
- package/lib/FilterAddButtonEvents.js +2 -0
- package/lib/FilterAddButtonEvents.js.map +1 -0
- package/lib/FilterBar.js +2 -0
- package/lib/FilterBar.js.map +1 -0
- package/lib/FilterDateRange.js +2 -0
- package/lib/FilterDateRange.js.map +1 -0
- package/lib/FilterDateRangeEvents.js +2 -0
- package/lib/FilterDateRangeEvents.js.map +1 -0
- package/lib/FilterDropdown.js +2 -0
- package/lib/FilterDropdown.js.map +1 -0
- package/lib/FilterDropdownEvents.js +2 -0
- package/lib/FilterDropdownEvents.js.map +1 -0
- package/lib/FilterField.js +2 -0
- package/lib/FilterField.js.map +1 -0
- package/lib/FilterFieldEvents.js +2 -0
- package/lib/FilterFieldEvents.js.map +1 -0
- package/lib/FilterInput.js +2 -0
- package/lib/FilterInput.js.map +1 -0
- package/lib/FilterResetButton.js +2 -0
- package/lib/FilterResetButton.js.map +1 -0
- package/lib/FocusableWhenDisabledController-C_Mn1mfN.js +2 -0
- package/lib/FocusableWhenDisabledController-C_Mn1mfN.js.map +1 -0
- package/lib/Footer.js +1 -1
- package/lib/Footer.js.map +1 -1
- package/lib/FormAssociatedMixin-D9aPREgv.js +2 -0
- package/lib/FormAssociatedMixin-D9aPREgv.js.map +1 -0
- package/lib/FormField-CMgEFZCK.js +2 -0
- package/lib/FormField-CMgEFZCK.js.map +1 -0
- package/lib/Header.js +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Icon.js +1 -1
- package/lib/Icon.js.map +1 -1
- package/lib/Input.js +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/Item.js +2 -0
- package/lib/Item.js.map +1 -0
- package/lib/ItemActions.js +2 -0
- package/lib/ItemActions.js.map +1 -0
- package/lib/ItemContent.js +2 -0
- package/lib/ItemContent.js.map +1 -0
- package/lib/ItemDescription.js +2 -0
- package/lib/ItemDescription.js.map +1 -0
- package/lib/ItemFooter.js +2 -0
- package/lib/ItemFooter.js.map +1 -0
- package/lib/ItemGroup.js +2 -0
- package/lib/ItemGroup.js.map +1 -0
- package/lib/ItemHeader.js +2 -0
- package/lib/ItemHeader.js.map +1 -0
- package/lib/ItemMedia.js +2 -0
- package/lib/ItemMedia.js.map +1 -0
- package/lib/ItemSeparator.js +2 -0
- package/lib/ItemSeparator.js.map +1 -0
- package/lib/ItemTitle.js +2 -0
- package/lib/ItemTitle.js.map +1 -0
- package/lib/Kbd.js +2 -0
- package/lib/Kbd.js.map +1 -0
- package/lib/KbdGroup.js +2 -0
- package/lib/KbdGroup.js.map +1 -0
- package/lib/Layout.js +1 -3
- package/lib/Layout.js.map +1 -1
- package/lib/LocalizeController.js +1 -1
- package/lib/LocalizeController.js.map +1 -1
- package/lib/Message.js +1 -1
- package/lib/Message.js.map +1 -1
- package/lib/Meter.js +2 -0
- package/lib/Meter.js.map +1 -0
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/ModalController.js +1 -1
- package/lib/ModalController.js.map +1 -1
- package/lib/NavGroup.js +1 -1
- package/lib/NavGroup.js.map +1 -1
- package/lib/NavItem.js +1 -1
- package/lib/NavItem.js.map +1 -1
- package/lib/NavToggle-BY83xpx0.js +2 -0
- package/lib/NavToggle-BY83xpx0.js.map +1 -0
- package/lib/NavToggle.js +1 -1
- package/lib/Navigation.js +1 -1
- package/lib/Navigation.js.map +1 -1
- package/lib/Notification.js +1 -1
- package/lib/Notification.js.map +1 -1
- package/lib/NotificationGroup.js +1 -1
- package/lib/NotificationGroup.js.map +1 -1
- package/lib/NumberField.js +2 -0
- package/lib/NumberField.js.map +1 -0
- package/lib/NumberFieldEvents.js +2 -0
- package/lib/NumberFieldEvents.js.map +1 -0
- package/lib/OpenStateController-CCnZ7up6.js +2 -0
- package/lib/OpenStateController-CCnZ7up6.js.map +1 -0
- package/lib/OtpField.js +2 -0
- package/lib/OtpField.js.map +1 -0
- package/lib/OtpFieldEvents.js +2 -0
- package/lib/OtpFieldEvents.js.map +1 -0
- package/lib/Pagination.js +2 -0
- package/lib/Pagination.js.map +1 -0
- package/lib/PaginationContent.js +2 -0
- package/lib/PaginationContent.js.map +1 -0
- package/lib/PaginationEllipsis.js +2 -0
- package/lib/PaginationEllipsis.js.map +1 -0
- package/lib/PaginationItem.js +2 -0
- package/lib/PaginationItem.js.map +1 -0
- package/lib/PaginationLink.js +2 -0
- package/lib/PaginationLink.js.map +1 -0
- package/lib/PaginationNext.js +2 -0
- package/lib/PaginationNext.js.map +1 -0
- package/lib/PaginationPrevious.js +2 -0
- package/lib/PaginationPrevious.js.map +1 -0
- package/lib/Popout-DpN7PP9h.js +2 -0
- package/lib/Popout-DpN7PP9h.js.map +1 -0
- package/lib/Popout.js +1 -1
- package/lib/Progress.js +1 -1
- package/lib/Progress.js.map +1 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/ProgressBar.js.map +1 -1
- package/lib/Qrcode.js +2 -2
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/Range.js +1 -1
- package/lib/Range.js.map +1 -1
- package/lib/ReadonlyMixin-BdJPGtQ3.js +2 -0
- package/lib/ReadonlyMixin-BdJPGtQ3.js.map +1 -0
- package/lib/ResizeController-14PUwRQy.js +2 -0
- package/lib/ResizeController-14PUwRQy.js.map +1 -0
- package/lib/ScrollArea.js +2 -0
- package/lib/ScrollArea.js.map +1 -0
- package/lib/SegmentedControl.js +1 -1
- package/lib/SegmentedControl.js.map +1 -1
- package/lib/SegmentedControlItem.js +23 -40
- package/lib/SegmentedControlItem.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/Skeleton.js +1 -1
- package/lib/Skeleton.js.map +1 -1
- package/lib/Spinner.js +1 -1
- package/lib/Spinner.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/StateAttributesController-BIh96sXZ.js +2 -0
- package/lib/StateAttributesController-BIh96sXZ.js.map +1 -0
- package/lib/Sticky-CZImMrGj.js +2 -0
- package/lib/Sticky-CZImMrGj.js.map +1 -0
- package/lib/Tab.js +1 -1
- package/lib/Tab.js.map +1 -1
- package/lib/TabGroup.js +1 -1
- package/lib/TabGroup.js.map +1 -1
- package/lib/TabPanel.js +1 -1
- package/lib/TabPanel.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/Tag.js +1 -1
- package/lib/Tag.js.map +1 -1
- package/lib/TagGroup.js +1 -1
- package/lib/TagGroup.js.map +1 -1
- package/lib/TextField-CSKvieoG.js +2 -0
- package/lib/TextField-CSKvieoG.js.map +1 -0
- package/lib/TextSelectableMixin-Cfv__lHS.js.map +1 -1
- package/lib/Textarea.js +1 -1
- package/lib/Textarea.js.map +1 -1
- package/lib/TimePicker.js +2 -0
- package/lib/TimePicker.js.map +1 -0
- package/lib/Toast.js +1 -1
- package/lib/Toast.js.map +1 -1
- package/lib/ToastGroup.js +1 -1
- package/lib/ToastGroup.js.map +1 -1
- package/lib/Toggle.js +1 -1
- package/lib/Toggle.js.map +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.js.map +1 -1
- package/lib/TopBar.js +1 -1
- package/lib/TopBar.js.map +1 -1
- package/lib/Truncate.js +1 -1
- package/lib/Truncate.js.map +1 -1
- package/lib/VisuallyHidden.js +1 -1
- package/lib/bundle.js +91 -91
- package/lib/bundle.js.map +1 -1
- package/lib/combobox-context.js +2 -0
- package/lib/combobox-context.js.map +1 -0
- package/lib/context-consumer-BJVUulGf.js +7 -0
- package/lib/context-consumer-BJVUulGf.js.map +1 -0
- package/lib/context-provider-D8lrPLVi.js +12 -0
- package/lib/context-provider-D8lrPLVi.js.map +1 -0
- package/lib/context-request-event-CCRlXoeR.js +7 -0
- package/lib/context-request-event-CCRlXoeR.js.map +1 -0
- package/lib/create-context-CJ69ntlY.js +7 -0
- package/lib/create-context-CJ69ntlY.js.map +1 -0
- package/lib/currency.js +2 -0
- package/lib/currency.js.map +1 -0
- package/lib/date-adapter.js +1 -1
- package/lib/dates-C-ZvzXaC.js +2 -0
- package/lib/dates-C-ZvzXaC.js.map +1 -0
- package/lib/dates.js +2 -0
- package/lib/dates.js.map +1 -0
- package/lib/dismiss.js +2 -0
- package/lib/dismiss.js.map +1 -0
- package/lib/en-us.js +1 -1
- package/lib/en-us.js.map +1 -1
- package/lib/fi-fi.js +1 -1
- package/lib/fi-fi.js.map +1 -1
- package/lib/field-context.js +2 -0
- package/lib/field-context.js.map +1 -0
- package/lib/filter-chip-C97zd4PT.js +2 -0
- package/lib/filter-chip-C97zd4PT.js.map +1 -0
- package/lib/format.js +2 -0
- package/lib/format.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/interface-add-small-B-hv2v9J.js +2 -0
- package/lib/interface-add-small-B-hv2v9J.js.map +1 -0
- package/lib/interface-calendar-Cw2bJfbS.js +2 -0
- package/lib/interface-calendar-Cw2bJfbS.js.map +1 -0
- package/lib/interface-close-BvKnv9eh.js +2 -0
- package/lib/interface-close-BvKnv9eh.js.map +1 -0
- package/lib/interface-dropdown-small-CYvgxudU.js +2 -0
- package/lib/interface-dropdown-small-CYvgxudU.js.map +1 -0
- package/lib/interface-filter-CCsx9-u6.js +2 -0
- package/lib/interface-filter-CCsx9-u6.js.map +1 -0
- package/lib/interface-remove-small-DUaWSs90.js +2 -0
- package/lib/interface-remove-small-DUaWSs90.js.map +1 -0
- package/lib/light-dom-styles-DXsbiKU9.js +2 -0
- package/lib/light-dom-styles-DXsbiKU9.js.map +1 -0
- package/lib/localization.js +1 -1
- package/lib/localization.js.map +1 -1
- package/lib/localization10.js +2 -0
- package/lib/localization10.js.map +1 -0
- package/lib/localization11.js +2 -0
- package/lib/localization11.js.map +1 -0
- package/lib/localization12.js +2 -0
- package/lib/localization12.js.map +1 -0
- package/lib/localization13.js +2 -0
- package/lib/localization13.js.map +1 -0
- package/lib/localization14.js +2 -0
- package/lib/localization14.js.map +1 -0
- package/lib/localization15.js +2 -0
- package/lib/localization15.js.map +1 -0
- package/lib/localization16.js +2 -0
- package/lib/localization16.js.map +1 -0
- package/lib/localization17.js +2 -0
- package/lib/localization17.js.map +1 -0
- package/lib/localization18.js +2 -0
- package/lib/localization18.js.map +1 -0
- package/lib/localization19.js +2 -0
- package/lib/localization19.js.map +1 -0
- package/lib/localization2.js +1 -1
- package/lib/localization2.js.map +1 -1
- package/lib/localization20.js +2 -0
- package/lib/localization20.js.map +1 -0
- package/lib/localization21.js +2 -0
- package/lib/localization21.js.map +1 -0
- package/lib/localization22.js +2 -0
- package/lib/localization22.js.map +1 -0
- package/lib/localization3.js +1 -1
- package/lib/localization3.js.map +1 -1
- package/lib/localization4.js +1 -1
- package/lib/localization4.js.map +1 -1
- package/lib/localization5.js +1 -1
- package/lib/localization5.js.map +1 -1
- package/lib/localization6.js +1 -1
- package/lib/localization6.js.map +1 -1
- package/lib/localization7.js +1 -1
- package/lib/localization7.js.map +1 -1
- package/lib/localization8.js +1 -1
- package/lib/localization8.js.map +1 -1
- package/lib/localization9.js +1 -1
- package/lib/localization9.js.map +1 -1
- package/lib/navigation-search-CBbIGzo2.js +2 -0
- package/lib/navigation-search-CBbIGzo2.js.map +1 -0
- package/lib/paginate.js +2 -0
- package/lib/paginate.js.map +1 -0
- package/lib/parse.js +2 -0
- package/lib/parse.js.map +1 -0
- package/lib/primitives-Dj0vyf1-.js +2 -0
- package/lib/primitives-Dj0vyf1-.js.map +1 -0
- package/lib/react.d.ts +505 -0
- package/lib/src/accordion/Accordion.d.ts +121 -0
- package/lib/src/accordion/AccordionHeader.d.ts +28 -0
- package/lib/src/accordion/AccordionItem.d.ts +68 -0
- package/lib/src/accordion/AccordionPanel.d.ts +35 -0
- package/lib/src/accordion/AccordionTrigger.d.ts +47 -0
- package/lib/src/aside-drawer/AsideDrawer.d.ts +2 -0
- package/lib/src/aside-trigger/AsideTrigger.d.ts +2 -0
- package/lib/src/autocomplete/Autocomplete.d.ts +190 -0
- package/lib/src/autocomplete/localization.d.ts +5 -0
- package/lib/src/badge/Badge.d.ts +1 -1
- package/lib/src/banner/Banner.d.ts +3 -0
- package/lib/src/button-group/ButtonGroup.d.ts +1 -1
- package/lib/src/calendar/Calendar.d.ts +44 -0
- package/lib/src/calendar/DateRangeSelectEvent.d.ts +16 -0
- package/lib/src/collapsible/Collapsible.d.ts +69 -0
- package/lib/src/collapsible/CollapsiblePanel.d.ts +35 -0
- package/lib/src/collapsible/CollapsibleTrigger.d.ts +38 -0
- package/lib/src/combobox/Combobox.d.ts +131 -0
- package/lib/src/combobox/ComboboxBase.d.ts +421 -0
- package/lib/src/combobox/ComboboxEvents.d.ts +25 -0
- package/lib/src/combobox/ComboboxGroup.d.ts +34 -0
- package/lib/src/combobox/ComboboxOption.d.ts +47 -0
- package/lib/src/combobox/combobox-context.d.ts +18 -0
- package/lib/src/combobox/localization.d.ts +6 -0
- package/lib/src/common/controllers/ActiveDescendantController.d.ts +45 -0
- package/lib/src/common/controllers/CollapseController.d.ts +50 -0
- package/lib/src/common/controllers/FocusableWhenDisabledController.d.ts +29 -0
- package/lib/src/common/controllers/OpenStateController.d.ts +58 -0
- package/lib/src/common/controllers/RovingFocusController.d.ts +40 -0
- package/lib/src/common/controllers/StateAttributesController.d.ts +47 -0
- package/lib/src/common/controllers/TransitionStatusController.d.ts +48 -0
- package/lib/src/common/dates.d.ts +13 -0
- package/lib/src/common/light-dom-styles.d.ts +17 -0
- package/lib/src/common/mixins/FieldControlMixin.d.ts +60 -0
- package/lib/src/common/mixins/FormAssociatedMixin.d.ts +8 -25
- package/lib/src/common/mixins/TextSelectableMixin.d.ts +1 -0
- package/lib/src/common/prefers-reduced-motion.d.ts +7 -0
- package/lib/src/date-picker/DatePicker.d.ts +2 -0
- package/lib/src/date-range-picker/DateRangeChangeEvent.d.ts +27 -0
- package/lib/src/date-range-picker/DateRangePicker.d.ts +307 -0
- package/lib/src/date-range-picker/localization.d.ts +42 -0
- package/lib/src/dropdown/Dropdown.d.ts +1 -1
- package/lib/src/dropdown-group/DropdownGroup.d.ts +3 -1
- package/lib/src/dropdown-item/DropdownItem.d.ts +3 -1
- package/lib/src/dropdown-submenu/DropdownSubmenu.d.ts +2 -0
- package/lib/src/field/Field.d.ts +102 -0
- package/lib/src/field/FieldContent.d.ts +22 -0
- package/lib/src/field/FieldDescription.d.ts +21 -0
- package/lib/src/field/FieldError.d.ts +25 -0
- package/lib/src/field/FieldGroup.d.ts +25 -0
- package/lib/src/field/FieldLabel.d.ts +41 -0
- package/lib/src/field/FieldLegend.d.ts +20 -0
- package/lib/src/field/FieldSeparator.d.ts +21 -0
- package/lib/src/field/FieldSet.d.ts +28 -0
- package/lib/src/field/FieldTitle.d.ts +21 -0
- package/lib/src/field/field-context.d.ts +47 -0
- package/lib/src/fieldset/Fieldset.d.ts +12 -4
- package/lib/src/filter-add-button/FilterAddButton.d.ts +91 -0
- package/lib/src/filter-add-button/FilterAddButtonEvents.d.ts +17 -0
- package/lib/src/filter-add-button/localization.d.ts +4 -0
- package/lib/src/filter-bar/FilterBar.d.ts +37 -0
- package/lib/src/filter-date-range/FilterDateRange.d.ts +96 -0
- package/lib/src/filter-date-range/FilterDateRangeEvents.d.ts +37 -0
- package/lib/src/filter-date-range/localization.d.ts +11 -0
- package/lib/src/filter-dropdown/FilterDropdown.d.ts +247 -0
- package/lib/src/filter-dropdown/FilterDropdownEvents.d.ts +57 -0
- package/lib/src/filter-dropdown/localization.d.ts +14 -0
- package/lib/src/filter-field/FilterField.d.ts +89 -0
- package/lib/src/filter-field/FilterFieldEvents.d.ts +18 -0
- package/lib/src/filter-field/localization.d.ts +8 -0
- package/lib/src/filter-input/FilterInput.d.ts +102 -0
- package/lib/src/filter-input/localization.d.ts +5 -0
- package/lib/src/filter-reset-button/FilterResetButton.d.ts +50 -0
- package/lib/src/filter-reset-button/localization.d.ts +4 -0
- package/lib/src/index.d.ts +59 -0
- package/lib/src/input/Input.d.ts +2 -1
- package/lib/src/item/Item.d.ts +44 -0
- package/lib/src/item/ItemActions.d.ts +20 -0
- package/lib/src/item/ItemContent.d.ts +22 -0
- package/lib/src/item/ItemDescription.d.ts +20 -0
- package/lib/src/item/ItemFooter.d.ts +20 -0
- package/lib/src/item/ItemGroup.d.ts +22 -0
- package/lib/src/item/ItemHeader.d.ts +20 -0
- package/lib/src/item/ItemMedia.d.ts +28 -0
- package/lib/src/item/ItemSeparator.d.ts +21 -0
- package/lib/src/item/ItemTitle.d.ts +19 -0
- package/lib/src/kbd/Kbd.d.ts +54 -0
- package/lib/src/kbd/KbdGroup.d.ts +22 -0
- package/lib/src/layout/Layout.d.ts +2 -2
- package/lib/src/localization/en-us.d.ts +85 -0
- package/lib/src/localization/translation.d.ts +85 -0
- package/lib/src/meter/Meter.d.ts +76 -0
- package/lib/src/nav-group/NavGroup.d.ts +2 -0
- package/lib/src/nav-item/NavItem.d.ts +2 -0
- package/lib/src/nav-toggle/NavToggle.d.ts +3 -1
- package/lib/src/notification-group/NotificationGroup.d.ts +2 -0
- package/lib/src/number-field/NumberField.d.ts +377 -0
- package/lib/src/number-field/NumberFieldEvents.d.ts +37 -0
- package/lib/src/number-field/currency.d.ts +24 -0
- package/lib/src/number-field/format.d.ts +8 -0
- package/lib/src/number-field/localization.d.ts +6 -0
- package/lib/src/number-field/parse.d.ts +44 -0
- package/lib/src/number-field/validate.d.ts +24 -0
- package/lib/src/otp-field/OtpField.d.ts +177 -0
- package/lib/src/otp-field/OtpFieldEvents.d.ts +38 -0
- package/lib/src/otp-field/localization.d.ts +4 -0
- package/lib/src/pagination/Pagination.d.ts +51 -0
- package/lib/src/pagination/PaginationContent.d.ts +27 -0
- package/lib/src/pagination/PaginationEllipsis.d.ts +27 -0
- package/lib/src/pagination/PaginationItem.d.ts +24 -0
- package/lib/src/pagination/PaginationLink.d.ts +30 -0
- package/lib/src/pagination/PaginationNext.d.ts +24 -0
- package/lib/src/pagination/PaginationPrevious.d.ts +24 -0
- package/lib/src/pagination/localization.d.ts +4 -0
- package/lib/src/pagination/paginate.d.ts +20 -0
- package/lib/src/popout/Popout.d.ts +9 -0
- package/lib/src/scroll-area/ScrollArea.d.ts +101 -0
- package/lib/src/segmented-control-item/SegmentedControlItem.d.ts +2 -0
- package/lib/src/storybook-utils/dates.d.ts +2 -0
- package/lib/src/storybook-utils/dismiss.d.ts +1 -0
- package/lib/src/storybook-utils/story-descriptions.d.ts +2 -0
- package/lib/src/tab-group/TabGroup.d.ts +2 -0
- package/lib/src/tab-panel/TabPanel.d.ts +2 -0
- package/lib/src/tag-group/TagGroup.d.ts +2 -0
- package/lib/src/time-picker/TimePicker.d.ts +105 -0
- package/lib/src/time-picker/localization.d.ts +4 -0
- package/lib/src/toast-group/ToastGroup.d.ts +11 -0
- package/lib/story-descriptions.js +2 -0
- package/lib/story-descriptions.js.map +1 -0
- package/lib/translation.js +1 -1
- package/lib/translation.js.map +1 -1
- package/lib/validate.js +2 -0
- package/lib/validate.js.map +1 -0
- package/lib/vue.d.ts +407 -0
- package/package.json +9 -12
- package/lib/Calendar-ChNZdVRO.js +0 -2
- package/lib/Calendar-ChNZdVRO.js.map +0 -1
- package/lib/Component-DSU3Qp0O.js +0 -2
- package/lib/Component-DSU3Qp0O.js.map +0 -1
- package/lib/DropdownItem-Cb-7cHMg.js +0 -2
- package/lib/DropdownItem-Cb-7cHMg.js.map +0 -1
- package/lib/Fieldset.js +0 -2
- package/lib/Fieldset.js.map +0 -1
- package/lib/FormAssociatedMixin-B4Qj-CQN.js +0 -2
- package/lib/FormAssociatedMixin-B4Qj-CQN.js.map +0 -1
- package/lib/FormField-BFaVzUjk.js +0 -2
- package/lib/FormField-BFaVzUjk.js.map +0 -1
- package/lib/NavToggle-DzKbd-El.js +0 -2
- package/lib/NavToggle-DzKbd-El.js.map +0 -1
- package/lib/Popout-CYqn_dZu.js +0 -2
- package/lib/Popout-CYqn_dZu.js.map +0 -1
- package/lib/Sticky-DqnqENYN.js +0 -2
- package/lib/Sticky-DqnqENYN.js.map +0 -1
- package/lib/TextField-B955GOhe.js +0 -2
- package/lib/TextField-B955GOhe.js.map +0 -1
- package/lib/dates-CAAlPKZi.js +0 -2
- package/lib/dates-CAAlPKZi.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { ComboboxOption } from './ComboboxBase.js';
|
|
2
|
+
import ComboboxBase from './ComboboxBase.js';
|
|
3
|
+
import '../kbd/Kbd.js';
|
|
4
|
+
import '../tag/Tag.js';
|
|
5
|
+
import './ComboboxOption.js';
|
|
6
|
+
import './ComboboxGroup.js';
|
|
7
|
+
export type { ComboboxOption } from './ComboboxBase.js';
|
|
8
|
+
export { ComboboxClearEvent, ComboboxCreateEvent } from './ComboboxEvents.js';
|
|
9
|
+
/**
|
|
10
|
+
* Combobox lets users choose one option (or several) from a list by typing to
|
|
11
|
+
* filter, then picking with the keyboard or pointer. Use it when a [Select](/components/select/)
|
|
12
|
+
* would be unwieldy because there are many options to scan.
|
|
13
|
+
*
|
|
14
|
+
* Combobox is a control only — it has no built-in label, hint or error. Compose
|
|
15
|
+
* it inside a [Field](/components/field/) to give it a label, hint and error
|
|
16
|
+
* message, the same way you would a native input.
|
|
17
|
+
*
|
|
18
|
+
* The committed `value` is an option's `value` (or an array of them with
|
|
19
|
+
* `multiple`); the input is a filter/search field whose text is discarded on
|
|
20
|
+
* commit. For a free-text input with suggestions where the typed text is the
|
|
21
|
+
* value, use [Autocomplete](/components/autocomplete/) instead.
|
|
22
|
+
*
|
|
23
|
+
* @status draft
|
|
24
|
+
* @category form
|
|
25
|
+
* @lightDom true
|
|
26
|
+
*
|
|
27
|
+
* @slot start - Optional slot used to place an icon or prefix at the start of the control.
|
|
28
|
+
* @slot end - Optional slot used to place an icon or suffix at the end of the control.
|
|
29
|
+
*
|
|
30
|
+
* @fires {NordEvent} change - Dispatched when the committed value changes via user interaction.
|
|
31
|
+
* @fires {NordEvent} input - Dispatched as the user types into the search input.
|
|
32
|
+
* @fires {NordEvent} open - Dispatched when the listbox is opened.
|
|
33
|
+
* @fires {NordEvent} close - Dispatched when the listbox is closed.
|
|
34
|
+
* @fires {ComboboxClearEvent} clear - Dispatched when the value is cleared via the clear button or `clear()`.
|
|
35
|
+
* @fires {ComboboxCreateEvent} create - Dispatched when the user chooses the "Create" affordance in a `creatable` combobox.
|
|
36
|
+
*
|
|
37
|
+
* @localization clearLabel - Accessible label for the clear button.
|
|
38
|
+
* @localization createLabel - Label for the "Create" affordance, given the current query.
|
|
39
|
+
* @localization noResults - Message shown when no options match the query.
|
|
40
|
+
*
|
|
41
|
+
* @cssprop [--n-combobox-list-inline-size] - Controls the inline size, or width, of the dropdown list. Defaults to the width of the combobox control.
|
|
42
|
+
* @cssprop [--n-combobox-block-size] - Controls the block size, or height, of the control. The medium default is `var(--n-space-xl)`; the s and l sizes scale from it.
|
|
43
|
+
*
|
|
44
|
+
* @attr {boolean} data-invalid - Present while the control is invalid (mirrors the `invalid` property). Style hook for the whole control.
|
|
45
|
+
* @attr {boolean} data-focused - Present while the control has focus. Style hook for focus-within treatments.
|
|
46
|
+
*/
|
|
47
|
+
export default class Combobox extends ComboboxBase {
|
|
48
|
+
/**
|
|
49
|
+
* The value of the combobox. A single string when `multiple` is `false`,
|
|
50
|
+
* or an array of strings when `multiple` is `true`.
|
|
51
|
+
*/
|
|
52
|
+
value: string | string[];
|
|
53
|
+
/**
|
|
54
|
+
* Allows selecting more than one option. Selected options are shown as
|
|
55
|
+
* removable chips and the listbox stays open after each selection.
|
|
56
|
+
*/
|
|
57
|
+
multiple: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Shows a clear (✕) button while there is a value. Pressing it resets the
|
|
60
|
+
* value to `''` (or `[]` when `multiple`), then fires `clear` and `change`.
|
|
61
|
+
* Defaults to `true`.
|
|
62
|
+
*
|
|
63
|
+
* This prop only toggles the button. A single-select value can always be
|
|
64
|
+
* cleared by deleting the input text, regardless of this prop (Base UI
|
|
65
|
+
* parity).
|
|
66
|
+
*/
|
|
67
|
+
clearable: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Offers a "Create" affordance when the query does not exactly match an
|
|
70
|
+
* existing option. Choosing it (click or Enter) adds the typed value as an
|
|
71
|
+
* option and selects it (in `multiple` mode it is appended as a chip), and
|
|
72
|
+
* fires a cancelable `create` event. Call `event.preventDefault()` to opt out
|
|
73
|
+
* and handle creation yourself (e.g. to map the value to a different `value`).
|
|
74
|
+
*/
|
|
75
|
+
creatable: boolean;
|
|
76
|
+
/** Options contributed by declarative `<nord-combobox-option>` children. */
|
|
77
|
+
private slottedOptions;
|
|
78
|
+
/** Options the combobox created itself via the auto-add `creatable` flow. */
|
|
79
|
+
private createdOptions;
|
|
80
|
+
/** Registered declarative option elements (rebuilt into `slottedOptions`). */
|
|
81
|
+
private optionElements;
|
|
82
|
+
/** The registry the option/group children use to self-register (provide/inject). */
|
|
83
|
+
private optionRegistry;
|
|
84
|
+
private registryProvider;
|
|
85
|
+
connectedCallback(): void;
|
|
86
|
+
/** Read a registered option element into a plain `ComboboxOption`. */
|
|
87
|
+
private readOptionElement;
|
|
88
|
+
/** Rebuild `slottedOptions` from the registered elements, in DOM order. */
|
|
89
|
+
private rebuildSlottedOptions;
|
|
90
|
+
/** Cache for the merged option list so `filtered`'s identity check stays stable. */
|
|
91
|
+
private resolvedCache?;
|
|
92
|
+
/**
|
|
93
|
+
* The options to render: the `.options` property when set (dynamic/async data),
|
|
94
|
+
* otherwise the declarative `<nord-combobox-option>` children, with any
|
|
95
|
+
* auto-created options merged on top.
|
|
96
|
+
*/
|
|
97
|
+
protected get resolvedOptions(): ComboboxOption[];
|
|
98
|
+
/** Whether chip/array logic applies — i.e. `multiple` selection. */
|
|
99
|
+
private get isMultiple();
|
|
100
|
+
/**
|
|
101
|
+
* In `multiple` mode the input is always a pure filter (selections live in
|
|
102
|
+
* chips). In single-select it shows the live query only once the user types;
|
|
103
|
+
* until then it keeps the selected option's label visible and editable (Base
|
|
104
|
+
* UI parity — see `ComboboxBase.showsQueryInInput`).
|
|
105
|
+
*/
|
|
106
|
+
protected get showsQueryInInput(): boolean;
|
|
107
|
+
protected get inputPlaceholder(): string | undefined;
|
|
108
|
+
/** The index of the create row, or `-1` when it isn't shown. */
|
|
109
|
+
protected get createIndex(): number;
|
|
110
|
+
/** Whether the "Create" affordance should be offered for the current query. */
|
|
111
|
+
protected get canCreate(): boolean;
|
|
112
|
+
protected get showClear(): boolean;
|
|
113
|
+
protected get ariaMultiselectable(): 'true' | 'false';
|
|
114
|
+
/**
|
|
115
|
+
* Clear the current value, firing `clear` then `change`.
|
|
116
|
+
*/
|
|
117
|
+
clear(): void;
|
|
118
|
+
protected selectOption(option: ComboboxOption): void;
|
|
119
|
+
protected onInput(input: HTMLInputElement): void;
|
|
120
|
+
protected emitCreate(): void;
|
|
121
|
+
protected onUnhandledKeydown(e: KeyboardEvent): void;
|
|
122
|
+
private removeValue;
|
|
123
|
+
/** Multiple mode renders selected options as removable chips before the input. */
|
|
124
|
+
protected renderLeadingControl(): unknown;
|
|
125
|
+
protected renderCreate(): import("lit").TemplateResult<1>;
|
|
126
|
+
}
|
|
127
|
+
declare global {
|
|
128
|
+
interface HTMLElementTagNameMap {
|
|
129
|
+
'nord-combobox': Combobox;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import type { CSSResult, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { LitElement, nothing } from 'lit';
|
|
3
|
+
import { ActiveDescendantController } from '../common/controllers/ActiveDescendantController.js';
|
|
4
|
+
import { LocalizeController } from '../localization/LocalizeController.js';
|
|
5
|
+
import '../popout/Popout.js';
|
|
6
|
+
import '../spinner/Spinner.js';
|
|
7
|
+
/**
|
|
8
|
+
* A single option in a combobox.
|
|
9
|
+
*/
|
|
10
|
+
export interface ComboboxOption {
|
|
11
|
+
/** The value submitted with the form and tracked in `value`. */
|
|
12
|
+
value: string;
|
|
13
|
+
/** The human-readable text shown in the list and the input. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Optional group heading used to cluster related options together. */
|
|
16
|
+
group?: string;
|
|
17
|
+
/** When `true`, the option cannot be selected. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Optional rich HTML rendered instead of the plain `label` text. */
|
|
20
|
+
html?: string;
|
|
21
|
+
/** Arbitrary data attached to the option, passed back to `renderOption`. */
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Re-prefixes an authored, tag-scoped stylesheet for another tag name so a
|
|
26
|
+
* sibling light-DOM component (e.g. `nord-autocomplete`) can reuse the exact
|
|
27
|
+
* same `.n-*` rules without duplicating them. `Combobox.css` is the single
|
|
28
|
+
* source of truth; this swaps the top-level `nord-combobox` selector token.
|
|
29
|
+
*/
|
|
30
|
+
export declare function retagComboboxStyles(styles: CSSResult, tag: string): CSSResult;
|
|
31
|
+
declare const ComboboxBase_base: (new (...args: any[]) => import("../common/mixins/SizeMixin.js").SizeMixinInterface) & (new (...args: any[]) => import("../common/mixins/AutocompleteMixin.js").AutocompleteMixinInterface) & (new (...args: any[]) => import("../common/mixins/FieldControlMixin.js").FieldControlMixinInterface) & (new (...args: any[]) => import("../common/mixins/InputMixin.js").InputMixinInterface) & (new (...args: any[]) => import("../common/mixins/FloatingComponentMixin.js").FloatingMixinInterface) & typeof LitElement;
|
|
32
|
+
/**
|
|
33
|
+
* `ComboboxBase` is the (unregistered) shared base for `nord-combobox` (pick an
|
|
34
|
+
* option, or several) and `nord-autocomplete` (free-text input with suggestions
|
|
35
|
+
* where the typed text is the value). It owns every piece of the dropdown that
|
|
36
|
+
* the two share — options, filtering, virtualization, keyboard navigation, the
|
|
37
|
+
* popout, light-dismiss, ARIA wiring and rendering — and exposes a set of
|
|
38
|
+
* protected hooks for the handful of behaviours that differ between a select and
|
|
39
|
+
* a free-text control.
|
|
40
|
+
*
|
|
41
|
+
* Base UI parity: Autocomplete is the Combobox primitive with
|
|
42
|
+
* `selectionMode="none"` + `fillInputOnItemPress`.
|
|
43
|
+
*
|
|
44
|
+
* Subclasses MUST `injectLightDomStyles(this, <their stylesheet>)` in
|
|
45
|
+
* `connectedCallback` (the base does not import a stylesheet, since the rules are
|
|
46
|
+
* tag-scoped and each tag needs its own copy — see `retagComboboxStyles`).
|
|
47
|
+
*
|
|
48
|
+
* Not a registered custom element: it has no `@customElement` decorator and no
|
|
49
|
+
* tag name, so the manifest config marks it `internal` and the React/Vue type
|
|
50
|
+
* generators skip it.
|
|
51
|
+
*/
|
|
52
|
+
export default abstract class ComboboxBase extends ComboboxBase_base {
|
|
53
|
+
/** Stable, unique id base for the light-DOM ARIA wiring of this instance. */
|
|
54
|
+
private comboboxId;
|
|
55
|
+
protected inputId: string;
|
|
56
|
+
protected inputRef: import("lit/directives/ref.js").Ref<HTMLInputElement>;
|
|
57
|
+
private formData;
|
|
58
|
+
/**
|
|
59
|
+
* Remembers value→label pairs seen from any option so a preselected value
|
|
60
|
+
* that has since left the loaded options still renders its label.
|
|
61
|
+
*/
|
|
62
|
+
protected labelCache: Map<string, string>;
|
|
63
|
+
protected localize: LocalizeController<"nord-combobox">;
|
|
64
|
+
/** Re-renders when the host's forwarded ARIA labelling attributes change. */
|
|
65
|
+
private ariaObserver?;
|
|
66
|
+
private widthObserver?;
|
|
67
|
+
private popout?;
|
|
68
|
+
private dismiss;
|
|
69
|
+
/**
|
|
70
|
+
* Reflects the control's state to Base-UI-style `data-*` attributes
|
|
71
|
+
* (`data-invalid`, `data-focused`) so consumers can style the whole control.
|
|
72
|
+
* `trackFocus` keeps `data-focused` present while focus stays within the host
|
|
73
|
+
* — e.g. moving between the input and the clear button.
|
|
74
|
+
*/
|
|
75
|
+
private stateAttributes;
|
|
76
|
+
/**
|
|
77
|
+
* The options to show in the combobox.
|
|
78
|
+
*/
|
|
79
|
+
options: ComboboxOption[];
|
|
80
|
+
/**
|
|
81
|
+
* Placeholder text to display within the input.
|
|
82
|
+
*/
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Use external filtering mode. When set to `true`, the component will not
|
|
86
|
+
* perform internal text-based filtering and expects the consumer to update
|
|
87
|
+
* the `options` in response to the `input` event.
|
|
88
|
+
*/
|
|
89
|
+
externalFiltering: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Shows a spinner in the control and listbox while asynchronous results are
|
|
92
|
+
* loading. Pair with `external-filtering` for async search.
|
|
93
|
+
*/
|
|
94
|
+
loading: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Highlights the first option after filtering so pressing Enter selects it.
|
|
97
|
+
*/
|
|
98
|
+
autoHighlight: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Marks the control as invalid, applying error styling and setting
|
|
101
|
+
* `aria-invalid` on the input.
|
|
102
|
+
*/
|
|
103
|
+
invalid: boolean;
|
|
104
|
+
protected get ownInvalid(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Marks the control read-only: the value stays visible, focusable and
|
|
107
|
+
* submitted with the form, but the listbox can't be opened and the value can't
|
|
108
|
+
* be changed (no typing, navigation, selection or clearing). Unlike `disabled`,
|
|
109
|
+
* a read-only control still participates in form submission.
|
|
110
|
+
*/
|
|
111
|
+
readonly: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether focusing or clicking into the input opens the listbox. Defaults to
|
|
114
|
+
* `true`. Set to `false` to only open on typing or a trigger (chevron) click.
|
|
115
|
+
*/
|
|
116
|
+
openOnFocus: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Message shown when no options match the query. Defaults to "No items found.".
|
|
119
|
+
*/
|
|
120
|
+
noResultsText?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Virtualizes (windows) the option list so only the rows in view are rendered,
|
|
123
|
+
* keeping very large lists (thousands of options) fast. Rows are assumed to be a
|
|
124
|
+
* uniform height, which is measured from the first option. Virtualization is
|
|
125
|
+
* skipped for grouped lists, whose labels and separators break that assumption —
|
|
126
|
+
* grouped lists are expected to be short and curated.
|
|
127
|
+
*/
|
|
128
|
+
virtualized: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Custom renderer for the content of each option. Receives the option and
|
|
131
|
+
* should return a Lit `TemplateResult` or a string. When omitted, the
|
|
132
|
+
* option's `html` (if present) or `label` is rendered.
|
|
133
|
+
*/
|
|
134
|
+
renderOption?: (option: ComboboxOption) => TemplateResult | string;
|
|
135
|
+
/** The current search query in the combobox input. */
|
|
136
|
+
protected search: string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether the user has actually typed into the input since it was last
|
|
139
|
+
* opened/committed. Until they do, a single-select shows the committed
|
|
140
|
+
* selection's label in the input (editable) rather than an empty filter —
|
|
141
|
+
* matching Base UI, where reopening keeps the selected label visible and the
|
|
142
|
+
* list unfiltered until the first keystroke. Set on typing; cleared on commit
|
|
143
|
+
* and on close.
|
|
144
|
+
*/
|
|
145
|
+
protected queryDirty: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Tracks the active (highlighted) row of the virtual-focus listbox: the focus
|
|
148
|
+
* stays on the input while this roams the rows and surfaces as
|
|
149
|
+
* `aria-activedescendant`. Owns the wrap / skip-disabled / move math the
|
|
150
|
+
* combobox previously duplicated. The out-of-range create row (index ===
|
|
151
|
+
* `filteredOptions.length`) reports as enabled (`filteredOptions[i]` is
|
|
152
|
+
* `undefined`, so `!undefined?.disabled` is `true`) and maps to its create-row
|
|
153
|
+
* id, matching the create-row semantics.
|
|
154
|
+
*/
|
|
155
|
+
protected activeDescendant: ActiveDescendantController;
|
|
156
|
+
/** The scroll container for the options; the virtualizer's scroll element. */
|
|
157
|
+
private listboxEl?;
|
|
158
|
+
/**
|
|
159
|
+
* Containers for the `start`/`end` slot content. The control renders into the
|
|
160
|
+
* light DOM, so real `<slot>` elements don't project; instead these act as
|
|
161
|
+
* landing zones and the matching host children (`slot="start"`/`slot="end"`)
|
|
162
|
+
* are relocated into them. A `ResizeController` per zone feeds the measured
|
|
163
|
+
* inline size into a custom property so the input padding can clear the slot
|
|
164
|
+
* (mirrors `nord-input`).
|
|
165
|
+
*/
|
|
166
|
+
private startSlot?;
|
|
167
|
+
private endSlot?;
|
|
168
|
+
private startObserver;
|
|
169
|
+
private endObserver;
|
|
170
|
+
/** Re-renders when the host's `slot="start"`/`slot="end"` children change. */
|
|
171
|
+
private slotObserver?;
|
|
172
|
+
/** Set when a keyboard move should scroll the active option into view. */
|
|
173
|
+
protected scrollActivePending: boolean;
|
|
174
|
+
/** Row-height estimate used until the uniform row height is measured once. */
|
|
175
|
+
private static readonly VIRTUAL_ROW_ESTIMATE;
|
|
176
|
+
/** Extra rows rendered above and below the viewport to smooth scrolling. */
|
|
177
|
+
private static readonly VIRTUAL_OVERSCAN;
|
|
178
|
+
/**
|
|
179
|
+
* The measured uniform row height, sampled once from the first rendered row.
|
|
180
|
+
* Option rows are a fixed height, so a single sample feeds `estimateSize` for
|
|
181
|
+
* the whole list — far cheaper and more stable than re-measuring every row on
|
|
182
|
+
* every render, which fed a `measure → onChange → re-render → measure` loop
|
|
183
|
+
* that could peg the main thread.
|
|
184
|
+
*/
|
|
185
|
+
private measuredRowSize?;
|
|
186
|
+
/**
|
|
187
|
+
* Windows the flat option list (see `virtualized`) with TanStack Virtual: only
|
|
188
|
+
* the rows in view are rendered, sized from the measured uniform row height,
|
|
189
|
+
* and the active option is kept on-screen via `scrollToIndex`. Its `onChange`
|
|
190
|
+
* re-renders the host on scroll/resize; `count` is kept in sync in `willUpdate`.
|
|
191
|
+
*/
|
|
192
|
+
private virtualizer;
|
|
193
|
+
/** Suppresses focus-to-open while focus is being restored after a selection. */
|
|
194
|
+
protected suppressFocusOpen: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Whether the user has moved the active option with the keyboard since the
|
|
197
|
+
* last filter change. Used to decide if a bare Enter (no navigation) selects
|
|
198
|
+
* the highlighted option — only when `autoHighlight` is set, the first option
|
|
199
|
+
* becomes implicitly selectable.
|
|
200
|
+
*/
|
|
201
|
+
protected navigated: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Whether the input currently shows the transient query rather than the
|
|
204
|
+
* committed selection's label. A single-select shows the query only once the
|
|
205
|
+
* user starts typing (`queryDirty`); until then — including right after
|
|
206
|
+
* reopening — the input keeps the selected option's label visible and
|
|
207
|
+
* editable, matching Base UI. `multiple` shows the query always (the
|
|
208
|
+
* selections live in chips, not the input).
|
|
209
|
+
*/
|
|
210
|
+
protected get showsQueryInInput(): boolean;
|
|
211
|
+
/** The text shown in the input. Select: query while open, label when closed. */
|
|
212
|
+
protected get displayValue(): string;
|
|
213
|
+
/** The placeholder forwarded to the inner input. */
|
|
214
|
+
protected get inputPlaceholder(): string | undefined;
|
|
215
|
+
/** The transient search text the list is filtered against. */
|
|
216
|
+
protected get filterQuery(): string;
|
|
217
|
+
/** Whether an option is selected (drives `aria-selected` and the check icon). */
|
|
218
|
+
protected isSelected(option: ComboboxOption): boolean;
|
|
219
|
+
/** Serialises `value` for the form. */
|
|
220
|
+
protected get formValue(): string | undefined;
|
|
221
|
+
/** Whether there is any committed value (drives the clear affordance). */
|
|
222
|
+
protected get hasValue(): boolean;
|
|
223
|
+
/** The index of the create row, or `-1` when it isn't shown. Select-only. */
|
|
224
|
+
protected get createIndex(): number;
|
|
225
|
+
/** Whether the "Create" affordance should be offered for the current query. */
|
|
226
|
+
protected get canCreate(): boolean;
|
|
227
|
+
/** Leading content inside the control (e.g. chips). None by default. */
|
|
228
|
+
protected renderLeadingControl(): unknown;
|
|
229
|
+
/** The `aria-autocomplete` value for the inner input. */
|
|
230
|
+
protected get ariaAutocomplete(): string;
|
|
231
|
+
/** Commit the active option. Select: set value, close, restore focus. */
|
|
232
|
+
protected selectOption(option: ComboboxOption): void;
|
|
233
|
+
/**
|
|
234
|
+
* Hook for the Enter key when the listbox is open and the create/option
|
|
235
|
+
* branches have not handled it. Default: no-op (the base handles option
|
|
236
|
+
* selection in `handleKeydown`). Subclasses (autocomplete) return `true` to
|
|
237
|
+
* signal they fully handled Enter.
|
|
238
|
+
*/
|
|
239
|
+
protected handleEnter(_e: KeyboardEvent): boolean;
|
|
240
|
+
/** Hook invoked when a key is pressed (before the switch). Autocomplete uses it. */
|
|
241
|
+
protected onKeydown(_e: KeyboardEvent): void;
|
|
242
|
+
/** Hook invoked on input blur. Autocomplete reverts inline ghosts here. */
|
|
243
|
+
protected onBlur(): void;
|
|
244
|
+
/** Hook invoked after each render (for inline-ghost selection, etc.). */
|
|
245
|
+
protected afterUpdate(): void;
|
|
246
|
+
/** Hook invoked when the pointer hovers an option (autocomplete clears ghost state). */
|
|
247
|
+
protected onOptionHover(): void;
|
|
248
|
+
/** Hook invoked when ArrowUp/ArrowDown moves the active option. */
|
|
249
|
+
protected onMove(): void;
|
|
250
|
+
/** Normalises `value` to an array regardless of single/multiple shape. */
|
|
251
|
+
protected get values(): string[];
|
|
252
|
+
/** Upper bound on the label cache so long async sessions don't grow it forever. */
|
|
253
|
+
private static labelCacheLimit;
|
|
254
|
+
/** Records value→label pairs so labels survive options leaving the result set. */
|
|
255
|
+
protected cacheLabels(options: ComboboxOption[]): void;
|
|
256
|
+
/**
|
|
257
|
+
* Memoised filter result. `filteredOptions` is read many times per render (and
|
|
258
|
+
* per keyboard/scroll event via rowCount/activeOption/isVirtual), so the O(n)
|
|
259
|
+
* filter + groupBy must not re-run on every access — that would defeat the
|
|
260
|
+
* point of virtualizing a large list. Recomputed only when the options, the
|
|
261
|
+
* query, or the filtering mode change; the group map is cached alongside.
|
|
262
|
+
*/
|
|
263
|
+
private filteredCache?;
|
|
264
|
+
/**
|
|
265
|
+
* The options the control filters and renders from. The base uses the
|
|
266
|
+
* `options` property directly; `Combobox` overrides this to merge declarative
|
|
267
|
+
* `<nord-combobox-option>` children and auto-created options.
|
|
268
|
+
*/
|
|
269
|
+
protected get resolvedOptions(): ComboboxOption[];
|
|
270
|
+
protected get filtered(): {
|
|
271
|
+
options: ComboboxOption[];
|
|
272
|
+
query: string;
|
|
273
|
+
external: boolean;
|
|
274
|
+
result: ComboboxOption[];
|
|
275
|
+
hasGroups: boolean;
|
|
276
|
+
groups?: Map<string | undefined, ComboboxOption[]>;
|
|
277
|
+
};
|
|
278
|
+
/** The options remaining after filtering by the current query. */
|
|
279
|
+
protected get filteredOptions(): ComboboxOption[];
|
|
280
|
+
/** Total number of keyboard-navigable rows, including the create row. */
|
|
281
|
+
protected get rowCount(): number;
|
|
282
|
+
/** The currently active option, used for `aria-activedescendant` and Enter. */
|
|
283
|
+
protected get activeOption(): ComboboxOption | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Whether the option list is currently windowed. Only flat (non-grouped) lists
|
|
286
|
+
* with at least one option are virtualized.
|
|
287
|
+
*/
|
|
288
|
+
protected get isVirtual(): boolean;
|
|
289
|
+
connectedCallback(): void;
|
|
290
|
+
disconnectedCallback(): void;
|
|
291
|
+
/**
|
|
292
|
+
* Relocates the host's `slot="start"`/`slot="end"` children into the matching
|
|
293
|
+
* landing zone inside the control. Only direct host children are considered,
|
|
294
|
+
* and a child already sitting in its zone is left untouched, so repeated
|
|
295
|
+
* updates are idempotent and don't disturb focus or pointer state.
|
|
296
|
+
*/
|
|
297
|
+
private relocateSlots;
|
|
298
|
+
/** Mirrors the host (control) width into `--_n-combobox-anchor-inline-size`. */
|
|
299
|
+
protected syncAnchorInlineSize(): void;
|
|
300
|
+
protected createRenderRoot(): HTMLDivElement;
|
|
301
|
+
/**
|
|
302
|
+
* Show the listbox programmatically.
|
|
303
|
+
*/
|
|
304
|
+
show(): void;
|
|
305
|
+
/**
|
|
306
|
+
* Hide the listbox programmatically.
|
|
307
|
+
*/
|
|
308
|
+
hide(): void;
|
|
309
|
+
/**
|
|
310
|
+
* Hook for what happens to the transient query when the listbox closes.
|
|
311
|
+
* Select mode discards an abandoned filter query so the next open shows the
|
|
312
|
+
* full list and the selected option's label, not the stale search.
|
|
313
|
+
*/
|
|
314
|
+
protected onHide(): void;
|
|
315
|
+
/**
|
|
316
|
+
* Focus the control's input.
|
|
317
|
+
*/
|
|
318
|
+
focus(options?: FocusOptions): void;
|
|
319
|
+
protected handleOpenChange(): void;
|
|
320
|
+
/**
|
|
321
|
+
* Disabling the control while the listbox is open must close it. `show()`
|
|
322
|
+
* guards against opening when disabled, but nothing closes an already-open
|
|
323
|
+
* popout when `disabled` flips to `true` at runtime.
|
|
324
|
+
*/
|
|
325
|
+
protected handleDisabledChange(): void;
|
|
326
|
+
/** Row height changes with the size variant, so re-sample it on the next render. */
|
|
327
|
+
protected resetRowSample(): void;
|
|
328
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
329
|
+
/** Keeps `count` in sync with the filtered list before each render. */
|
|
330
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
331
|
+
/**
|
|
332
|
+
* Keeps the active row visible after a keyboard move. Virtualized option rows
|
|
333
|
+
* ask the virtualizer to scroll the index into view (the row may not be in the
|
|
334
|
+
* DOM yet); the create row and plain lists defer to the browser since their
|
|
335
|
+
* element is always rendered.
|
|
336
|
+
*/
|
|
337
|
+
private scrollActiveIntoView;
|
|
338
|
+
/** Keeps `open` in sync if the popout closes itself (e.g. light dismiss). */
|
|
339
|
+
private handlePopoutClose;
|
|
340
|
+
/** Swallows the popout's own `open` so the combobox emits a single `open`. */
|
|
341
|
+
private handlePopoutOpen;
|
|
342
|
+
/** Re-clamps the active index so it stays within the navigable rows. */
|
|
343
|
+
protected resetActiveIndex(): void;
|
|
344
|
+
protected handleInput(e: Event): void;
|
|
345
|
+
/** Hook after the search query updates from typing. Autocomplete commits live. */
|
|
346
|
+
protected onInput(_input: HTMLInputElement): void;
|
|
347
|
+
protected handleFocus(): void;
|
|
348
|
+
private handleBlur;
|
|
349
|
+
protected handleKeydown(e: KeyboardEvent): void;
|
|
350
|
+
/** Hook for keys the base switch does not handle (Backspace chips, etc.). */
|
|
351
|
+
protected onUnhandledKeydown(_e: KeyboardEvent): void;
|
|
352
|
+
/**
|
|
353
|
+
* Fires the create affordance. Default is a no-op; the select combobox
|
|
354
|
+
* overrides this to dispatch its `create` event.
|
|
355
|
+
*/
|
|
356
|
+
protected emitCreate(): void;
|
|
357
|
+
private move;
|
|
358
|
+
protected commit(): void;
|
|
359
|
+
/** Resolves a value to its best-known label (current options, then cache). */
|
|
360
|
+
protected labelFor(value: string): string;
|
|
361
|
+
render(): TemplateResult<1>;
|
|
362
|
+
/** Whether the clear (✕) affordance shows. Off by default (no `clearable`). */
|
|
363
|
+
protected get showClear(): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Whether the dropdown chevron toggle (and the divider before it) renders. On
|
|
366
|
+
* by default — the combobox is a picker that opens its full list on click.
|
|
367
|
+
* Autocomplete overrides this to `false`: like Base UI's autocomplete (which
|
|
368
|
+
* renders no `Trigger`), it is a search input whose list appears on typing.
|
|
369
|
+
*/
|
|
370
|
+
protected get showToggle(): boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Drives the listbox `aria-multiselectable`. Single-select by default;
|
|
373
|
+
* autocomplete overrides this to `undefined` so the attribute is omitted (it
|
|
374
|
+
* has no selection model).
|
|
375
|
+
*/
|
|
376
|
+
protected get ariaMultiselectable(): 'true' | 'false' | undefined;
|
|
377
|
+
protected renderGroup(group: string | undefined, groupOptions: ComboboxOption[], indexByValue: Map<string, number>): TemplateResult<1>;
|
|
378
|
+
/** Resolves the content shown for a single option. */
|
|
379
|
+
protected optionContent(option: ComboboxOption): TemplateResult | unknown;
|
|
380
|
+
/**
|
|
381
|
+
* Samples the uniform row height once from the first rendered virtual row, then
|
|
382
|
+
* re-measures the virtualizer so the window is sized from the real height rather
|
|
383
|
+
* than the estimate. Runs only while the sample is missing and a laid-out row is
|
|
384
|
+
* present, so it never becomes a per-render measurement loop.
|
|
385
|
+
*/
|
|
386
|
+
private sampleRowSize;
|
|
387
|
+
/**
|
|
388
|
+
* Renders only the virtual items currently in view, absolutely positioned
|
|
389
|
+
* inside a full-height sizer so the scrollbar reflects the whole list. Rows take
|
|
390
|
+
* a fixed height from the virtualizer (uniform rows), so no per-row measurement
|
|
391
|
+
* is needed. `setSize`/`posinset` give assistive tech the true total even though
|
|
392
|
+
* most rows aren't in the DOM.
|
|
393
|
+
*/
|
|
394
|
+
private renderVirtualOptions;
|
|
395
|
+
protected renderListOption(option: ComboboxOption, index: number, setSize?: number): TemplateResult<1>;
|
|
396
|
+
/** The option's `aria-selected` value. Autocomplete omits it (returns nothing). */
|
|
397
|
+
protected optionAriaSelected(selected: boolean): string | typeof nothing;
|
|
398
|
+
/** Whether the selected-check icon shows. Autocomplete never shows it. */
|
|
399
|
+
protected showCheck(selected: boolean): boolean;
|
|
400
|
+
/**
|
|
401
|
+
* Whether the leading check gutter is rendered. Combobox reserves it so the
|
|
402
|
+
* selected tick sits on the left and every label lines up (matching the
|
|
403
|
+
* filter dropdown); autocomplete has no selection, so it omits the gutter to
|
|
404
|
+
* avoid indenting every suggestion.
|
|
405
|
+
*/
|
|
406
|
+
protected get rendersCheck(): boolean;
|
|
407
|
+
/** The create row. Rendered only when `canCreate`; base returns nothing. */
|
|
408
|
+
protected renderCreate(): unknown;
|
|
409
|
+
protected renderEmpty(): TemplateResult<1>;
|
|
410
|
+
protected optionId(index: number): string;
|
|
411
|
+
/** The id used for the create row (so subclasses can reference it). */
|
|
412
|
+
protected get createId(): string;
|
|
413
|
+
/** Pointer hover highlights an option (without marking it as keyboard-navigated). */
|
|
414
|
+
protected handleOptionHover(index: number): void;
|
|
415
|
+
protected handleControlClick(): void;
|
|
416
|
+
protected handleClearClick(e: Event): void;
|
|
417
|
+
/** Clear the current value. Overridden by clearable variants. */
|
|
418
|
+
clear(): void;
|
|
419
|
+
protected handleToggleClick(e: Event): void;
|
|
420
|
+
}
|
|
421
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NordEvent } from '../common/events.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dispatched when the user chooses the "Create" affordance in a `creatable`
|
|
4
|
+
* combobox. Carries the current search query. By default the combobox then adds
|
|
5
|
+
* the value as an option and selects it; the event is cancelable, so calling
|
|
6
|
+
* `preventDefault()` opts out and lets the consumer handle creation manually.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ComboboxCreateEvent extends NordEvent {
|
|
9
|
+
/** The search query the user typed, offered as the new option's label. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
static eventName: string;
|
|
12
|
+
constructor(
|
|
13
|
+
/** The search query the user typed, offered as the new option's label. */
|
|
14
|
+
value: string);
|
|
15
|
+
/** Convenience accessor mirroring `CustomEvent.detail`. */
|
|
16
|
+
get detail(): string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Dispatched when the value is cleared via the clear button or the `clear()`
|
|
20
|
+
* method, before the accompanying `change` event.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ComboboxClearEvent extends NordEvent {
|
|
23
|
+
static eventName: string;
|
|
24
|
+
constructor();
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Groups declarative `<nord-combobox-option>` children under a heading inside a
|
|
4
|
+
* [Combobox](/components/combobox/):
|
|
5
|
+
*
|
|
6
|
+
* ```html
|
|
7
|
+
* <nord-combobox>
|
|
8
|
+
* <nord-combobox-group label="Frameworks">
|
|
9
|
+
* <nord-combobox-option value="next">Next.js</nord-combobox-option>
|
|
10
|
+
* </nord-combobox-group>
|
|
11
|
+
* </nord-combobox>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Contained options inherit this `label` as their group. The element renders
|
|
15
|
+
* nothing itself and is hidden with `display: none`.
|
|
16
|
+
*
|
|
17
|
+
* @status draft
|
|
18
|
+
* @category form
|
|
19
|
+
* @lightDom true
|
|
20
|
+
*
|
|
21
|
+
* @slot - The group's `<nord-combobox-option>` children.
|
|
22
|
+
*/
|
|
23
|
+
export default class ComboboxGroup extends LitElement {
|
|
24
|
+
/** The group heading shown above its options. */
|
|
25
|
+
label: string;
|
|
26
|
+
private registry;
|
|
27
|
+
protected createRenderRoot(): this;
|
|
28
|
+
protected updated(): void;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'nord-combobox-group': ComboboxGroup;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A declarative option for a [Combobox](/components/combobox/). Place these as
|
|
4
|
+
* children of `<nord-combobox>` instead of (or as an alternative to) setting the
|
|
5
|
+
* `.options` property:
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <nord-combobox>
|
|
9
|
+
* <nord-combobox-option value="bug">Bug</nord-combobox-option>
|
|
10
|
+
* <nord-combobox-option value="feature">Feature</nord-combobox-option>
|
|
11
|
+
* </nord-combobox>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The option's child markup becomes the rendered row, so you can author custom
|
|
15
|
+
* items (e.g. an avatar + text) without an `html` string or a render function.
|
|
16
|
+
* Set the `label` attribute when the visible markup isn't plain text, so
|
|
17
|
+
* filtering and the accessible name have something to match on.
|
|
18
|
+
*
|
|
19
|
+
* The element renders nothing itself — it is a data source the combobox reads via
|
|
20
|
+
* context and is hidden with `display: none`.
|
|
21
|
+
*
|
|
22
|
+
* @status draft
|
|
23
|
+
* @category form
|
|
24
|
+
* @lightDom true
|
|
25
|
+
*
|
|
26
|
+
* @slot - The option's label / custom content.
|
|
27
|
+
*/
|
|
28
|
+
export default class ComboboxOption extends LitElement {
|
|
29
|
+
/** The value submitted with the form and tracked in the combobox's `value`. */
|
|
30
|
+
value: string;
|
|
31
|
+
/** Whether the option is selectable. */
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
/** Text used for filtering and the accessible name. Defaults to the text content. */
|
|
34
|
+
label?: string;
|
|
35
|
+
private registry;
|
|
36
|
+
/** Re-sync when the option's child content (custom markup) changes. */
|
|
37
|
+
private contentObserver?;
|
|
38
|
+
protected createRenderRoot(): this;
|
|
39
|
+
connectedCallback(): void;
|
|
40
|
+
disconnectedCallback(): void;
|
|
41
|
+
protected updated(): void;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
'nord-combobox-option': ComboboxOption;
|
|
46
|
+
}
|
|
47
|
+
}
|