@nordhealth/components 4.26.2 → 5.0.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 +51620 -18552
- 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-D47b20IT.js +2 -0
- package/lib/Calendar-D47b20IT.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-DBxXlbY7.js +2 -0
- package/lib/Combobox-DBxXlbY7.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/KeyboardController.js +1 -1
- package/lib/KeyboardController.js.map +1 -1
- package/lib/Layout.js +1 -3
- package/lib/Layout.js.map +1 -1
- package/lib/{LightDismissController-4pH8cdko.js → LightDismissController-wcL1ziJa.js} +2 -2
- package/lib/{LightDismissController-4pH8cdko.js.map → LightDismissController-wcL1ziJa.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/Outline.js +2 -0
- package/lib/Outline.js.map +1 -0
- package/lib/OutlineItem.js +2 -0
- package/lib/OutlineItem.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-CFtFoCaA.js +2 -0
- package/lib/Popout-CFtFoCaA.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/Qrcode.js.map +1 -1
- 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/ShortcutController-CV5b0BZl.js +2 -0
- package/lib/ShortcutController-CV5b0BZl.js.map +1 -0
- 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/VisuallyHidden.js.map +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/localization23.js +2 -0
- package/lib/localization23.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 +520 -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 +48 -0
- package/lib/src/aside/Aside.d.ts +1 -1
- package/lib/src/aside-drawer/AsideDrawer.d.ts +3 -1
- 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/avatar/Avatar.d.ts +1 -1
- 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 +45 -1
- package/lib/src/calendar/DateRangeSelectEvent.d.ts +16 -0
- package/lib/src/card/Card.d.ts +1 -1
- 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/ShortcutController.d.ts +5 -5
- 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/divider/Divider.d.ts +1 -1
- package/lib/src/drawer/Drawer.d.ts +1 -1
- 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/footer/Footer.d.ts +1 -1
- package/lib/src/header/Header.d.ts +1 -1
- package/lib/src/icon/Icon.d.ts +1 -1
- package/lib/src/index.d.ts +61 -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 +3 -3
- package/lib/src/localization/en-us.d.ts +88 -0
- package/lib/src/localization/translation.d.ts +88 -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 +188 -0
- package/lib/src/otp-field/OtpFieldEvents.d.ts +38 -0
- package/lib/src/otp-field/localization.d.ts +4 -0
- package/lib/src/outline/Outline.d.ts +111 -0
- package/lib/src/outline/OutlineItem.d.ts +42 -0
- package/lib/src/outline/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/qrcode/Qrcode.d.ts +1 -1
- package/lib/src/scroll-area/ScrollArea.d.ts +101 -0
- package/lib/src/segmented-control-item/SegmentedControlItem.d.ts +2 -0
- package/lib/src/stack/Stack.d.ts +1 -1
- 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/Tag.d.ts +1 -1
- package/lib/src/tag-group/TagGroup.d.ts +3 -1
- 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/src/top-bar/TopBar.d.ts +1 -1
- package/lib/src/truncate/Truncate.d.ts +1 -1
- package/lib/src/visually-hidden/VisuallyHidden.d.ts +1 -1
- package/lib/story-descriptions.js +2 -0
- package/lib/story-descriptions.js.map +1 -0
- package/lib/tinykeys-DwvDXsEb.js +2 -0
- package/lib/tinykeys-DwvDXsEb.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 +418 -0
- package/package.json +10 -13
- 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/ShortcutController-BIb3WGzH.js +0 -2
- package/lib/ShortcutController-BIb3WGzH.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
- package/lib/tinykeys.module-_6MZt7MP.js +0 -2
- package/lib/tinykeys.module-_6MZt7MP.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.js","sources":["../src/outline/Outline.ts"],"sourcesContent":["import type OutlineItem from './OutlineItem.js'\nimport { html, isServer, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { SlotController } from '../common/controllers/SlotController.js'\nimport { cond } from '../common/directives/cond.js'\nimport { NordEvent } from '../common/events.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Outline.css'\n\nimport './OutlineItem.js'\n\n/**\n * Event dispatched when the active section of an Outline changes, either via the\n * built-in scroll-spy, a click on one of its items, or a programmatic change.\n * The event's `activeId` is the id of the newly active heading.\n */\nexport class NordOutlineChangeEvent extends NordEvent {\n declare activeId: string\n\n constructor(activeId: string) {\n super('change')\n Object.defineProperty(this, 'activeId', {\n value: activeId,\n enumerable: true,\n writable: false,\n })\n }\n}\n\ninterface ScannedHeading {\n id: string\n text: string\n level: number\n}\n\ninterface OutlineEntry {\n id: string\n element: HTMLElement\n setActive: (active: boolean) => void\n}\n\nfunction slugify(text: string): string {\n return text\n .trim()\n .toLowerCase()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-')\n}\n\n/**\n * Outline is an in-page table of contents that lists a page's headings and\n * highlights the section currently in view as you scroll.\n *\n * Provide [Outline Item](/components/outline-item/) children, or point `for` at\n * a container to build the list from its headings.\n *\n * @status draft\n * @category navigation\n *\n * @slot - The default slot for [Outline Item](/components/outline-item/) children.\n * @slot header - Custom header content shown above the list. Overrides the default localized \"On this page\" heading. Set `hide-header` to remove the header entirely.\n *\n * @fires {NordOutlineChangeEvent} change - Dispatched when the active section changes. Includes an `activeId` property.\n *\n * @localization label - Accessible label for the outline navigation landmark, and the default header text.\n *\n * @cssprop [--n-outline-indicator-color=var(--n-color-accent)] - Color of the sliding active indicator.\n * @cssprop [--n-outline-track-color=var(--n-color-border)] - Color of the static track behind the indicator.\n * @cssprop [--n-outline-indicator-width=2px] - Thickness of the track and indicator.\n * @cssprop [--n-outline-indent=var(--n-space-m)] - Indentation step applied per heading level.\n * @cssprop [--n-outline-header-color=var(--n-color-text-weaker)] - Color of the default header text.\n * @cssprop [--n-outline-header-font-size=var(--n-font-size-s)] - Font size of the default header text.\n */\n@customElement('nord-outline')\nexport default class Outline extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n protected localize = new LocalizeController<'nord-outline'>(this)\n\n private headerSlot = new SlotController(this, 'header')\n\n /**\n * The id of the active heading. Setting this puts the Outline in controlled\n * mode and disables the built-in scroll-spy, so your own logic owns the\n * highlight (mirrors providing `activeId` in other libraries).\n */\n @property({ reflect: true }) active?: string\n\n /**\n * Tightens spacing for dense sidebars where vertical space is at a premium.\n */\n @property({ reflect: true }) density: 'default' | 'compact' = 'default'\n\n /**\n * DOM-scan mode: the id (or any CSS selector) of the content container whose\n * headings should populate the outline. When set, slotted children are\n * ignored and items are generated from the matched headings.\n */\n @property({ reflect: true }) for?: string\n\n /**\n * The selector used to find headings when `for` is set.\n */\n @property({ attribute: 'heading-selector' }) headingSelector = 'h1,h2,h3,h4'\n\n /**\n * CSS selector for the element that scrolls the content, used as the\n * scroll-spy `IntersectionObserver` root. Point this at your scroll container\n * when the page scrolls inside an element rather than the window — otherwise\n * the observer watches the window and never sees the headings move. If the\n * selector resolves to a `nord-scroll-area`, its scroll viewport is used.\n *\n * When unset, the nearest ancestor `nord-scroll-area` of the scanned content\n * is detected automatically, falling back to the window.\n */\n @property({ attribute: 'scroll-container' }) scrollContainer?: string\n\n /**\n * Hides the header. By default Outline shows a localized \"On this page\"\n * heading (or the `header` slot's content) above the list.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-header' }) hideHeader = false\n\n @state() private scanned: ScannedHeading[] = []\n\n @query('.n-outline-list') private containerEl?: HTMLElement\n @query('.n-outline-indicator') private indicatorEl?: HTMLElement\n\n private controlled = false\n private observer?: IntersectionObserver\n private resizeObserver?: ResizeObserver\n private mutationObserver?: MutationObserver\n private readonly intersecting = new Set<string>()\n\n connectedCallback() {\n super.connectedCallback()\n\n // Expose a navigation landmark with an accessible name, without clobbering\n // any semantics the consumer has already provided.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'navigation')\n }\n if (!this.hasAttribute('aria-label') && !this.hasAttribute('aria-labelledby')) {\n this.setAttribute('aria-label', this.localize.term('label'))\n }\n\n this.addEventListener('click', this.handleClick)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListener('click', this.handleClick)\n this.observer?.disconnect()\n this.resizeObserver?.disconnect()\n this.mutationObserver?.disconnect()\n }\n\n protected firstUpdated() {\n if (isServer) {\n return\n }\n\n // Controlled mode is decided once, by whether the consumer supplied a\n // non-empty `active`. An empty value leaves scroll-spy in charge.\n this.controlled = this.active != null && this.active !== ''\n\n this.scanContent()\n\n if (typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this.updateIndicator())\n this.resizeObserver.observe(this)\n }\n\n // Watch for slotted items being added/removed (e.g. via v-for / *ngFor).\n this.mutationObserver = new MutationObserver(() => this.refresh())\n this.mutationObserver.observe(this, { childList: true })\n\n this.refresh()\n }\n\n protected updated(changed: Map<string, unknown>) {\n if (changed.has('active')) {\n this.applyActiveToItems()\n this.updateIndicator()\n }\n if (changed.has('for') || changed.has('headingSelector')) {\n this.scanContent()\n this.refresh()\n }\n if (changed.has('scrollContainer')) {\n this.observeTargets()\n }\n if (changed.has('scanned')) {\n this.refresh()\n }\n }\n\n /** Re-derive entries, restart scroll-spy and reposition the indicator. */\n private refresh() {\n this.observeTargets()\n this.applyActiveToItems()\n this.updateIndicator()\n }\n\n /** The ordered list of items, normalised across slotted and scan modes. */\n private get entries(): OutlineEntry[] {\n if (this.for) {\n const anchors = [...this.renderRoot.querySelectorAll<HTMLAnchorElement>('a.n-outline-item')]\n return anchors.map(anchor => ({\n id: anchor.dataset.id ?? '',\n element: anchor,\n // Generated anchors get their active styling from `aria-current` in render().\n setActive: () => {},\n }))\n }\n\n const items = [...this.querySelectorAll<OutlineItem>('nord-outline-item')]\n return items.map(item => ({\n id: (item.getAttribute('href') ?? '').replace(/^#/, ''),\n element: item,\n setActive: (active: boolean) => {\n item.active = active\n },\n }))\n }\n\n private scanContent() {\n if (isServer || !this.for) {\n this.scanned = []\n return\n }\n\n const root = document.getElementById(this.for) ?? document.querySelector(this.for)\n if (!root) {\n this.scanned = []\n return\n }\n\n const headings = [...root.querySelectorAll<HTMLElement>(this.headingSelector)]\n this.scanned = headings.map((heading) => {\n if (!heading.id) {\n heading.id = slugify(heading.textContent ?? '')\n }\n const level = Number(heading.tagName.slice(1)) || 1\n return {\n id: heading.id,\n text: heading.textContent?.trim() ?? '',\n level: Math.min(Math.max(level, 1), 4),\n }\n })\n }\n\n private observeTargets() {\n this.observer?.disconnect()\n this.intersecting.clear()\n\n if (this.controlled || isServer || typeof IntersectionObserver === 'undefined') {\n return\n }\n\n // Resolve the scroll container to observe within. An explicit\n // `scroll-container` selector wins; otherwise auto-detect the nearest\n // ancestor `nord-scroll-area` of the scanned content. A `nord-scroll-area`\n // is resolved down to its scroll viewport (the element that actually\n // scrolls). When nothing resolves, `root` stays null — the observer then\n // watches the document viewport (body/html), the original behaviour.\n const explicit = this.scrollContainer ? document.querySelector(this.scrollContainer) : null\n const contentRoot = this.for\n ? (document.getElementById(this.for) ?? document.querySelector(this.for))\n : this\n const container = explicit ?? contentRoot?.closest('nord-scroll-area') ?? null\n\n let root: Element | null = null\n if (container) {\n if (container.localName === 'nord-scroll-area') {\n const viewport = container.shadowRoot?.querySelector('[part~=\"viewport\"]')\n if (!viewport) {\n // The scroll-area hasn't upgraded yet; re-run once it has so we\n // observe the real scroller rather than falling back to the window.\n customElements.whenDefined('nord-scroll-area').then(() => {\n if (this.isConnected) {\n this.observeTargets()\n }\n })\n return\n }\n root = viewport\n }\n else {\n root = container\n }\n }\n\n // A heading becomes active as it nears the top of the container. The lower\n // bound keeps the section active while the reader is within it.\n this.observer = new IntersectionObserver(this.handleIntersect, {\n root,\n rootMargin: '0px 0px -66% 0px',\n threshold: 0,\n })\n\n for (const entry of this.entries) {\n const target = entry.id ? document.getElementById(entry.id) : null\n if (target) {\n this.observer.observe(target)\n }\n }\n }\n\n private handleIntersect = (entries: IntersectionObserverEntry[]) => {\n for (const entry of entries) {\n const id = entry.target.id\n if (entry.isIntersecting) {\n this.intersecting.add(id)\n }\n else {\n this.intersecting.delete(id)\n }\n }\n\n // Pick the first heading in document order that's currently in view.\n const next = this.entries.map(e => e.id).find(id => this.intersecting.has(id))\n if (next && next !== this.active) {\n this.setActive(next)\n }\n }\n\n private setActive(id: string) {\n this.active = id\n this.dispatchEvent(new NordOutlineChangeEvent(id))\n }\n\n private applyActiveToItems() {\n for (const entry of this.entries) {\n entry.setActive(entry.id === this.active)\n }\n }\n\n private updateIndicator() {\n const indicator = this.indicatorEl\n const container = this.containerEl\n if (!indicator || !container) {\n return\n }\n\n const active = this.entries.find(entry => entry.id === this.active)\n if (!active) {\n indicator.classList.remove('is-visible')\n return\n }\n\n const containerRect = container.getBoundingClientRect()\n const itemRect = active.element.getBoundingClientRect()\n indicator.style.transform = `translateY(${itemRect.top - containerRect.top}px)`\n indicator.style.blockSize = `${itemRect.height}px`\n indicator.classList.add('is-visible')\n }\n\n private handleClick = (event: MouseEvent) => {\n // Honour modifier-clicks (open in new tab, etc.) — let the browser handle them.\n if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return\n }\n\n const anchor = event.composedPath().find((node): node is HTMLAnchorElement => node instanceof HTMLAnchorElement)\n const href = anchor?.getAttribute('href')\n if (!href?.startsWith('#')) {\n return\n }\n\n const id = href.slice(1)\n const target = document.getElementById(id)\n if (!target) {\n return\n }\n\n event.preventDefault()\n const reduceMotion = typeof matchMedia !== 'undefined' && matchMedia('(prefers-reduced-motion: reduce)').matches\n target.scrollIntoView({ behavior: reduceMotion ? 'auto' : 'smooth', block: 'start' })\n\n if (typeof history !== 'undefined') {\n history.replaceState(null, '', `#${id}`)\n }\n\n // Update immediately for responsiveness, even in controlled mode the click\n // is an explicit user intent so we reflect it and notify.\n this.setActive(id)\n }\n\n private handleSlotChange = () => {\n this.refresh()\n }\n\n private renderHeader() {\n if (this.hideHeader) {\n return nothing\n }\n // A custom header (slot) keeps its own semantics. The default text header is\n // hidden from assistive tech because the host's aria-label already names the\n // navigation landmark with the same term, avoiding a duplicate announcement.\n if (this.headerSlot.hasContent) {\n return html`<div class=\"n-outline-header\" part=\"header\"><slot name=\"header\"></slot></div>`\n }\n return html`<div class=\"n-outline-header\" part=\"header\" aria-hidden=\"true\">${this.localize.term('label')}</div>`\n }\n\n render() {\n return html`\n <div class=\"n-outline\" part=\"base\">\n ${this.renderHeader()}\n <div class=\"n-outline-list\" part=\"list\">\n <span class=\"n-outline-track\" aria-hidden=\"true\"></span>\n <span class=\"n-outline-indicator\" aria-hidden=\"true\"></span>\n ${this.for\n ? this.scanned.map(\n heading => html`\n <a\n class=\"n-outline-item is-generated\"\n data-id=${heading.id}\n href=\"#${heading.id}\"\n level=${heading.level}\n aria-current=${cond(this.active === heading.id, 'location')}\n >${heading.text}</a\n >\n `,\n )\n : html`<slot @slotchange=${this.handleSlotChange}></slot>`}\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-outline': Outline\n }\n}\n"],"names":["NordOutlineChangeEvent","NordEvent","constructor","activeId","super","Object","defineProperty","this","value","enumerable","writable","Outline","DraftComponentMixin","LitElement","localize","LocalizeController","headerSlot","SlotController","density","headingSelector","hideHeader","scanned","controlled","intersecting","Set","handleIntersect","entries","entry","id","target","isIntersecting","add","delete","next","map","e","find","has","active","setActive","handleClick","event","defaultPrevented","button","metaKey","ctrlKey","shiftKey","altKey","anchor","composedPath","node","HTMLAnchorElement","href","getAttribute","startsWith","slice","document","getElementById","preventDefault","reduceMotion","matchMedia","matches","scrollIntoView","behavior","block","history","replaceState","handleSlotChange","refresh","connectedCallback","hasAttribute","setAttribute","term","addEventListener","disconnectedCallback","removeEventListener","_a","observer","disconnect","_b","resizeObserver","_c","mutationObserver","firstUpdated","isServer","scanContent","ResizeObserver","updateIndicator","observe","MutationObserver","childList","updated","changed","applyActiveToItems","observeTargets","for","renderRoot","querySelectorAll","dataset","element","item","replace","root","querySelector","headings","heading","textContent","trim","toLowerCase","level","Number","tagName","text","Math","min","max","clear","IntersectionObserver","explicit","scrollContainer","contentRoot","container","closest","localName","viewport","_d","shadowRoot","customElements","whenDefined","then","isConnected","rootMargin","threshold","dispatchEvent","indicator","indicatorEl","containerEl","classList","remove","containerRect","getBoundingClientRect","itemRect","style","transform","top","blockSize","height","renderHeader","nothing","hasContent","html","render","cond","styles","componentStyle","__decorate","property","reflect","prototype","attribute","type","Boolean","state","query","customElement"],"mappings":"qvHAkBM,MAAOA,UAA+BC,EAG1C,WAAAC,CAAYC,GACVC,MAAM,UACNC,OAAOC,eAAeC,KAAM,WAAY,CACtCC,MAAOL,EACPM,YAAY,EACZC,UAAU,GAEb,EAiDY,IAAMC,EAAN,cAAsBC,EAAoBC,IAA1C,WAAAX,uBAGHK,KAAAO,SAAW,IAAIC,EAAmCR,MAEpDA,KAAUS,WAAG,IAAIC,EAAeV,KAAM,UAYjBA,KAAOW,QAA0B,UAYjBX,KAAeY,gBAAG,cAkBOZ,KAAUa,YAAG,EAElEb,KAAOc,QAAqB,GAKrCd,KAAUe,YAAG,EAIJf,KAAAgB,aAAe,IAAIC,IAiL5BjB,KAAAkB,gBAAmBC,IACzB,IAAK,MAAMC,KAASD,EAAS,CAC3B,MAAME,EAAKD,EAAME,OAAOD,GACpBD,EAAMG,eACRvB,KAAKgB,aAAaQ,IAAIH,GAGtBrB,KAAKgB,aAAaS,OAAOJ,EAE5B,CAGD,MAAMK,EAAO1B,KAAKmB,QAAQQ,KAAIC,GAAKA,EAAEP,KAAIQ,MAAKR,GAAMrB,KAAKgB,aAAac,IAAIT,KACtEK,GAAQA,IAAS1B,KAAK+B,QACxB/B,KAAKgC,UAAUN,EAChB,EAkCK1B,KAAAiC,YAAeC,IAErB,GAAIA,EAAMC,kBAAqC,IAAjBD,EAAME,QAAgBF,EAAMG,SAAWH,EAAMI,SAAWJ,EAAMK,UAAYL,EAAMM,OAC5G,OAGF,MAAMC,EAASP,EAAMQ,eAAeb,MAAMc,GAAoCA,aAAgBC,oBACxFC,EAAOJ,aAAM,EAANA,EAAQK,aAAa,QAClC,KAAKD,aAAA,EAAAA,EAAME,WAAW,MACpB,OAGF,MAAM1B,EAAKwB,EAAKG,MAAM,GAChB1B,EAAS2B,SAASC,eAAe7B,GACvC,IAAKC,EACH,OAGFY,EAAMiB,iBACN,MAAMC,E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J,UAAA,uBAAA,GAY/BH,EAAA,CAA5CC,EAAS,CAAEG,UAAW,sBAA8CpJ,EAAAmJ,UAAA,uBAAA,GAMCH,EAAA,CAArEC,EAAS,CAAEI,KAAMC,QAASJ,SAAS,EAAME,UAAW,iBAAmCpJ,EAAAmJ,UAAA,kBAAA,GAEvEH,EAAA,CAAhBO,KAA8CvJ,EAAAmJ,UAAA,eAAA,GAEbH,EAAA,CAAjCQ,EAAM,oBAAoDxJ,EAAAmJ,UAAA,mBAAA,GACpBH,EAAA,CAAtCQ,EAAM,yBAAyDxJ,EAAAmJ,UAAA,mBAAA,GApD7CnJ,EAAOgJ,EAAA,CAD3BS,EAAc,iBACMzJ,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e}from"./tslib.es6-CmLYFWVC.js";import{css as t,html as o,LitElement as n}from"lit";import{property as i,customElement as r}from"lit/decorators.js";import{c as l}from"./cond-CI1KbneT.js";import{D as a}from"./DraftComponentMixin-4qug5Rky.js";import{s}from"./Component-BJ5O5n8k.js";const c=t`:host{--n-outline-item-color:var(--n-color-text-weak);--n-outline-item-color-hover:var(--n-color-text);--n-outline-item-color-active:var(--n-color-text-link);--_n-outline-indent:var(--n-outline-indent,var(--n-space-m));--_n-outline-item-padding-block:var(--n-outline-item-padding-block,var(--n-space-s));display:block}.n-outline-item{border-radius:var(--n-border-radius-s);color:var(--n-outline-item-color);cursor:pointer;display:block;font-family:inherit;font-size:var(--n-font-size-s);line-height:var(--n-line-height-tight);overflow:hidden;padding-block:var(--_n-outline-item-padding-block);padding-inline-end:var(--n-space-s);padding-inline-start:var(--_n-outline-indent);text-decoration:none;text-overflow:ellipsis;transition:color .1s ease-in-out;white-space:nowrap}:host([level="2"]) .n-outline-item{padding-inline-start:calc(var(--_n-outline-indent)*2)}:host([level="3"]) .n-outline-item{padding-inline-start:calc(var(--_n-outline-indent)*3)}:host([level="4"]) .n-outline-item{padding-inline-start:calc(var(--_n-outline-indent)*4)}.n-outline-item:hover{color:var(--n-outline-item-color-hover)}.n-outline-item:focus-visible{box-shadow:0 0 0 2px var(--n-color-accent);outline:none}:host([active]) .n-outline-item{color:var(--n-outline-item-color-active);font-weight:var(--n-font-weight-active)}`;let d=class extends(a(n)){constructor(){super(...arguments),this.href="",this.level=1,this.active=!1}render(){return o`<a class="n-outline-item" href="${this.href}" aria-current="${l(this.active,"location")}"><slot></slot></a>`}};d.styles=[s,c],e([i({reflect:!0})],d.prototype,"href",void 0),e([i({type:Number,reflect:!0})],d.prototype,"level",void 0),e([i({type:Boolean,reflect:!0})],d.prototype,"active",void 0),d=e([r("nord-outline-item")],d);var v=d;export{v as default};
|
|
2
|
+
//# sourceMappingURL=OutlineItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlineItem.js","sources":["../src/outline/OutlineItem.ts"],"sourcesContent":["import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { cond } from '../common/directives/cond.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './OutlineItem.css'\n\n/**\n * Outline Item is a single link within an [Outline](/components/outline/). It\n * points at an in-page heading via its `href` and indents according to its\n * `level`. Its `active` state is managed by the parent Outline — you normally\n * don't set it yourself.\n *\n * @status draft\n * @category navigation\n *\n * @slot - The label text for the heading this item links to.\n *\n * @cssprop [--n-outline-item-color=var(--n-color-text-weak)] - Text color in the default state.\n * @cssprop [--n-outline-item-color-hover=var(--n-color-text)] - Text color on hover.\n * @cssprop [--n-outline-item-color-active=var(--n-color-text-link)] - Text color when the item is active.\n *\n * @parent Outline\n */\n@customElement('nord-outline-item')\nexport default class OutlineItem extends DraftComponentMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * The URL fragment of the heading this item links to, e.g. `#installation`.\n */\n @property({ reflect: true }) href = ''\n\n /**\n * Heading depth from 1 to 4. Controls how far the item is indented.\n */\n @property({ type: Number, reflect: true }) level: 1 | 2 | 3 | 4 = 1\n\n /**\n * Whether this item represents the currently active section. Managed by the\n * parent [Outline](/components/outline/) via its scroll-spy or `active` property.\n */\n @property({ type: Boolean, reflect: true }) active = false\n\n render() {\n return html`\n <a class=\"n-outline-item\" href=${this.href} aria-current=${cond(this.active, 'location')}>\n <slot></slot>\n </a>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-outline-item': OutlineItem\n }\n}\n"],"names":["OutlineItem","DraftComponentMixin","LitElement","constructor","this","href","level","active","render","html","cond","styles","componentStyle","style","__decorate","property","reflect","prototype","type","Number","Boolean","customElement"],"mappings":"mkDAyBe,IAAMA,EAAN,cAA0BC,EAAoBC,IAA9C,WAAAC,uBAMgBC,KAAIC,KAAG,GAKOD,KAAKE,MAAkB,EAMtBF,KAAMG,QAAG,CAStD,CAPC,MAAAC,GACE,OAAOC,CAAI,mCACwBL,KAAKC,uBAAqBK,EAAKN,KAAKG,OAAQ,gCAIhF,GAxBMP,EAAAW,OAAS,CAACC,EAAgBC,GAKJC,EAAA,CAA5BC,EAAS,CAAEC,SAAS,KAAiBhB,EAAAiB,UAAA,YAAA,GAKKH,EAAA,CAA1CC,EAAS,CAAEG,KAAMC,OAAQH,SAAS,KAAgChB,EAAAiB,UAAA,aAAA,GAMvBH,EAAA,CAA3CC,EAAS,CAAEG,KAAME,QAASJ,SAAS,KAAsBhB,EAAAiB,UAAA,cAAA,GAjBvCjB,EAAWc,EAAA,CAD/BO,EAAc,sBACMrB,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as i}from"./tslib.es6-CmLYFWVC.js";import{css as t,LitElement as o}from"lit";import{property as a,customElement as l}from"lit/decorators.js";import{i as r}from"./light-dom-styles-DXsbiKU9.js";import{D as s}from"./DraftComponentMixin-4qug5Rky.js";import{LocalizeController as n}from"./LocalizeController.js";import"./translation.js";import"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";import"./localization9.js";import"./localization10.js";import"./localization11.js";import"./localization12.js";import"./localization13.js";import"./localization14.js";import"./localization15.js";import"./localization16.js";import"./localization17.js";import"./localization18.js";import"./localization19.js";import"./localization20.js";import"./localization21.js";import"./localization22.js";import"./localization23.js";const e=t`nord-pagination{display:flex;inline-size:100%;justify-content:center;margin-inline:auto}nord-pagination[loading]{opacity:.5;pointer-events:none}`;let p=class extends(s(o)){constructor(){super(...arguments),this.localize=new n(this),this.loading=!1}connectedCallback(){super.connectedCallback(),r(this,e),this.hasAttribute("role")||this.setAttribute("role","navigation"),this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby")||this.setAttribute("aria-label",this.localize.term("label"))}updated(){this.loading?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy")}createRenderRoot(){return this}};i([a({reflect:!0,type:Boolean})],p.prototype,"loading",void 0),p=i([l("nord-pagination")],p);var c=p;export{c as default};
|
|
2
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../src/pagination/Pagination.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Pagination.css'\n\n/**\n * Pagination is the navigation root for a paginated collection. It is\n * composition-first: it owns no page state, renders no controls, and emits no\n * events. Your app owns the page state, URL/query syncing, cursors and any data\n * fetching; Nord supplies the semantic/layout primitives, the styling and the\n * `paginate()` math utility for building the page window.\n *\n * As a root it is a `navigation` landmark — it sets `role=\"navigation\"` and a\n * default accessible label so screen-reader users can jump to it. Compose the\n * lower-level primitives inside it:\n *\n * - [Pagination Content](/components/pagination-content/) — the list row.\n * - [Pagination Item](/components/pagination-item/) — a slot in the row.\n * - [Pagination Link](/components/pagination-link/) — a page link (set `current`).\n * - [Pagination Previous](/components/pagination-previous/) — the previous control.\n * - [Pagination Next](/components/pagination-next/) — the next control.\n * - [Pagination Ellipsis](/components/pagination-ellipsis/) — the collapsed-pages marker.\n *\n * Bring your own interactive element — an `<a>` (e.g. a framework `<Link>` /\n * `<NuxtLink>`) or a `nord-button` — and own its `href`, navigation and\n * `disabled` state. See the framework adapters in the docs.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @localization label - Accessible label for the pagination navigation landmark.\n *\n * @cssprop [--n-pagination-gap=var(--n-space-xs)] - Controls the spacing between pagination controls.\n *\n * @slot - Default slot for the composed pagination primitives.\n */\n@customElement('nord-pagination')\nexport default class Pagination extends DraftComponentMixin(LitElement) {\n protected localize = new LocalizeController<'nord-pagination'>(this)\n\n /**\n * Dims the pagination and disables interaction while results are loading.\n */\n @property({ reflect: true, type: Boolean }) loading = false\n\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n\n // As the navigation root, expose a landmark with an accessible name. Only\n // set defaults when the consumer hasn't provided their own semantics.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'navigation')\n }\n if (!this.hasAttribute('aria-label') && !this.hasAttribute('aria-labelledby')) {\n this.setAttribute('aria-label', this.localize.term('label'))\n }\n }\n\n protected updated() {\n // Light DOM with no render(): reflect the loading state onto the host for\n // assistive tech, mirroring the visual dim/disable applied via CSS.\n if (this.loading) {\n this.setAttribute('aria-busy', 'true')\n }\n else {\n this.removeAttribute('aria-busy')\n }\n }\n\n // No render() — the composed primitives are the element's own light-DOM\n // content; we only style them and set the landmark semantics.\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination': Pagination\n }\n}\n"],"names":["Pagination","DraftComponentMixin","LitElement","constructor","this","localize","LocalizeController","loading","connectedCallback","super","injectLightDomStyles","style","hasAttribute","setAttribute","term","updated","removeAttribute","createRenderRoot","__decorate","property","reflect","type","Boolean","prototype","customElement"],"mappings":"8nCAyCe,IAAMA,EAAN,cAAyBC,EAAoBC,IAA7C,WAAAC,uBACHC,KAAAC,SAAW,IAAIC,EAAsCF,MAKnBA,KAAOG,SAAG,CAgCvD,CA9BC,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBN,KAAMO,GAItBP,KAAKQ,aAAa,SACrBR,KAAKS,aAAa,OAAQ,cAEvBT,KAAKQ,aAAa,eAAkBR,KAAKQ,aAAa,oBACzDR,KAAKS,aAAa,aAAcT,KAAKC,SAASS,KAAK,SAEtD,CAES,OAAAC,GAGJX,KAAKG,QACPH,KAAKS,aAAa,YAAa,QAG/BT,KAAKY,gBAAgB,YAExB,CAIS,gBAAAC,GACR,OAAOb,IACR,GA/B2Cc,EAAA,CAA3CC,EAAS,CAAEC,SAAS,EAAMC,KAAMC,WAA0BtB,EAAAuB,UAAA,eAAA,GANxCvB,EAAUkB,EAAA,CAD9BM,EAAc,oBACMxB,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{LitElement as o}from"lit";import{customElement as r}from"lit/decorators.js";import{i as s}from"./light-dom-styles-DXsbiKU9.js";import{D as e}from"./DraftComponentMixin-4qug5Rky.js";import{s as i}from"./primitives-Dj0vyf1-.js";let a=class extends(e(o)){connectedCallback(){super.connectedCallback(),s(this,i)}createRenderRoot(){return this}};a=t([r("nord-pagination-content")],a);var m=a;export{m as default};
|
|
2
|
+
//# sourceMappingURL=PaginationContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationContent.js","sources":["../src/pagination/PaginationContent.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\n\n/**\n * The list container for composed [Pagination](/components/pagination/) controls.\n * Lays its [Pagination Item](/components/pagination-item/) children out in a row.\n *\n * Place it inside [Pagination](/components/pagination/), which is already the\n * `navigation` landmark (it sets `role=\"navigation\"` and an accessible label).\n * Do not add your own `<nav>` wrapper — a second landmark around the same\n * controls would be a duplicate that screen-reader users have to wade through.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @slot - Default slot for Pagination Item children.\n */\n@customElement('nord-pagination-content')\nexport default class PaginationContent extends DraftComponentMixin(LitElement) {\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n }\n\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-content': PaginationContent\n }\n}\n"],"names":["PaginationContent","DraftComponentMixin","LitElement","connectedCallback","super","injectLightDomStyles","this","style","createRenderRoot","__decorate","customElement"],"mappings":"qRAuBe,IAAMA,EAAN,cAAgCC,EAAoBC,IACjE,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBC,KAAMC,EAC5B,CAES,gBAAAC,GACR,OAAOF,IACR,GARkBN,EAAiBS,EAAA,CADrCC,EAAc,4BACMV,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as r}from"./tslib.es6-CmLYFWVC.js";import{html as e,LitElement as s}from"lit";import{property as t,customElement as i}from"lit/decorators.js";import{i as o}from"./light-dom-styles-DXsbiKU9.js";import{D as a}from"./DraftComponentMixin-4qug5Rky.js";import{s as l}from"./primitives-Dj0vyf1-.js";import"./VisuallyHidden.js";let n=class extends(a(s)){constructor(){super(...arguments),this.label="More pages"}connectedCallback(){super.connectedCallback(),o(this,l)}createRenderRoot(){return this}render(){return e`<span aria-hidden="true">…</span><nord-visually-hidden>${this.label}</nord-visually-hidden>`}};r([t()],n.prototype,"label",void 0),n=r([i("nord-pagination-ellipsis")],n);var d=n;export{d as default};
|
|
2
|
+
//# sourceMappingURL=PaginationEllipsis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationEllipsis.js","sources":["../src/pagination/PaginationEllipsis.ts"],"sourcesContent":["import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\nimport '../visually-hidden/VisuallyHidden.js'\n\n/**\n * The collapsed-pages marker (…) in a composed [Pagination](/components/pagination/).\n * The glyph is decorative; a visually-hidden label gives it meaning for\n * assistive tech. Set `label` to localise it.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @cssprop [--n-pagination-gap=var(--n-space-xs)] - Inherited spacing token used by the pagination row.\n */\n@customElement('nord-pagination-ellipsis')\nexport default class PaginationEllipsis extends DraftComponentMixin(LitElement) {\n /** The visually-hidden label announced for the collapsed pages. */\n @property() label = 'More pages'\n\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n }\n\n protected createRenderRoot() {\n return this\n }\n\n render() {\n return html`\n <span aria-hidden=\"true\">…</span>\n <nord-visually-hidden>${this.label}</nord-visually-hidden>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-ellipsis': PaginationEllipsis\n }\n}\n"],"names":["PaginationEllipsis","DraftComponentMixin","LitElement","constructor","this","label","connectedCallback","super","injectLightDomStyles","style","createRenderRoot","render","html","__decorate","property","prototype","customElement"],"mappings":"yUAoBe,IAAMA,EAAN,cAAiCC,EAAoBC,IAArD,WAAAC,uBAEDC,KAAKC,MAAG,YAiBrB,CAfC,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBJ,KAAMK,EAC5B,CAES,gBAAAC,GACR,OAAON,IACR,CAED,MAAAO,GACE,OAAOC,CAAI,0DAEeR,KAAKC,8BAEhC,GAhBWQ,EAAA,CAAXC,KAA+Bd,EAAAe,UAAA,aAAA,GAFbf,EAAkBa,EAAA,CADtCG,EAAc,6BACMhB,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{LitElement as o}from"lit";import{customElement as r}from"lit/decorators.js";import{i as s}from"./light-dom-styles-DXsbiKU9.js";import{D as e}from"./DraftComponentMixin-4qug5Rky.js";import{s as i}from"./primitives-Dj0vyf1-.js";let a=class extends(e(o)){connectedCallback(){super.connectedCallback(),s(this,i)}createRenderRoot(){return this}};a=t([r("nord-pagination-item")],a);var m=a;export{m as default};
|
|
2
|
+
//# sourceMappingURL=PaginationItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationItem.js","sources":["../src/pagination/PaginationItem.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\n\n/**\n * A single slot in a composed [Pagination Content](/components/pagination-content/)\n * row. Wrap each control — a [Pagination Link](/components/pagination-link/),\n * [Pagination Previous](/components/pagination-previous/), [Pagination Next](/components/pagination-next/)\n * or [Pagination Ellipsis](/components/pagination-ellipsis/) — in its own item.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @slot - Default slot for a single pagination control.\n */\n@customElement('nord-pagination-item')\nexport default class PaginationItem extends DraftComponentMixin(LitElement) {\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n }\n\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-item': PaginationItem\n }\n}\n"],"names":["PaginationItem","DraftComponentMixin","LitElement","connectedCallback","super","injectLightDomStyles","this","style","createRenderRoot","__decorate","customElement"],"mappings":"qRAoBe,IAAMA,EAAN,cAA6BC,EAAoBC,IAC9D,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBC,KAAMC,EAC5B,CAES,gBAAAC,GACR,OAAOF,IACR,GARkBN,EAAcS,EAAA,CADlCC,EAAc,yBACMV,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{LitElement as r}from"lit";import{property as e,customElement as s}from"lit/decorators.js";import{i as o}from"./light-dom-styles-DXsbiKU9.js";import{D as i}from"./DraftComponentMixin-4qug5Rky.js";import{s as n}from"./primitives-Dj0vyf1-.js";let a=class extends(i(r)){constructor(){super(...arguments),this.current=!1,this.ownsAriaCurrent=!1}connectedCallback(){super.connectedCallback(),o(this,n),this.syncCurrent()}createRenderRoot(){return this}updated(){this.syncCurrent()}syncCurrent(){const t=this.querySelector("a, button, nord-button");t&&(this.current?(t.setAttribute("aria-current","page"),this.ownsAriaCurrent=!0):this.ownsAriaCurrent&&(t.removeAttribute("aria-current"),this.ownsAriaCurrent=!1))}};t([e({reflect:!0,type:Boolean})],a.prototype,"current",void 0),a=t([s("nord-pagination-link")],a);var u=a;export{u as default};
|
|
2
|
+
//# sourceMappingURL=PaginationLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationLink.js","sources":["../src/pagination/PaginationLink.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\n\n/**\n * A page link in a composed [Pagination](/components/pagination/). A layout\n * wrapper around your own interactive element — provide an `<a>` (e.g. a\n * framework `<Link>` for crawlable, SSR-friendly links) or a `nord-button`. Set\n * `current` on the link for the active page; it mirrors `aria-current=\"page\"`\n * onto the interactive child so assistive tech announces it.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @slot - Default slot for the page link or button.\n */\n@customElement('nord-pagination-link')\nexport default class PaginationLink extends DraftComponentMixin(LitElement) {\n /** Marks this as the current page, mirroring `aria-current=\"page\"` onto the child. */\n @property({ reflect: true, type: Boolean }) current = false\n\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n this.syncCurrent()\n }\n\n protected createRenderRoot() {\n return this\n }\n\n // No render() — the consumer's link/button is preserved as the element's own\n // content; we only reflect `current` onto it.\n protected updated() {\n this.syncCurrent()\n }\n\n // Whether we set `aria-current` on the child, so we only ever clear our own —\n // a consumer who sets `aria-current` themselves (without `current`) keeps it.\n private ownsAriaCurrent = false\n\n private syncCurrent() {\n const link = this.querySelector('a, button, nord-button')\n if (!link) {\n return\n }\n if (this.current) {\n link.setAttribute('aria-current', 'page')\n this.ownsAriaCurrent = true\n }\n else if (this.ownsAriaCurrent) {\n link.removeAttribute('aria-current')\n this.ownsAriaCurrent = false\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-link': PaginationLink\n }\n}\n"],"names":["PaginationLink","DraftComponentMixin","LitElement","constructor","this","current","ownsAriaCurrent","connectedCallback","super","injectLightDomStyles","style","syncCurrent","createRenderRoot","updated","link","querySelector","setAttribute","removeAttribute","__decorate","property","reflect","type","Boolean","prototype","customElement"],"mappings":"mSAqBe,IAAMA,EAAN,cAA6BC,EAAoBC,IAAjD,WAAAC,uBAE+BC,KAAOC,SAAG,EAoB9CD,KAAeE,iBAAG,CAgB3B,CAlCC,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBL,KAAMM,GAC3BN,KAAKO,aACN,CAES,gBAAAC,GACR,OAAOR,IACR,CAIS,OAAAS,GACRT,KAAKO,aACN,CAMO,WAAAA,GACN,MAAMG,EAAOV,KAAKW,cAAc,0BAC3BD,IAGDV,KAAKC,SACPS,EAAKE,aAAa,eAAgB,QAClCZ,KAAKE,iBAAkB,GAEhBF,KAAKE,kBACZQ,EAAKG,gBAAgB,gBACrBb,KAAKE,iBAAkB,GAE1B,GAnC2CY,EAAA,CAA3CC,EAAS,CAAEC,SAAS,EAAMC,KAAMC,WAA0BtB,EAAAuB,UAAA,eAAA,GAFxCvB,EAAckB,EAAA,CADlCM,EAAc,yBACMxB,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{LitElement as o}from"lit";import{customElement as r}from"lit/decorators.js";import{i as s}from"./light-dom-styles-DXsbiKU9.js";import{D as e}from"./DraftComponentMixin-4qug5Rky.js";import{s as i}from"./primitives-Dj0vyf1-.js";let a=class extends(e(o)){connectedCallback(){super.connectedCallback(),s(this,i)}createRenderRoot(){return this}};a=t([r("nord-pagination-next")],a);var m=a;export{m as default};
|
|
2
|
+
//# sourceMappingURL=PaginationNext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationNext.js","sources":["../src/pagination/PaginationNext.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\n\n/**\n * The \"next page\" control in a composed [Pagination](/components/pagination/). A\n * layout wrapper around your own interactive element — provide an `<a>` (e.g. a\n * framework `<Link>`) or a `nord-button` with its own icon, label and\n * navigation, and disable it when there is no next page.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @slot - Default slot for the next-page link or button.\n */\n@customElement('nord-pagination-next')\nexport default class PaginationNext extends DraftComponentMixin(LitElement) {\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n }\n\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-next': PaginationNext\n }\n}\n"],"names":["PaginationNext","DraftComponentMixin","LitElement","connectedCallback","super","injectLightDomStyles","this","style","createRenderRoot","__decorate","customElement"],"mappings":"qRAoBe,IAAMA,EAAN,cAA6BC,EAAoBC,IAC9D,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBC,KAAMC,EAC5B,CAES,gBAAAC,GACR,OAAOF,IACR,GARkBN,EAAcS,EAAA,CADlCC,EAAc,yBACMV,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{LitElement as o}from"lit";import{customElement as r}from"lit/decorators.js";import{i as s}from"./light-dom-styles-DXsbiKU9.js";import{D as e}from"./DraftComponentMixin-4qug5Rky.js";import{s as i}from"./primitives-Dj0vyf1-.js";let a=class extends(e(o)){connectedCallback(){super.connectedCallback(),s(this,i)}createRenderRoot(){return this}};a=t([r("nord-pagination-previous")],a);var m=a;export{m as default};
|
|
2
|
+
//# sourceMappingURL=PaginationPrevious.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPrevious.js","sources":["../src/pagination/PaginationPrevious.ts"],"sourcesContent":["import { LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { injectLightDomStyles } from '../common/light-dom-styles.js'\nimport { DraftComponentMixin } from '../common/mixins/DraftComponentMixin.js'\nimport style from './primitives.css'\n\n/**\n * The \"previous page\" control in a composed [Pagination](/components/pagination/).\n * A layout wrapper around your own interactive element — provide an `<a>`\n * (e.g. a framework `<Link>`) or a `nord-button` with its own icon, label and\n * navigation, and disable it when there is no previous page.\n *\n * @status draft\n * @category navigation\n * @lightDom true\n *\n * @slot - Default slot for the previous-page link or button.\n */\n@customElement('nord-pagination-previous')\nexport default class PaginationPrevious extends DraftComponentMixin(LitElement) {\n connectedCallback() {\n super.connectedCallback()\n injectLightDomStyles(this, style)\n }\n\n protected createRenderRoot() {\n return this\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-pagination-previous': PaginationPrevious\n }\n}\n"],"names":["PaginationPrevious","DraftComponentMixin","LitElement","connectedCallback","super","injectLightDomStyles","this","style","createRenderRoot","__decorate","customElement"],"mappings":"qRAoBe,IAAMA,EAAN,cAAiCC,EAAoBC,IAClE,iBAAAC,GACEC,MAAMD,oBACNE,EAAqBC,KAAMC,EAC5B,CAES,gBAAAC,GACR,OAAOF,IACR,GARkBN,EAAkBS,EAAA,CADtCC,EAAc,6BACMV,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{o as e,a as o,s as i,h as s,l as n,f as a,c as r,b as l}from"./positioning-D-K8Mueq.js";import{css as h,html as p,LitElement as d}from"lit";import{property as c,query as m,state as u,customElement as f}from"lit/decorators.js";import{D as g}from"./DirectionController-ChvNGESZ.js";import{E as v}from"./EventController-BBOmvfLa.js";import{L as y}from"./LightDismissController-wcL1ziJa.js";import{S as b}from"./ScrollbarController-BFC67Y2x.js";import{o as w}from"./observe-D0n0zOfU.js";import{N as x,t as E}from"./events-Bv6wNHwJ.js";import{s as A}from"./Component-BJ5O5n8k.js";function k(e){class o extends e{constructor(){super(...arguments),this.open=!1,this.align="start",this.position="block-end",this.sideOffset=8,this.alignOffset=0}}return t([c({type:Boolean,reflect:!0})],o.prototype,"open",void 0),t([c({reflect:!0})],o.prototype,"align",void 0),t([c({reflect:!0})],o.prototype,"position",void 0),t([c({reflect:!0,type:Number,attribute:"side-offset"})],o.prototype,"sideOffset",void 0),t([c({reflect:!0,type:Number,attribute:"align-offset"})],o.prototype,"alignOffset",void 0),o}const C=h`:host{background:none;block-size:auto;border:none;color:var(--n-color-text);inline-size:auto;inset:auto;left:var(--_n-popout-position-x);margin:0;opacity:0;overflow:visible;padding:0;pointer-events:none;position:fixed;top:var(--_n-popout-position-y);transition:opacity var(--n-transition-slowly);z-index:var(--n-index-popout)}.n-popout{background:var(--n-popout-background,var(--n-color-surface));border-radius:var(--n-border-radius-s);box-shadow:var(--n-popout-box-shadow,var(--n-box-shadow-popout));pointer-events:none;transform:translateY(-10px) scale(.97);transform-origin:top left;transition:transform var(--n-transition-slowly),visibility var(--n-transition-slowly);visibility:hidden;will-change:transform,opacity,visibility}:host([open]){opacity:1}:host([open]) .n-popout{pointer-events:auto;transform:translateY(0) translateX(0) scale(1);transition-property:transform;visibility:visible}@media (max-width:35.9375em){:host(:not([always-floating])){background:#0000;inset:0;opacity:1;overflow-y:auto;position:fixed;transition:background var(--n-transition-mobile)}:host([open]:not([always-floating])){background:var(--n-color-overlay);pointer-events:auto}:host([open]:not([always-floating])) .n-popout{transform:translateY(0)}:host(:not([always-floating])) .n-popout{border-radius:0;inset:0;inset-block-start:auto;position:fixed;transform:translateY(100%);transform-origin:bottom center;transition:transform var(--n-transition-mobile),visibility var(--n-transition-mobile)}}.top-end,.top-start{transform:translateY(10px) scale(.97)}.left-end,.left-start{transform:translateX(10px) scale(.97)}.right-end,.right-start{transform:translateX(-10px) scale(.97)}.bottom-start.is-rtl,.left-end,.top-end{transform-origin:bottom right}.bottom-end,.left-start,.top-start.is-rtl{transform-origin:top right}.bottom-end.is-rtl,.right-end,.right-start{transform-origin:bottom left}.right-start,.top-end.is-rtl{transform-origin:top left}`,O="undefined"==typeof matchMedia?{matches:!1,addEventListener(){}}:matchMedia("(max-width: 35.9375em)");let P=class extends(k(d)){constructor(){super(...arguments),this.scrollBar=new b(this),this.dismiss=new y(this,{isOpen:()=>this.open,onDismiss:t=>this.hide("click"!==t.type),isDismissible:t=>t!==this.popout&&t!==this.targetElement}),this.events=new v(this),this.direction=new g(this),this.smallViewport=O.matches,this.id="",this.alwaysFloating=!1,this.controlled=!1,this.enableScroll=()=>{this.open||(this.scrollBar.unlockScroll(),this.leaveTopLayer())},this.updatePosition=async()=>{var t;if(!this.anchorElement)return;const l={strategy:"fixed"};"auto"===this.position?l.middleware=[e({mainAxis:this.sideOffset,alignmentAxis:this.alignOffset}),o({alignment:this.align,padding:8}),i({padding:8}),s()]:(l.placement=n(this.position,this.align,this.direction.dir),l.middleware=[e({mainAxis:this.sideOffset,alignmentAxis:this.alignOffset}),a(),i({padding:8}),s()]);const{x:h,y:p,placement:d,middlewareData:c}=await r(this.anchorElement,this,l);this.computedPosition=d,this.style.setProperty("--_n-popout-position-x",`${h}px`),this.style.setProperty("--_n-popout-position-y",`${p}px`),(null===(t=c.hide)||void 0===t?void 0:t.referenceHidden)&&this.hide()},this.toggleOpen=t=>{t.preventDefault(),this.open?this.hide(!1):!this.smallViewport||this.alwaysFloating?(this.enterTopLayer(),this.updatePosition().then((()=>this.show()))):this.show()},this.handleMediaQueryChange=()=>{var t;this.smallViewport=O.matches,null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),(!this.smallViewport||this.alwaysFloating)&&this.open&&this.anchorElement?(this.cleanupAutoUpdate=l(this.anchorElement,this,this.updatePosition),this.scrollBar.unlockScroll()):this.open&&this.scrollBar.lockScroll()}}async show(){return this.open?Promise.resolve():(this.enterTopLayer(),this.open=!0,await this.updateComplete,this.dispatchEvent(new x("open")),E(this.popout))}async hide(t=!0){var e,o;if(!this.open)return Promise.resolve();this.open=!1,null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.dispatchEvent(new x("close")),t&&(null===(o=this.targetElement)||void 0===o||o.focus({preventScroll:!0}));const i=await E(this.popout);return this.leaveTopLayer(),i}firstUpdated(){this.smallViewport&&!this.alwaysFloating||this.updatePosition()}connectedCallback(){super.connectedCallback(),this.events.listen(O,"change",this.handleMediaQueryChange),this.initializeElements()}disconnectedCallback(){var t,e;super.disconnectedCallback(),null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),null===(e=this.targetElement)||void 0===e||e.removeAttribute("aria-expanded")}render(){return p`<div class="n-popout ${this.computedPosition} is-${this.direction.dir}" aria-hidden="${this.open?"false":"true"}" @transitionend="${this.enableScroll}"><slot></slot></div>`}handleIdChange(){var t;null===(t=this.targetElement)||void 0===t||t.removeEventListener("click",this.toggleOpen),this.id?this.initializeElements():console.warn("NORD: popout requires an id attribute and value")}initializeElements(){this.targetElement=this.getToggle(),this.anchorElement=this.getAnchor(),this.controlled||this.events.listen(this.targetElement,"click",this.toggleOpen)}handleOpenChange(){var t,e;null===(t=this.targetElement)||void 0===t||t.setAttribute("aria-expanded",`${this.open}`),this.open?(this.enterTopLayer(),this.smallViewport&&!this.alwaysFloating?this.scrollBar.lockScroll():this.anchorElement&&(this.cleanupAutoUpdate=l(this.anchorElement,this,this.updatePosition))):null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this)}handleAnchorChange(){var t;null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),this.anchorElement=this.getAnchor(),this.open&&(!this.smallViewport||this.alwaysFloating)&&this.anchorElement&&(this.cleanupAutoUpdate=l(this.anchorElement,this,this.updatePosition))}enterTopLayer(){if("function"==typeof this.showPopover)try{this.setAttribute("popover","manual"),this.showPopover()}catch(t){this.removeAttribute("popover")}}leaveTopLayer(){this.removeAttribute("popover")}getToggle(){const t=this.getRootNode(),e=t.querySelectorAll(`[aria-controls='${this.id}']`);let o=e[0];if(e.length>1){const i=[...t.querySelectorAll(`[id='${this.id}']`)].indexOf(this);i>=0&&i<e.length&&(o=e[i])}return o instanceof HTMLSlotElement?o.assignedElements()[0]:o}getAnchor(){if(!this.anchor)return this.targetElement;const t=this.getRootNode().querySelector(`#${this.anchor}`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}};P.styles=[A,C],t([m(".n-popout",!0)],P.prototype,"popout",void 0),t([u()],P.prototype,"computedPosition",void 0),t([u()],P.prototype,"smallViewport",void 0),t([c({reflect:!0})],P.prototype,"id",void 0),t([c({reflect:!0})],P.prototype,"anchor",void 0),t([c({reflect:!0,type:Boolean,attribute:"always-floating"})],P.prototype,"alwaysFloating",void 0),t([c({reflect:!0,type:Boolean})],P.prototype,"controlled",void 0),t([w("id")],P.prototype,"handleIdChange",null),t([w("open")],P.prototype,"handleOpenChange",null),t([w("anchor")],P.prototype,"handleAnchorChange",null),P=t([f("nord-popout")],P);var S=P;export{k as F,S as P};
|
|
2
|
+
//# sourceMappingURL=Popout-CFtFoCaA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popout-CFtFoCaA.js","sources":["../src/common/mixins/FloatingComponentMixin.ts","../src/popout/Popout.ts"],"sourcesContent":["import type { Alignment } from '@floating-ui/dom'\nimport type { LitElement } from 'lit'\nimport type { LogicalSide } from '../positioning.js'\nimport { property } from 'lit/decorators.js'\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FloatingMixinInterface {\n open: boolean\n align: Alignment\n position: LogicalSide | 'auto'\n sideOffset: number\n alignOffset: number\n}\n\nexport function FloatingMixin<T extends Constructor<LitElement>>(\n superClass: T,\n): Constructor<FloatingMixinInterface> & T {\n class FloatingElement extends superClass {\n /**\n * Controls whether the component is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Set the alignment in relation to the toggle (or anchor) depending on the position.\n * `start` will align it to the left of the toggle (or anchor).\n * `end` will align it to the right of the toggle (or anchor).\n * Setting the `position` to `inline-start` or `inline-end` will switch\n * `start` and `end` to the top and bottom respectively.\n */\n @property({ reflect: true }) align: 'start' | 'end' = 'start'\n\n /**\n * Set the position in relation to the toggle (or anchor).\n * Options follow logical properties.\n * `block-start` and `block-end` referring to top and bottom respectively,\n * `inline-start` and `inline-end` referring to left and right respectively.\n * You can also set it to `auto` for automatic positioning depending on\n * which side has the most space available.\n */\n @property({ reflect: true }) position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end' | 'auto'\n = 'block-end'\n\n /**\n * Distance in pixels from the toggle (or anchor) along the main axis — the\n * gap between the floating element and the side it opens against. Fed into\n * Floating UI's `offset` middleware as `mainAxis`. Defaults to `8`.\n */\n @property({ reflect: true, type: Number, attribute: 'side-offset' }) sideOffset = 8\n\n /**\n * Offset in pixels along the alignment axis — slides the floating element\n * toward the `start` or `end` of the toggle (or anchor). Fed into Floating\n * UI's `offset` middleware as `alignmentAxis`. Defaults to `0`.\n */\n @property({ reflect: true, type: Number, attribute: 'align-offset' }) alignOffset = 0\n }\n\n return FloatingElement\n}\n","import type {\n ComputePositionConfig,\n Placement,\n} from '@floating-ui/dom'\nimport {\n autoPlacement,\n autoUpdate,\n computePosition,\n flip,\n hide,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport { html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { EventController } from '../common/controllers/EventController.js'\nimport { LightDismissController } from '../common/controllers/LightDismissController.js'\nimport { ScrollbarController } from '../common/controllers/ScrollbarController.js'\n\nimport { observe } from '../common/decorators/observe.js'\nimport { NordEvent, transition } from '../common/events.js'\nimport { FloatingMixin } from '../common/mixins/FloatingComponentMixin.js'\nimport { logicalToPhysical } from '../common/positioning.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Popout.css'\n\n/*\n * The breakpoint width to switch between \"sheet\" design and floating design\n */\nconst mediaQuery\n = typeof matchMedia === 'undefined'\n ? ({\n matches: false,\n addEventListener() {\n /* noop */\n },\n } as unknown as MediaQueryList)\n : matchMedia('(max-width: 35.9375em)')\n\n/**\n * Popouts are small overlays that open on demand. They let users access additional content and actions without cluttering the page.\n *\n * @status ready\n * @category overlay\n * @slot - The popout content.\n *\n * @cssprop [--n-popout-background=var(--n-color-surface)] - Background of the popout container. Set to `transparent` to suppress the popout's own surface (e.g. when a slotted element paints its own background).\n * @cssprop [--n-popout-box-shadow=var(--n-box-shadow-popout)] - Box-shadow of the popout container. Set to `none` to suppress the popout's own shadow.\n */\n@customElement('nord-popout')\nexport default class Popout extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private targetElement?: HTMLElement\n private anchorElement?: HTMLElement\n private cleanupAutoUpdate?: ReturnType<typeof autoUpdate>\n\n @query('.n-popout', true) private popout!: HTMLDivElement\n\n private scrollBar = new ScrollbarController(this)\n\n /**\n * Handle dismissal of the popout, clicking outside the target button and popout.\n */\n private dismiss = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== 'click'),\n isDismissible: node => node !== this.popout && node !== this.targetElement,\n })\n\n private events = new EventController(this)\n private direction = new DirectionController(this)\n\n @state() private computedPosition?: Placement\n\n @state() private smallViewport = mediaQuery.matches\n\n /**\n * The id for the active element to reference via aria-controls.\n */\n\n @property({ reflect: true }) id: string = ''\n\n /**\n * Set an optional anchor element to align against, replacing the triggering element.\n */\n @property({ reflect: true }) anchor?: string\n\n /**\n * Set to true to always display the popout as a floating overlay, even on smaller viewports.\n */\n @property({ reflect: true, type: Boolean, attribute: 'always-floating' }) alwaysFloating: boolean = false\n\n /**\n * Set to true when the consuming component owns the `open` state and drives\n * the popout itself (e.g. via its own trigger `@click` and `show()`/`hide()`).\n * The popout stays presentational — positioning, top layer, light dismiss and\n * transitions all still work — but it does NOT attach its own click-to-toggle\n * listener to the `aria-controls` trigger, avoiding a competing second toggle\n * on the same click.\n */\n @property({ reflect: true, type: Boolean }) controlled: boolean = false\n\n /**\n * Show the popout.\n * A promise that resolves to a `TransitionEvent` when the popout's show animation ends or is cancelled.\n * If the popout is already open, the promise resolves immediately with `undefined`.\n */\n async show(): Promise<TransitionEvent | void> {\n if (this.open) {\n return Promise.resolve()\n }\n\n this.enterTopLayer()\n this.open = true\n\n // we should only focus once the popout is visible after render is complete\n await this.updateComplete\n\n /**\n * Dispatched when the popout is opened.\n */\n this.dispatchEvent(new NordEvent('open'))\n\n return transition(this.popout)\n }\n\n /**\n * Hide the popout.\n * Returns a promise that resolves to a `TransitionEvent` when the popout's hide animation ends or is cancelled.\n * If the popout is already closed, the promise resolves immediately with `undefined`.\n * @param {boolean} moveFocusToButton prevent focus returning to the target button. Default is true.\n */\n async hide(moveFocusToButton: boolean = true): Promise<TransitionEvent | void> {\n if (!this.open) {\n return Promise.resolve()\n }\n\n this.open = false\n\n this.cleanupAutoUpdate?.()\n\n /**\n * Dispatched when the popout is closed.\n */\n this.dispatchEvent(new NordEvent('close'))\n\n if (moveFocusToButton) {\n this.targetElement?.focus({ preventScroll: true })\n }\n\n const result = await transition(this.popout)\n this.leaveTopLayer()\n return result\n }\n\n /**\n * Position the popout on load.\n */\n firstUpdated() {\n if (!this.smallViewport || this.alwaysFloating) {\n this.updatePosition()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.events.listen(mediaQuery, 'change', this.handleMediaQueryChange)\n\n this.initializeElements()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.cleanupAutoUpdate?.()\n this.targetElement?.removeAttribute('aria-expanded')\n }\n\n render() {\n return html`\n <div\n class=\"n-popout ${this.computedPosition} is-${this.direction.dir}\"\n aria-hidden=${this.open ? 'false' : 'true'}\n @transitionend=${this.enableScroll}\n >\n <slot></slot>\n </div>\n `\n }\n\n @observe('id')\n protected handleIdChange() {\n // clean up any old listeners\n this.targetElement?.removeEventListener('click', this.toggleOpen)\n\n if (!this.id) {\n console.warn('NORD: popout requires an id attribute and value')\n }\n else {\n this.initializeElements()\n }\n }\n\n private initializeElements() {\n this.targetElement = this.getToggle()\n this.anchorElement = this.getAnchor()\n\n // In controlled mode the consuming component owns the toggle, so the popout\n // resolves its trigger (for positioning, aria-expanded and light dismiss) but\n // does not attach its own click-to-toggle listener.\n if (!this.controlled) {\n this.events.listen(this.targetElement, 'click', this.toggleOpen)\n }\n }\n\n @observe('open')\n protected handleOpenChange() {\n this.targetElement?.setAttribute('aria-expanded', `${this.open}`)\n\n if (this.open) {\n this.enterTopLayer()\n\n if (this.smallViewport && !this.alwaysFloating) {\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n }\n else if (this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n else {\n this.cleanupAutoUpdate?.()\n }\n }\n\n @observe('anchor')\n protected handleAnchorChange() {\n this.cleanupAutoUpdate?.()\n this.anchorElement = this.getAnchor()\n\n // if the popout is already open when the anchor changes, we should update its position\n if (this.open && (!this.smallViewport || this.alwaysFloating) && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n\n private enableScroll = () => {\n // scrollbar should only be restored when the backdrop has transitioned\n // that way we avoid awkward double scrollbars.\n if (!this.open) {\n this.scrollBar.unlockScroll()\n this.leaveTopLayer()\n }\n }\n\n /**\n * Place the element in the top layer via the Popover API so that\n * position: fixed works relative to the viewport regardless of\n * container queries or other containing block ancestors.\n */\n private enterTopLayer() {\n if (typeof this.showPopover !== 'function')\n return\n\n try {\n this.setAttribute('popover', 'manual')\n this.showPopover()\n }\n catch {\n this.removeAttribute('popover')\n }\n }\n\n private leaveTopLayer() {\n this.removeAttribute('popover')\n }\n\n /**\n * Get the position of the element toggling the popout\n * and position the popout underneath it, taking into account the optional placement.\n */\n private updatePosition = async () => {\n if (!this.anchorElement) {\n return\n }\n\n const computePositionConfig: ComputePositionConfig = {\n strategy: 'fixed',\n }\n\n if (this.position === 'auto') {\n computePositionConfig.middleware = [\n offset({ mainAxis: this.sideOffset, alignmentAxis: this.alignOffset }),\n autoPlacement({ alignment: this.align, padding: 8 }),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n else {\n computePositionConfig.placement = logicalToPhysical(this.position, this.align, this.direction.dir)\n computePositionConfig.middleware = [\n offset({ mainAxis: this.sideOffset, alignmentAxis: this.alignOffset }),\n flip(),\n shift({\n padding: 8,\n }),\n hide(),\n ]\n }\n\n const { x, y, placement, middlewareData } = await computePosition(this.anchorElement, this, computePositionConfig)\n\n this.computedPosition = placement\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.setProperty('--_n-popout-position-x', `${x}px`)\n this.style.setProperty('--_n-popout-position-y', `${y}px`)\n\n if (middlewareData.hide?.referenceHidden) {\n this.hide()\n }\n }\n\n /**\n * Toggle the popout open or closed using state.\n * Updating the position to underneath the target button before the popout is opened.\n */\n private toggleOpen = (e: Event) => {\n e.preventDefault()\n if (this.open) {\n this.hide(false)\n }\n else if (!this.smallViewport || this.alwaysFloating) {\n this.enterTopLayer()\n this.updatePosition().then(() => this.show())\n }\n else {\n this.show()\n }\n }\n\n private getToggle() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const allToggles = rootNode.querySelectorAll<HTMLElement>(`[aria-controls='${this.id}']`)\n\n let toggle = allToggles[0]\n\n // When multiple toggles share the same aria-controls (duplicate IDs on page),\n // pair each toggle with its corresponding popout by document order.\n if (allToggles.length > 1) {\n const index = [...rootNode.querySelectorAll<HTMLElement>(`[id='${this.id}']`)].indexOf(this)\n if (index >= 0 && index < allToggles.length) {\n toggle = allToggles[index]\n }\n }\n\n if (toggle instanceof HTMLSlotElement) {\n return toggle.assignedElements()[0] as HTMLElement\n }\n\n return toggle\n }\n\n private getAnchor() {\n if (!this.anchor) {\n return this.targetElement\n }\n\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const anchor = <HTMLElement>rootNode.querySelector(`#${this.anchor}`)\n\n if (anchor instanceof HTMLSlotElement) {\n return anchor.assignedElements()[0] as HTMLElement\n }\n\n return anchor\n }\n\n /**\n * Update the smallViewport flag to switch between \"sheet\" and \"floating\".\n * autoUpdate is needed when a viewport gets larger and the popout is open.\n */\n private handleMediaQueryChange = () => {\n this.smallViewport = mediaQuery.matches\n\n this.cleanupAutoUpdate?.()\n\n if ((!this.smallViewport || this.alwaysFloating) && this.open && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n this.scrollBar.unlockScroll()\n }\n else if (this.open) {\n this.scrollBar.lockScroll()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-popout': Popout\n }\n}\n"],"names":["FloatingMixin","superClass","FloatingElement","constructor","this","open","align","position","sideOffset","alignOffset","__decorate","property","type","Boolean","reflect","prototype","Number","attribute","mediaQuery","matchMedia","matches","addEventListener","Popout","LitElement","scrollBar","ScrollbarController","dismiss","LightDismissController","isOpen","onDismiss","e","hide","isDismissible","node","popout","targetElement","events","EventController","direction","DirectionController","smallViewport","id","alwaysFloating","controlled","enableScroll","unlockScroll","leaveTopLayer","updatePosition","async","anchorElement","computePositionConfig","strategy","middleware","offset","mainAxis","alignmentAxis","autoPlacement","alignment","padding","shift","placement","logicalToPhysical","dir","flip","x","y","middlewareData","computePosition","computedPosition","style","setProperty","_a","referenceHidden","toggleOpen","preventDefault","enterTopLayer","then","show","handleMediaQueryChange","cleanupAutoUpdate","call","autoUpdate","lockScroll","Promise","resolve","updateComplete","dispatchEvent","NordEvent","transition","moveFocusToButton","_b","focus","preventScroll","result","firstUpdated","connectedCallback","super","listen","initializeElements","disconnectedCallback","removeAttribute","render","html","handleIdChange","removeEventListener","console","warn","getToggle","getAnchor","handleOpenChange","setAttribute","handleAnchorChange","showPopover","rootNode","getRootNode","allToggles","querySelectorAll","toggle","length","index","indexOf","HTMLSlotElement","assignedElements","anchor","querySelector","styles","componentStyle","query","state","observe","customElement"],"mappings":"knBAeM,SAAUA,EACdC,GAEA,MAAMC,UAAwBD,EAA9B,WAAAE,uBAI8CC,KAAIC,MAAG,EAStBD,KAAKE,MAAoB,QAUzBF,KAAQG,SACjC,YAOiEH,KAAUI,WAAG,EAOZJ,KAAWK,YAAG,CACrF,EAED,OArC8CC,EAAA,CAA3CC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KAAoBZ,EAAAa,UAAA,YAAA,GAS3BL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAwCZ,EAAAa,UAAA,aAAA,GAUhCL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KACNZ,EAAAa,UAAA,gBAAA,GAOsDL,EAAA,CAApEC,EAAS,CAAEG,SAAS,EAAMF,KAAMI,OAAQC,UAAW,iBAA+Bf,EAAAa,UAAA,kBAAA,GAObL,EAAA,CAArEC,EAAS,CAAEG,SAAS,EAAMF,KAAMI,OAAQC,UAAW,kBAAiCf,EAAAa,UAAA,mBAAA,GAGhFb,CACT,o5DC9BMgB,EACoB,oBAAfC,WACJ,CACCC,SAAS,EACT,gBAAAC,GAEC,GAEHF,WAAW,0BAaF,IAAMG,EAAN,cAAqBtB,EAAcuB,IAAnC,WAAApB,uBASLC,KAAAoB,UAAY,IAAIC,EAAoBrB,MAKpCA,KAAAsB,QAA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qBAAoDK,EAAAP,UAAA,sBAAA,GAU7DL,EAAA,CAA3CC,EAAS,CAAEG,SAAS,EAAMF,KAAMC,WAAsCS,EAAAP,UAAA,kBAAA,GA4F7DL,EAAA,CADTuH,EAAQ,OAWR3G,EAAAP,UAAA,iBAAA,MAeSL,EAAA,CADTuH,EAAQ,SAkBR3G,EAAAP,UAAA,mBAAA,MAGSL,EAAA,CADTuH,EAAQ,WASR3G,EAAAP,UAAA,qBAAA,MApMkBO,EAAMZ,EAAA,CAD1BwH,EAAc,gBACM5G,SAAAA"}
|
package/lib/Popout.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./tslib.es6-CmLYFWVC.js";import"./positioning-D-K8Mueq.js";import"lit";import"lit/decorators.js";import"./DirectionController-ChvNGESZ.js";import"./EventController-BBOmvfLa.js";import"./LightDismissController-
|
|
1
|
+
import"./tslib.es6-CmLYFWVC.js";import"./positioning-D-K8Mueq.js";import"lit";import"lit/decorators.js";import"./DirectionController-ChvNGESZ.js";import"./EventController-BBOmvfLa.js";import"./LightDismissController-wcL1ziJa.js";import"./ScrollbarController-BFC67Y2x.js";import"./observe-D0n0zOfU.js";import"./events-Bv6wNHwJ.js";export{P as default}from"./Popout-CFtFoCaA.js";import"./Component-BJ5O5n8k.js";import"./ShortcutController-CV5b0BZl.js";import"./tinykeys-DwvDXsEb.js";
|
|
2
2
|
//# sourceMappingURL=Popout.js.map
|
package/lib/Progress.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as s}from"./tslib.es6-CmLYFWVC.js";import{css as r,LitElement as o,html as t,svg as e}from"lit";import{property as i,state as n,customElement as a}from"lit/decorators.js";import{ifDefined as l}from"lit/directives/if-defined.js";import{c}from"./cond-CI1KbneT.js";import{s as h}from"./Component-
|
|
1
|
+
import{_ as s}from"./tslib.es6-CmLYFWVC.js";import{css as r,LitElement as o,html as t,svg as e}from"lit";import{property as i,state as n,customElement as a}from"lit/decorators.js";import{ifDefined as l}from"lit/directives/if-defined.js";import{c}from"./cond-CI1KbneT.js";import{s as h}from"./Component-BJ5O5n8k.js";const g=r`:host{--_n-progress-color:var(--n-progress-color,var(--n-color-accent));--_n-progress-size:var(--n-size-icon-m);--_n-progress-background:var(--n-color-background);block-size:var(--_n-progress-size);display:inline-flex;inline-size:var(--_n-progress-size);position:relative}:host([size=xs]){--_n-progress-size:var(--n-size-icon-xs)}:host([size=s]){--_n-progress-size:var(--n-size-icon-s)}:host([size=l]){--_n-progress-size:var(--n-size-icon-l)}:host([size=xl]){--_n-progress-size:var(--n-size-icon-xl)}:host([size=xxl]){--_n-progress-size:var(--n-size-icon-xxl)}:host([color=success]){--_n-progress-color:var(--n-color-status-success)}:host([color=warning]){--_n-progress-color:var(--n-color-status-warning)}:host([color=danger]){--_n-progress-color:var(--n-color-status-danger)}:host([color=highlight]){--_n-progress-color:var(--n-color-status-highlight)}:host([color=info]){--_n-progress-color:var(--n-color-status-info)}:host svg{block-size:100%;inline-size:100%}`,d=11.25,p=11.25;let m=0;let _=class extends o{constructor(){super(),this.size="m",this.progress=0,this._animatedProgress=0,this._animationId=null,this._targetProgress=0,this._instanceId=0,this._instanceId=m++}connectedCallback(){super.connectedCallback(),this._animatedProgress=this.progress,this._targetProgress=this.progress}disconnectedCallback(){super.disconnectedCallback(),null!==this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null)}updated(s){s.has("progress")&&(this._targetProgress=Math.max(0,Math.min(100,this.progress)),this._animate())}_animate(){null!==this._animationId&&cancelAnimationFrame(this._animationId);const s=()=>{const r=this._targetProgress-this._animatedProgress;if(Math.abs(r)<.5)return this._animatedProgress=this._targetProgress,void(this._animationId=null);this._animatedProgress+=.15*r,this._animationId=requestAnimationFrame(s)};this._animationId=requestAnimationFrame(s)}get _clampedProgress(){return Math.max(0,Math.min(100,this._animatedProgress))}get _isSemanticColor(){var s;return["success","warning","danger","highlight","info"].includes(null!==(s=this.color)&&void 0!==s?s:"")}get _customColorStyle(){if(this.color&&!this._isSemanticColor)return`--_n-progress-color:${this.color}`}render(){const s=Boolean(this.label),r=function(s){const r=Math.max(0,Math.min(100,s));if(0===r)return"";if(100===r)return"M11.25,5.25\n A6,6 0 1 1 11.25,17.25\n A6,6 0 1 1 11.25,5.25 Z";const o=r/100*360,t=(-90+o)*(Math.PI/180);return`M11.25,11.25\n L11.25,5.25\n A6,6 0 ${o>180?1:0},1 ${d+6*Math.cos(t)},${p+6*Math.sin(t)}\n Z`}(this._clampedProgress),o=`n-progress-clip-${this._instanceId}`;return t`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22.5 22.5" fill="none" role="${c(s,"progressbar")}" aria-label="${l(this.label)}" aria-valuenow="${c(s,Math.round(this._clampedProgress))}" aria-valuemin="${c(s,"0")}" aria-valuemax="${c(s,"100")}" aria-hidden="${c(!s,"true")}" style="${l(this._customColorStyle)}"><g clip-path="url(#${o})"><rect x="1.25" y="1.25" width="20" height="20" rx="10" fill="var(--_n-progress-background)"/><circle cx="${d}" cy="${p}" r="${9}" fill="var(--_n-progress-background)" stroke="var(--_n-progress-color)" stroke-width="2"/>${e`<path fill="var(--_n-progress-color)" d="${r}">`}</g><rect x="0.625" y="0.625" width="21.25" height="21.25" rx="10.625" stroke="var(--_n-progress-background)" stroke-width="1.25"/><defs><clipPath id="${o}"><rect x="1.25" y="1.25" width="20" height="20" rx="10" fill="white"/></clipPath></defs></svg>`}};_.styles=[h,g],s([i({reflect:!0})],_.prototype,"size",void 0),s([i({reflect:!0})],_.prototype,"color",void 0),s([i({reflect:!0})],_.prototype,"label",void 0),s([i({reflect:!0,type:Number})],_.prototype,"progress",void 0),s([n()],_.prototype,"_animatedProgress",void 0),_=s([a("nord-progress")],_);var u=_;export{u as default};
|
|
2
2
|
//# sourceMappingURL=Progress.js.map
|
package/lib/Progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../src/progress/Progress.ts"],"sourcesContent":["import { html, LitElement, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Progress.css'\n\nconst CX = 11.25\nconst CY = 11.25\nconst OUTER_RADIUS = 9\nconst INNER_RADIUS = 6\n\nlet instanceCounter = 0\n\n/**\n * Generates an SVG path for a pie sector starting from 12 o'clock, sweeping clockwise.\n * @param percent - The progress percentage (0-100)\n * @returns The SVG path data string\n */\nfunction sectorPath(percent: number): string {\n const p = Math.max(0, Math.min(100, percent))\n if (p === 0)\n return ''\n if (p === 100) {\n return `M${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY + INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY - INNER_RADIUS} Z`\n }\n const sweep = (p / 100) * 360\n const theta = (-90 + sweep) * (Math.PI / 180)\n const ex = CX + INNER_RADIUS * Math.cos(theta)\n const ey = CY + INNER_RADIUS * Math.sin(theta)\n const large = sweep > 180 ? 1 : 0\n return `M${CX},${CY}\n L${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 ${large},1 ${ex},${ey}\n Z`\n}\n\n/**\n * Progress component is used to display a circular pie-chart style progress indicator.\n * You can customize the size and color of the progress indicator with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress indicator.\n */\n@customElement('nord-progress')\nexport default class Progress extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the progress indicator.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the progress indicator.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-progress-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the progress indicator.\n * If no label is supplied, the component is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n /**\n * The progress percentage value.\n */\n @property({ reflect: true, type: Number }) progress: number = 0\n\n /**\n * Internal state for the animated progress value.\n */\n @state() private _animatedProgress: number = 0\n\n /**\n * Animation frame ID for cleanup.\n */\n private _animationId: number | null = null\n\n /**\n * Target progress for animation.\n */\n private _targetProgress: number = 0\n\n /**\n * Unique ID for this component instance, used for SVG clipPath.\n */\n private _instanceId: number = 0\n\n constructor() {\n super()\n this._instanceId = instanceCounter++\n }\n\n connectedCallback() {\n super.connectedCallback()\n this._animatedProgress = this.progress\n this._targetProgress = this.progress\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n this._animationId = null\n }\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('progress')) {\n this._targetProgress = Math.max(0, Math.min(100, this.progress))\n this._animate()\n }\n }\n\n private _animate() {\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n }\n\n const animate = () => {\n const diff = this._targetProgress - this._animatedProgress\n if (Math.abs(diff) < 0.5) {\n this._animatedProgress = this._targetProgress\n this._animationId = null\n return\n }\n // Ease towards target with smooth interpolation\n this._animatedProgress += diff * 0.15\n this._animationId = requestAnimationFrame(animate)\n }\n\n this._animationId = requestAnimationFrame(animate)\n }\n\n private get _clampedProgress(): number {\n return Math.max(0, Math.min(100, this._animatedProgress))\n }\n\n /**\n * Check if the color is a semantic value handled by CSS.\n */\n private get _isSemanticColor(): boolean {\n return ['success', 'warning', 'danger', 'highlight', 'info'].includes(this.color ?? '')\n }\n\n /**\n * Get the custom color style if not a semantic value.\n */\n private get _customColorStyle(): string | undefined {\n if (this.color && !this._isSemanticColor) {\n return `--_n-progress-color:${this.color}`\n }\n return undefined\n }\n\n render() {\n const hasLabel = Boolean(this.label)\n const pathData = sectorPath(this._clampedProgress)\n const clipId = `n-progress-clip-${this._instanceId}`\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.5 22.5\"\n fill=\"none\"\n role=${cond(hasLabel, 'progressbar')}\n aria-label=${ifDefined(this.label)}\n aria-valuenow=${cond(hasLabel, Math.round(this._clampedProgress))}\n aria-valuemin=${cond(hasLabel, '0')}\n aria-valuemax=${cond(hasLabel, '100')}\n aria-hidden=${cond(!hasLabel, 'true')}\n style=${ifDefined(this._customColorStyle)}\n >\n <g clip-path=\"url(#${clipId})\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"var(--_n-progress-background)\" />\n <circle\n cx=\"${CX}\"\n cy=\"${CY}\"\n r=\"${OUTER_RADIUS}\"\n fill=\"var(--_n-progress-background)\"\n stroke=\"var(--_n-progress-color)\"\n stroke-width=\"2\"\n />\n ${svg`<path fill=\"var(--_n-progress-color)\" d=\"${pathData}\" />`}\n </g>\n <rect\n x=\"0.625\"\n y=\"0.625\"\n width=\"21.25\"\n height=\"21.25\"\n rx=\"10.625\"\n stroke=\"var(--_n-progress-background)\"\n stroke-width=\"1.25\"\n />\n <defs>\n <clipPath id=\"${clipId}\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress': Progress\n }\n}\n"],"names":["CX","CY","instanceCounter","Progress","LitElement","constructor","super","this","size","progress","_animatedProgress","_animationId","_targetProgress","_instanceId","connectedCallback","disconnectedCallback","cancelAnimationFrame","updated","changedProperties","has","Math","max","min","_animate","animate","diff","abs","requestAnimationFrame","_clampedProgress","_isSemanticColor","includes","_a","color","_customColorStyle","render","hasLabel","Boolean","label","pathData","percent","p","sweep","theta","PI","cos","sin","sectorPath","clipId","html","cond","ifDefined","round","svg","styles","componentStyle","style","__decorate","property","reflect","prototype","type","Number","state","customElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../src/progress/Progress.ts"],"sourcesContent":["import { html, LitElement, svg } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { cond } from '../common/directives/cond.js'\nimport componentStyle from '../common/styles/Component.css'\nimport style from './Progress.css'\n\nconst CX = 11.25\nconst CY = 11.25\nconst OUTER_RADIUS = 9\nconst INNER_RADIUS = 6\n\nlet instanceCounter = 0\n\n/**\n * Generates an SVG path for a pie sector starting from 12 o'clock, sweeping clockwise.\n * @param percent - The progress percentage (0-100)\n * @returns The SVG path data string\n */\nfunction sectorPath(percent: number): string {\n const p = Math.max(0, Math.min(100, percent))\n if (p === 0)\n return ''\n if (p === 100) {\n return `M${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY + INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 1 1 ${CX},${CY - INNER_RADIUS} Z`\n }\n const sweep = (p / 100) * 360\n const theta = (-90 + sweep) * (Math.PI / 180)\n const ex = CX + INNER_RADIUS * Math.cos(theta)\n const ey = CY + INNER_RADIUS * Math.sin(theta)\n const large = sweep > 180 ? 1 : 0\n return `M${CX},${CY}\n L${CX},${CY - INNER_RADIUS}\n A${INNER_RADIUS},${INNER_RADIUS} 0 ${large},1 ${ex},${ey}\n Z`\n}\n\n/**\n * Progress component is used to display a circular pie-chart style progress indicator.\n * You can customize the size and color of the progress indicator with the\n * provided properties.\n *\n * @status ready\n * @category feedback\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress indicator.\n */\n@customElement('nord-progress')\nexport default class Progress extends LitElement {\n static styles = [componentStyle, style]\n\n /**\n * The size of the progress indicator.\n */\n @property({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' = 'm'\n\n /**\n * The color of the progress indicator.\n * Can accept any valid CSS color value, including custom properties.\n * Takes precedence over the `--n-progress-color` CSS custom property.\n */\n @property({ reflect: true }) color?: string\n\n /**\n * An accessible label for the progress indicator.\n * If no label is supplied, the component is hidden from assistive technology.\n */\n @property({ reflect: true }) label?: string\n\n /**\n * The progress percentage value.\n */\n @property({ reflect: true, type: Number }) progress: number = 0\n\n /**\n * Internal state for the animated progress value.\n */\n @state() private _animatedProgress: number = 0\n\n /**\n * Animation frame ID for cleanup.\n */\n private _animationId: number | null = null\n\n /**\n * Target progress for animation.\n */\n private _targetProgress: number = 0\n\n /**\n * Unique ID for this component instance, used for SVG clipPath.\n */\n private _instanceId: number = 0\n\n constructor() {\n super()\n this._instanceId = instanceCounter++\n }\n\n connectedCallback() {\n super.connectedCallback()\n this._animatedProgress = this.progress\n this._targetProgress = this.progress\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n this._animationId = null\n }\n }\n\n updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('progress')) {\n this._targetProgress = Math.max(0, Math.min(100, this.progress))\n this._animate()\n }\n }\n\n private _animate() {\n if (this._animationId !== null) {\n cancelAnimationFrame(this._animationId)\n }\n\n const animate = () => {\n const diff = this._targetProgress - this._animatedProgress\n if (Math.abs(diff) < 0.5) {\n this._animatedProgress = this._targetProgress\n this._animationId = null\n return\n }\n // Ease towards target with smooth interpolation\n this._animatedProgress += diff * 0.15\n this._animationId = requestAnimationFrame(animate)\n }\n\n this._animationId = requestAnimationFrame(animate)\n }\n\n private get _clampedProgress(): number {\n return Math.max(0, Math.min(100, this._animatedProgress))\n }\n\n /**\n * Check if the color is a semantic value handled by CSS.\n */\n private get _isSemanticColor(): boolean {\n return ['success', 'warning', 'danger', 'highlight', 'info'].includes(this.color ?? '')\n }\n\n /**\n * Get the custom color style if not a semantic value.\n */\n private get _customColorStyle(): string | undefined {\n if (this.color && !this._isSemanticColor) {\n return `--_n-progress-color:${this.color}`\n }\n return undefined\n }\n\n render() {\n const hasLabel = Boolean(this.label)\n const pathData = sectorPath(this._clampedProgress)\n const clipId = `n-progress-clip-${this._instanceId}`\n\n return html`\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.5 22.5\"\n fill=\"none\"\n role=${cond(hasLabel, 'progressbar')}\n aria-label=${ifDefined(this.label)}\n aria-valuenow=${cond(hasLabel, Math.round(this._clampedProgress))}\n aria-valuemin=${cond(hasLabel, '0')}\n aria-valuemax=${cond(hasLabel, '100')}\n aria-hidden=${cond(!hasLabel, 'true')}\n style=${ifDefined(this._customColorStyle)}\n >\n <g clip-path=\"url(#${clipId})\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"var(--_n-progress-background)\" />\n <circle\n cx=\"${CX}\"\n cy=\"${CY}\"\n r=\"${OUTER_RADIUS}\"\n fill=\"var(--_n-progress-background)\"\n stroke=\"var(--_n-progress-color)\"\n stroke-width=\"2\"\n />\n ${svg`<path fill=\"var(--_n-progress-color)\" d=\"${pathData}\" />`}\n </g>\n <rect\n x=\"0.625\"\n y=\"0.625\"\n width=\"21.25\"\n height=\"21.25\"\n rx=\"10.625\"\n stroke=\"var(--_n-progress-background)\"\n stroke-width=\"1.25\"\n />\n <defs>\n <clipPath id=\"${clipId}\">\n <rect x=\"1.25\" y=\"1.25\" width=\"20\" height=\"20\" rx=\"10\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress': Progress\n }\n}\n"],"names":["CX","CY","instanceCounter","Progress","LitElement","constructor","super","this","size","progress","_animatedProgress","_animationId","_targetProgress","_instanceId","connectedCallback","disconnectedCallback","cancelAnimationFrame","updated","changedProperties","has","Math","max","min","_animate","animate","diff","abs","requestAnimationFrame","_clampedProgress","_isSemanticColor","includes","_a","color","_customColorStyle","render","hasLabel","Boolean","label","pathData","percent","p","sweep","theta","PI","cos","sin","sectorPath","clipId","html","cond","ifDefined","round","svg","styles","componentStyle","style","__decorate","property","reflect","prototype","type","Number","state","customElement"],"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
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as r}from"./tslib.es6-CmLYFWVC.js";import{css as e,html as o,LitElement as s}from"lit";import{property as a,customElement as
|
|
1
|
+
import{_ as r}from"./tslib.es6-CmLYFWVC.js";import{css as e,html as o,LitElement as s}from"lit";import{property as a,customElement as i}from"lit/decorators.js";import{ifDefined as n}from"lit/directives/if-defined.js";import{ref as t}from"lit/directives/ref.js";import{F as d}from"./FocusableMixin-BlQLNPdJ.js";import{s as l}from"./Component-BJ5O5n8k.js";const p=e`:host{--_n-progress-size:var(--n-progress-size,var(--n-space-s));--_n-progress-border-radius:var(--n-progress-border-radius,var(--n-border-radius-s));--_n-progress-color:var(--n-progress-color,var(--n-color-accent));inline-size:100%}progress{appearance:none;background-color:var(--n-color-surface-lowered);block-size:var(--_n-progress-size);border:0;border-radius:var(--_n-progress-border-radius);box-shadow:none;inline-size:100%;margin:0}label,progress{display:block}progress::-webkit-progress-bar{background-color:initial;border-radius:var(--_n-progress-border-radius)}progress::-moz-progress-bar{background:var(--_n-progress-color);border-radius:var(--_n-progress-border-radius)}progress::-webkit-progress-value{background:var(--_n-progress-color);border-radius:var(--_n-progress-border-radius);transition:width .25s ease-out,background .25s ease-out}progress:indeterminate{animation:animate-indeterminate 2s ease infinite;background-color:var(--n-color-nav-hover);background-image:linear-gradient(to right,#0000 45%,var(--n-color-accent) 0,var(--n-color-accent) 55%,#0000 0);background-position:100%;background-size:225% 100%}progress:indeterminate::-moz-progress-bar{background-color:initial}progress:indeterminate::-webkit-progress-value{background-color:initial}@keyframes animate-indeterminate{50%{background-position:0}}progress:focus{box-shadow:0 0 0 1px var(--n-color-background),0 0 0 3px var(--n-color-accent);outline:none}`;let c=class extends(d(s)){constructor(){super(...arguments),this.max=100,this.label="Current progress"}render(){return o`<label><nord-visually-hidden>${this.label}</nord-visually-hidden><progress ${t(this.focusableRef)} aria-valuenow="${n(this.value)}" aria-valuemin="0" aria-valuemax="${this.max}" tabindex="-1" max="${this.max}" value="${n(this.value)}"></progress></label>`}};c.styles=[l,p],r([a({reflect:!0,type:Number})],c.prototype,"value",void 0),r([a({reflect:!0,type:Number})],c.prototype,"max",void 0),r([a({reflect:!0})],c.prototype,"label",void 0),c=r([i("nord-progress-bar")],c);var u=c;export{u as default};
|
|
2
2
|
//# sourceMappingURL=ProgressBar.js.map
|
package/lib/ProgressBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../src/progress-bar/ProgressBar.ts"],"sourcesContent":["import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ProgressBar.css'\n\n/**\n * Progress Bar is used to visually represent the completion\n * of a task or process. It shows how much of the task has\n * been completed and how much is still left.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-progress-size=var(--n-space-s)] - Controls the thickness of the progress bar, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-progress-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress bar, using [color tokens](/tokens/#color).\n */\n@customElement('nord-progress-bar')\nexport default class ProgressBar extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * Specifies how much of the task has been completed. Must be a valid floating\n * point number between 0 and max, or between 0 and 100 if max is omitted. If\n * there is no value, the progress bar is indeterminate; this indicates that\n * an activity is ongoing with no indication of how long it’s expected to take.\n */\n @property({ reflect: true, type: Number }) value?: number\n\n /**\n * Describes how much work the task indicated by the progress element requires.\n * The max attribute, if present, must have a value greater than 0 and be a\n * valid floating point number.\n */\n @property({ reflect: true, type: Number }) max: number = 100\n\n /**\n * Accessible label for the progress indicator. Visually hidden, but shown\n * for assistive technology.\n */\n @property({ reflect: true }) label: string = 'Current progress'\n\n render() {\n /**\n * The Aria properties are required for now due to a Chrome bug.\n * In the future we can probably get rid of them. For context:\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1310779\n */\n return html`<label>\n <nord-visually-hidden>${this.label}</nord-visually-hidden>\n <progress\n ${ref(this.focusableRef)}\n aria-valuenow=${ifDefined(this.value)}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n tabindex=\"-1\"\n max=${this.max}\n value=${ifDefined(this.value)}\n ></progress>\n </label>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress-bar': ProgressBar\n }\n}\n"],"names":["ProgressBar","FocusableMixin","LitElement","constructor","this","max","label","render","html","ref","focusableRef","ifDefined","value","styles","componentStyle","style","__decorate","property","reflect","type","Number","prototype","customElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../src/progress-bar/ProgressBar.ts"],"sourcesContent":["import { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { ref } from 'lit/directives/ref.js'\nimport { FocusableMixin } from '../common/mixins/FocusableMixin.js'\n\nimport componentStyle from '../common/styles/Component.css'\nimport style from './ProgressBar.css'\n\n/**\n * Progress Bar is used to visually represent the completion\n * of a task or process. It shows how much of the task has\n * been completed and how much is still left.\n *\n * @status ready\n * @category feedback\n *\n * @cssprop [--n-progress-size=var(--n-space-s)] - Controls the thickness of the progress bar, using our [spacing tokens](/tokens/#space).\n * @cssprop [--n-progress-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress bar, using [color tokens](/tokens/#color).\n */\n@customElement('nord-progress-bar')\nexport default class ProgressBar extends FocusableMixin(LitElement) {\n static styles = [componentStyle, style]\n\n /**\n * Specifies how much of the task has been completed. Must be a valid floating\n * point number between 0 and max, or between 0 and 100 if max is omitted. If\n * there is no value, the progress bar is indeterminate; this indicates that\n * an activity is ongoing with no indication of how long it’s expected to take.\n */\n @property({ reflect: true, type: Number }) value?: number\n\n /**\n * Describes how much work the task indicated by the progress element requires.\n * The max attribute, if present, must have a value greater than 0 and be a\n * valid floating point number.\n */\n @property({ reflect: true, type: Number }) max: number = 100\n\n /**\n * Accessible label for the progress indicator. Visually hidden, but shown\n * for assistive technology.\n */\n @property({ reflect: true }) label: string = 'Current progress'\n\n render() {\n /**\n * The Aria properties are required for now due to a Chrome bug.\n * In the future we can probably get rid of them. For context:\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1310779\n */\n return html`<label>\n <nord-visually-hidden>${this.label}</nord-visually-hidden>\n <progress\n ${ref(this.focusableRef)}\n aria-valuenow=${ifDefined(this.value)}\n aria-valuemin=\"0\"\n aria-valuemax=${this.max}\n tabindex=\"-1\"\n max=${this.max}\n value=${ifDefined(this.value)}\n ></progress>\n </label>`\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-progress-bar': ProgressBar\n }\n}\n"],"names":["ProgressBar","FocusableMixin","LitElement","constructor","this","max","label","render","html","ref","focusableRef","ifDefined","value","styles","componentStyle","style","__decorate","property","reflect","type","Number","prototype","customElement"],"mappings":"0wDAsBe,IAAMA,EAAN,cAA0BC,EAAeC,IAAzC,WAAAC,uBAgB8BC,KAAGC,IAAW,IAM5BD,KAAKE,MAAW,kBAqB9C,CAnBC,MAAAC,GAME,OAAOC,CAAI,gCACeJ,KAAKE,yCAEzBG,EAAIL,KAAKM,gCACKC,EAAUP,KAAKQ,4CAEfR,KAAKC,2BAEfD,KAAKC,eACHM,EAAUP,KAAKQ,6BAG5B,GAzCMZ,EAAAa,OAAS,CAACC,EAAgBC,GAQUC,EAAA,CAA1CC,EAAS,CAAEC,SAAS,EAAMC,KAAMC,UAAwBpB,EAAAqB,UAAA,aAAA,GAOdL,EAAA,CAA1CC,EAAS,CAAEC,SAAS,EAAMC,KAAMC,UAA2BpB,EAAAqB,UAAA,WAAA,GAM/BL,EAAA,CAA5BC,EAAS,CAAEC,SAAS,KAA0ClB,EAAAqB,UAAA,aAAA,GAtB5CrB,EAAWgB,EAAA,CAD/BM,EAAc,sBACMtB,SAAAA"}
|
package/lib/Qrcode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{css as e,LitElement as r,html as o}from"lit";import{query as n,property as i,customElement as l}from"lit/decorators.js";import{styleMap as a}from"lit/directives/style-map.js";import{o as h}from"./observe-D0n0zOfU.js";import{s}from"./Component-
|
|
1
|
+
import{_ as t}from"./tslib.es6-CmLYFWVC.js";import{css as e,LitElement as r,html as o}from"lit";import{query as n,property as i,customElement as l}from"lit/decorators.js";import{styleMap as a}from"lit/directives/style-map.js";import{o as h}from"./observe-D0n0zOfU.js";import{s}from"./Component-BJ5O5n8k.js";
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2023 Paul Miller (paulmillr.com)
|
|
4
4
|
The library paulmillr-qr is dual-licensed under the Apache 2.0 OR MIT license.
|
|
@@ -15,5 +15,5 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
15
15
|
See the License for the specific language governing permissions and
|
|
16
16
|
limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
const c=10,d=27;function f(t,e){return t.toString(2).padStart(e,"0")}function u(t,e){const r=t%e;return r>=0?r:e+r}function g(t,e){return new Array(t).fill(e)}function m(...t){let e=0;for(const r of t)e=Math.max(e,r.length);const r=[];for(let o=0;o<e;o++)for(const e of t)o>=e.length||r.push(e[o]);return new Uint8Array(r)}function w(t,e,r){if(r<0||r+e.length>t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[r+o])return!1;return!0}function p(t){return{has:e=>t.includes(e),decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const r=t.indexOf(e);if(-1===r)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return r}))},encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map((e=>{if(function(t){if(!Number.isSafeInteger(t))throw new Error(`integer expected: ${t}`)}(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]}))}}}class y{static size(t,e){if("number"==typeof t&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return void 0!==e&&(t={width:Math.min(t.width,e.width),height:Math.min(t.height,e.height)}),t}static fromString(t){const e=(t=t.replace(/^\n+/g,"").replace(/\n+$/g,"")).split(String.fromCharCode(c)),r=e.length,o=new Array(r);let n;for(const t of e){const e=t.split("").map((t=>{if("X"===t)return!0;if(" "===t)return!1;if("?"!==t)throw new Error(`Bitmap.fromString: unknown symbol=${t}`)}));if(n&&e.length!==n)throw new Error(`Bitmap.fromString different row sizes: width=${n} cur=${e.length}`);n=e.length,o.push(e)}return n||(n=0),new y({height:r,width:n},o)}constructor(t,e){const{height:r,width:o}=y.size(t);this.data=e||Array.from({length:r},(()=>g(o,void 0))),this.height=r,this.width=o}point(t){return this.data[t.y][t.x]}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:e,y:r}=this.xy(t);return{height:this.height-r,width:this.width-e}}xy(t){if("number"==typeof t&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=u(t.x,this.width),t.y=u(t.y,this.height),t}rect(t,e,r){const{x:o,y:n}=this.xy(t),{height:i,width:l}=y.size(e,this.size({x:o,y:n}));for(let t=0;t<i;t++)for(let e=0;e<l;e++)this.data[n+t][o+e]="function"==typeof r?r({x:e,y:t},this.data[n+t][o+e]):r;return this}rectRead(t,e,r){return this.rect(t,e,((t,e)=>(r(t,e),e)))}hLine(t,e,r){return this.rect(t,{width:e,height:1},r)}vLine(t,e,r){return this.rect(t,{width:1,height:e},r)}border(t=2,e){const r=this.height+2*t,o=this.width+2*t,n=g(t,e),i=Array.from({length:t},(()=>g(o,e)));return new y({height:r,width:o},[...i,...this.data.map((t=>[...n,...t,...n])),...i])}embed(t,e){return this.rect(t,e.size(),(({x:t,y:r})=>e.data[r][t]))}rectSlice(t,e=this.size()){const r=new y(y.size(e,this.size(this.xy(t))));return this.rect(t,e,(({x:t,y:e},o)=>r.data[e][t]=o)),r}inverse(){const{height:t,width:e}=this;return new y({height:e,width:t}).rect({x:0,y:0},1/0,(({x:t,y:e})=>this.data[t][e]))}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:e,width:r}=this;return new y({height:t*e,width:t*r}).rect({x:0,y:0},1/0,(({x:e,y:r})=>this.data[Math.floor(r/t)][Math.floor(e/t)]))}clone(){return new y(this.size()).rect({x:0,y:0},this.size(),(({x:t,y:e})=>this.data[e][t]))}assertDrawn(){this.rectRead(0,1/0,((t,e)=>{if("boolean"!=typeof e)throw new Error("Invalid color type="+typeof e)}))}toString(){return this.data.map((t=>t.map((t=>void 0===t?"?":t?"X":" ")).join(""))).join(String.fromCharCode(c))}toASCII(){const{height:t,width:e,data:r}=this;let o="";for(let n=0;n<t;n+=2){for(let i=0;i<e;i++){const e=r[n][i],l=n+1>=t||r[n+1][i];e||l?!e&&l?o+="▀":e&&!l?o+="▄":e&&l&&(o+=" "):o+="█"}o+=String.fromCharCode(c)}return o}toTerm(){const t=String.fromCharCode(d),e=t+"[0m",r=t+"[1;47m "+e,o=t+"[40m "+e;return this.data.map((t=>t.map((t=>t?o:r)).join(""))).join(String.fromCharCode(c))}toSVG(t=!0){let e,r=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,o="";return this.rectRead(0,1/0,((n,i)=>{if(!i)return;const{x:l,y:a}=n;if(!t)return void(r+=`<rect x="${l}" y="${a}" width="1" height="1" />`);let h=`M${l} ${a}`;if(e){const t=`m${l-e.x} ${a-e.y}`;t.length<=h.length&&(h=t)}o+=`${h}h1v1${l<10?`H${l}`:"h-1"}Z`,e=n})),t&&(r+=`<path d="${o}"/>`),r+="</svg>",r}toGIF(){const t=t=>[255&t,t>>>8&255],e=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,((t,e)=>r.push(+(!0===e))));const o=126,n=[71,73,70,56,55,97,...e,246,0,0,255,255,255,...g(381,0),44,0,0,0,0,...e,0,7],i=Math.floor(r.length/o);for(let t=0;t<i;t++)n.push(127,128,...r.slice(o*t,o*(t+1)).map((t=>+t)));return n.push(r.length%o+1,128,...r.slice(i*o).map((t=>+t))),n.push(1,129,0,59),new Uint8Array(n)}toImage(t=!1){const{height:e,width:r}=this.size(),o=new Uint8Array(e*r*(t?3:4));let n=0;for(let i=0;i<e;i++)for(let e=0;e<r;e++){const r=this.data[i][e]?0:255;o[n++]=r,o[n++]=r,o[n++]=r,t||(o[n++]=255)}return{height:e,width:r,data:o}}}const v=["low","medium","quartile","high"],b=["numeric","alphanumeric","byte","kanji","eci"],x=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],$={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},E={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},S={size:{encode:t=>21+4*(t-1),decode:t=>(t-17)/4},sizeType:t=>Math.floor((t+7)/17),alignmentPatterns(t){if(1===t)return[];const e=S.size.encode(t)-6-1,r=e-6,o=Math.ceil(r/28);let n=Math.floor(r/o);n%2?n+=1:r%o*2>=o&&(n+=2);const i=[6];for(let t=1;t<o;t++)i.push(e-(o-t)*n);return i.push(e),i},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(t,e){const r=S.ECCode[t]<<3|e;let o=r;for(let t=0;t<10;t++)o=o<<1^1335*(o>>9);return(r<<10|o)^S.formatMask},versionBits(t){let e=t;for(let t=0;t<12;t++)e=e<<1^7973*(e>>11);return t<<12|e},alphabet:{numeric:p("0123456789"),alphanumerc:p("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits:(t,e)=>({numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[e][S.sizeType(t)]),modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(t,e){const r=x[t-1],o=$[e][t-1],n=E[e][t-1],i=Math.floor(r/n)-o,l=n-r%n;return{words:o,numBlocks:n,shortBlocks:l,blockLen:i,capacity:8*(r-o*n),total:(o+i)*n+n-l}}},k=[(t,e)=>(t+e)%2==0,(t,e)=>e%2==0,(t,e)=>t%3==0,(t,e)=>(t+e)%3==0,(t,e)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(t,e)=>t*e%2+t*e%3==0,(t,e)=>(t*e%2+t*e%3)%2==0,(t,e)=>((t+e)%2+t*e%3)%2==0],z={tables:(()=>{const t=g(256,0),e=g(256,0);for(let r=0,o=1;r<256;r++)t[r]=o,e[o]=r,o<<=1,256&o&&(o^=285);return{exp:t,log:e}})(),exp:t=>z.tables.exp[t],log(t){if(0===t)throw new Error(`GF.log: invalid arg=${t}`);return z.tables.log[t]%255},mul:(t,e)=>0===t||0===e?0:z.tables.exp[(z.tables.log[t]+z.tables.log[e])%255],add:(t,e)=>t^e,pow:(t,e)=>z.tables.exp[z.tables.log[t]*e%255],inv(t){if(0===t)throw new Error(`GF.inverse: invalid arg=${t}`);return z.tables.exp[255-z.tables.log[t]]},polynomial(t){if(0==t.length)throw new Error("GF.polymomial: invalid length");if(0!==t[0])return t;let e=0;for(;e<t.length-1&&0==t[e];e++);return t.slice(e)},monomial(t,e){if(t<0)throw new Error(`GF.monomial: invalid degree=${t}`);if(0==e)return[0];let r=g(t+1,0);return r[0]=e,z.polynomial(r)},degree:t=>t.length-1,coefficient:(t,e)=>t[z.degree(t)-e],mulPoly(t,e){if(0===t[0]||0===e[0])return[0];const r=g(t.length+e.length-1,0);for(let o=0;o<t.length;o++)for(let n=0;n<e.length;n++)r[o+n]=z.add(r[o+n],z.mul(t[o],e[n]));return z.polynomial(r)},mulPolyScalar(t,e){if(0==e)return[0];if(1==e)return t;const r=g(t.length,0);for(let o=0;o<t.length;o++)r[o]=z.mul(t[o],e);return z.polynomial(r)},mulPolyMonomial(t,e,r){if(e<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(0==r)return[0];const o=g(t.length+e,0);for(let e=0;e<t.length;e++)o[e]=z.mul(t[e],r);return z.polynomial(o)},addPoly(t,e){if(0===t[0])return e;if(0===e[0])return t;let r=t,o=e;r.length>o.length&&([r,o]=[o,r]);let n=g(o.length,0),i=o.length-r.length,l=o.slice(0,i);for(let t=0;t<l.length;t++)n[t]=l[t];for(let t=i;t<o.length;t++)n[t]=z.add(r[t-i],o[t]);return z.polynomial(n)},remainderPoly(t,e){const r=Array.from(t);for(let o=0;o<t.length-e.length+1;o++){const t=r[o];if(0!==t)for(let n=1;n<e.length;n++)0!==e[n]&&(r[o+n]=z.add(r[o+n],z.mul(e[n],t)))}return r.slice(t.length-e.length+1,r.length)},divisorPoly(t){let e=[1];for(let r=0;r<t;r++)e=z.mulPoly(e,[1,z.pow(2,r)]);return e},evalPoly(t,e){if(0==e)return z.coefficient(t,0);let r=t[0];for(let o=1;o<t.length;o++)r=z.add(z.mul(e,r),t[o]);return r},euclidian(t,e,r){z.degree(t)<z.degree(e)&&([t,e]=[e,t]);let o=t,n=e,i=[0],l=[1];for(;2*z.degree(n)>=r;){let t=o,e=i;if(o=n,i=l,0===o[0])throw new Error("rLast[0] === 0");n=t;let r=[0];const a=z.inv(o[0]);for(;z.degree(n)>=z.degree(o)&&0!==n[0];){const t=z.degree(n)-z.degree(o),e=z.mul(n[0],a);r=z.addPoly(r,z.monomial(t,e)),n=z.addPoly(n,z.mulPolyMonomial(o,t,e))}if(r=z.mulPoly(r,i),l=z.addPoly(r,e),z.degree(n)>=z.degree(o))throw new Error(`Division failed r: ${n}, rLast: ${o}`)}const a=z.coefficient(l,0);if(0==a)throw new Error("sigmaTilde(0) was zero");const h=z.inv(a);return[z.mulPolyScalar(l,h),z.mulPolyScalar(n,h)]}};function A(t,e){const{words:r,shortBlocks:o,numBlocks:n,blockLen:i,total:l}=S.capacity(t,e),a=(h=r,{encode(t){const e=z.divisorPoly(h),r=Array.from(t);return r.push(...e.slice(0,-1).fill(0)),Uint8Array.from(z.remainderPoly(r,e))},decode(t){const e=t.slice(),r=z.polynomial(Array.from(t));let o=g(h,0),n=!1;for(let t=0;t<h;t++){const e=z.evalPoly(r,z.exp(t));o[o.length-1-t]=e,0!==e&&(n=!0)}if(!n)return e;o=z.polynomial(o);const i=z.monomial(h,1),[l,a]=z.euclidian(i,o,h),s=g(z.degree(l),0);let c=0;for(let t=1;t<256&&c<s.length;t++)0===z.evalPoly(l,t)&&(s[c++]=z.inv(t));if(c!==s.length)throw new Error("RS.decode: invalid errors number");for(let t=0;t<s.length;t++){const r=e.length-1-z.log(s[t]);if(r<0)throw new Error("RS.decode: invalid error location");const o=z.inv(s[t]);let n=1;for(let e=0;e<s.length;e++)t!==e&&(n=z.mul(n,z.add(1,z.mul(s[e],o))));e[r]=z.add(e[r],z.mul(z.evalPoly(a,o),z.inv(n)))}return e}});var h;return{encode(t){const e=[],r=[];for(let l=0;l<n;l++){const n=i+(l<o?0:1);e.push(t.subarray(0,n)),r.push(a.encode(t.subarray(0,n))),t=t.subarray(n)}const l=m(...e),h=m(...r),s=new Uint8Array(l.length+h.length);return s.set(l),s.set(h,l.length),s},decode(t){if(t.length!==l)throw new Error(`interleave.decode: len(data)=${t.length}, total=${l}`);const e=[];for(let t=0;t<n;t++){const n=t<o;e.push(new Uint8Array(r+i+(n?0:1)))}let h=0;for(let r=0;r<i;r++)for(let o=0;o<n;o++)e[o][r]=t[h++];for(let r=o;r<n;r++)e[r][i]=t[h++];for(let l=i;l<i+r;l++)for(let r=0;r<n;r++){const n=r<o;e[r][l+(n?0:1)]=t[h++]}const s=[];for(const t of e)s.push(...Array.from(a.decode(t)).slice(0,-r));return Uint8Array.from(s)}}}function M(t,e,r,o){let n="",i=r.length;if("numeric"===o){const t=S.alphabet.numeric.decode(r.split("")),e=t.length;for(let r=0;r<e-2;r+=3)n+=f(100*t[r]+10*t[r+1]+t[r+2],10);e%3==1?n+=f(t[e-1],4):e%3==2&&(n+=f(10*t[e-2]+t[e-1],7))}else if("alphanumeric"===o){const t=S.alphabet.alphanumerc.decode(r.split("")),e=t.length;for(let r=0;r<e-1;r+=2)n+=f(45*t[r]+t[r+1],11);e%2==1&&(n+=f(t[e-1],6))}else{if("byte"!==o)throw new Error("encode: unsupported type");{const t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(r);i=t.length,n=Array.from(t).map((t=>f(t,8))).join("")}}const{capacity:l}=S.capacity(t,e),a=f(i,S.lengthBits(t,o));let h=S.modeBits[o]+a+n;if(h.length>l)throw new Error("Capacity overflow");h+="0".repeat(Math.min(4,Math.max(0,l-h.length))),h.length%8&&(h+="0".repeat(8-h.length%8));const s="1110110000010001";for(let t=0;h.length!==l;t++)h+=s[t%16];const c=Uint8Array.from(h.match(/(.{8})/g).map((t=>Number(`0b${t}`))));return A(t,e).encode(c)}function P(t,e,r,o,n=!1){const i=function(t,e,r,o=!1){const n=S.size.encode(t);let i=new y(n+2);const l=new y(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);i=i.embed(0,l).embed({x:-l.width,y:0},l).embed({x:0,y:-l.height},l),i=i.rectSlice(1,n);const a=new y(1).rect(0,1,!0).border(1,!1).border(1,!0),h=S.alignmentPatterns(t);for(const t of h)for(const e of h)void 0===i.data[t][e]&&i.embed({x:e-2,y:t-2},a);i=i.hLine({x:0,y:6},1/0,(({x:t},e)=>void 0===e?t%2==0:e)).vLine({x:6,y:0},1/0,(({y:t},e)=>void 0===e?t%2==0:e));{const t=S.formatBits(e,r),l=e=>!o&&1==(t>>e&1);for(let t=0;t<6;t++)i.data[t][8]=l(t);for(let t=6;t<8;t++)i.data[t+1][8]=l(t);for(let t=8;t<15;t++)i.data[n-15+t][8]=l(t);for(let t=0;t<8;t++)i.data[8][n-t-1]=l(t);for(let t=8;t<9;t++)i.data[8][15-t-1+1]=l(t);for(let t=9;t<15;t++)i.data[8][15-t-1]=l(t);i.data[n-8][8]=!o}if(t>=7){const e=S.versionBits(t);for(let t=0;t<18;t+=1){const r=!o&&1==(e>>t&1),l=Math.floor(t/3),a=t%3+n-8-3;i.data[l][a]=r,i.data[a][l]=r}}return i}(t,e,o,n);let l=0;const a=8*r.length;if(function(t,e,r){const o=t.height,n=k[e];let i=-1,l=o-1;for(let e=o-1;e>0;e-=2){for(6==e&&(e=5);;l+=i){for(let o=0;o<2;o+=1){const i=e-o;void 0===t.data[l][i]&&r(i,l,n(i,l))}if(l+i<0||l+i>=o)break}i=-i}}(i,o,((t,e,o)=>{let n=!1;l<a&&(n=!!(r[l>>>3]>>(7-l&7)&1),l++),i.data[e][t]=n!==o})),l!==a)throw new Error("QR: bytes left after draw");return i}function C(t){const e=t.inverse(),r=t=>{let e=0;for(let r,o=0,n=1;o<t.length;o++)r===t[o]&&(n++,o!==t.length-1)||(n>=5&&(e+=n-5+3),r=t[o],n=1);return e};let o=0;t.data.forEach((t=>o+=r(t))),e.data.forEach((t=>o+=r(t)));let n=0,i=t.data;const l=t.width-1,a=t.height-1;for(let t=0;t<l;t++)for(let e=0;e<a;e++){const r=t+1,o=e+1;i[t][e]===i[r][e]&&i[r][e]===i[t][o]&&i[r][e]===i[r][o]&&(n+=3)}const h=t=>{const e=[!0,!1,!0,!0,!0,!1,!0],r=[!1,!1,!1,!1],o=[...e,...r],n=[...r,...e];let i=0;for(let e=0;e<t.length;e++)w(t,o,e)&&(i+=40),w(t,n,e)&&(i+=40);return i};let s=0;for(const e of t.data)s+=h(e);for(const t of e.data)s+=h(t);let c=0;t.rectRead(0,1/0,((t,e)=>c+=e?1:0));const d=c/(t.height*t.width)*100,f=10*Math.floor(Math.abs(d-50)/5);return o+n+s+f}function B(t,e="raw",r={}){const o=void 0!==r.ecc?r.ecc:"medium";!function(t){if(!v.includes(t))throw new Error(`Invalid error correction mode=${t}. Expected: ${v}`)}(o);const n=void 0!==r.encoding?r.encoding:function(t){let e="numeric";for(let r of t)if(!S.alphabet.numeric.has(r)&&(e="alphanumeric",!S.alphabet.alphanumerc.has(r)))return"byte";return e}(t);!function(t){if(!b.includes(t))throw new Error(`Encoding: invalid mode=${t}. Expected: ${b}`);if("kanji"===t||"eci"===t)throw new Error(`Encoding: ${t} is not supported (yet?).`)}(n),void 0!==r.mask&&function(t){if(![0,1,2,3,4,5,6,7].includes(t)||!k[t])throw new Error(`Invalid mask=${t}. Expected number [0..7]`)}(r.mask);let i,l=r.version,a=new Error("Unknown error");if(void 0!==l)!function(t){if(!Number.isSafeInteger(t)||t<1||t>40)throw new Error(`Invalid version=${t}. Expected number [1..40]`)}(l),i=M(l,o,t,n);else for(let e=1;e<=40;e++)try{i=M(e,o,t,n),l=e;break}catch(t){a=t}if(!l||!i)throw a;let h=function(t,e,r,o){if(void 0===o){const n=function(){let t,e=1/0;return{add(r,o){r>=e||(t=o,e=r)},get:()=>t,score:()=>e}}();for(let o=0;o<k.length;o++)n.add(C(P(t,e,r,o,!0)),o);o=n.get()}if(void 0===o)throw new Error("Cannot find mask");return P(t,e,r,o)}(l,o,i,r.mask);h.assertDrawn();const s=void 0===r.border?2:r.border;if(!Number.isSafeInteger(s))throw new Error("invalid border type="+typeof s);if(h=h.border(s,!1),void 0!==r.scale&&(h=h.scale(r.scale)),"raw"===e)return h.data;if("ascii"===e)return h.toASCII();if("svg"===e)return h.toSVG(r.optimize);if("gif"===e)return h.toGIF();if("term"===e)return h.toTerm();throw new Error(`Unknown output: ${e}`)}const I=e`:host{display:inline-block}.n-qrcode{position:relative}canvas{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%}`,U={L:"low",M:"medium",Q:"quartile",H:"high"};let j=class extends r{constructor(){super(...arguments),this.value="",this.label="",this.size=128,this.color="var(--n-color-text)",this.background="var(--n-color-surface)",this.correction="H"}firstUpdated(){this.generate()}generate(){if(!this.hasUpdated)return;const{backgroundColor:t,color:e}=getComputedStyle(this.computed),r=B(this.value,"raw",{ecc:U[this.correction],border:0}),o=2*this.size,n=this.canvas.getContext("2d"),i=o/r.length;this.canvas.width=o,this.canvas.height=o,n&&(n.fillStyle=t,n.fillRect(0,0,o,o),r.forEach(((t,r)=>{t.forEach(((t,o)=>{t&&(n.fillStyle=e,n.fillRect(o*i,r*i,i,i))}))})))}render(){return o`<div class="n-qrcode" style="${a({"inline-size":`${this.size}px`,"block-size":`${this.size}px`})}"><canvas role="img" aria-label="${this.label.length>0?this.label:this.value}"></canvas></div><div class="computed" hidden style="${a({"background-color":`${this.background}`,color:`${this.color}`})}"></div>`}};j.styles=[s,I],t([n("canvas",!0)],j.prototype,"canvas",void 0),t([n(".computed",!0)],j.prototype,"computed",void 0),t([i({reflect:!0})],j.prototype,"value",void 0),t([i({reflect:!0})],j.prototype,"label",void 0),t([i({reflect:!0,type:Number})],j.prototype,"size",void 0),t([i({reflect:!0})],j.prototype,"color",void 0),t([i({reflect:!0})],j.prototype,"background",void 0),t([i({reflect:!0})],j.prototype,"correction",void 0),t([h("correction"),h("color"),h("background"),h("size"),h("value")],j.prototype,"generate",null),j=t([l("nord-qrcode")],j);var N=j;export{N as default};
|
|
18
|
+
const c=10,d=27;function f(t,e){return t.toString(2).padStart(e,"0")}function u(t,e){const r=t%e;return r>=0?r:e+r}function g(t,e){return new Array(t).fill(e)}function m(...t){let e=0;for(const r of t)e=Math.max(e,r.length);const r=[];for(let o=0;o<e;o++)for(const e of t)o>=e.length||r.push(e[o]);return new Uint8Array(r)}function w(t,e,r){if(r<0||r+e.length>t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[r+o])return!1;return!0}function p(t){return{has:e=>t.includes(e),decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const r=t.indexOf(e);if(-1===r)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return r}))},encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map((e=>{if(function(t){if(!Number.isSafeInteger(t))throw new Error(`integer expected: ${t}`)}(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]}))}}}class y{static size(t,e){if("number"==typeof t&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return void 0!==e&&(t={width:Math.min(t.width,e.width),height:Math.min(t.height,e.height)}),t}static fromString(t){const e=(t=t.replace(/^\n+/g,"").replace(/\n+$/g,"")).split(String.fromCharCode(c)),r=e.length,o=new Array(r);let n;for(const t of e){const e=t.split("").map((t=>{if("X"===t)return!0;if(" "===t)return!1;if("?"!==t)throw new Error(`Bitmap.fromString: unknown symbol=${t}`)}));if(n&&e.length!==n)throw new Error(`Bitmap.fromString different row sizes: width=${n} cur=${e.length}`);n=e.length,o.push(e)}return n||(n=0),new y({height:r,width:n},o)}constructor(t,e){const{height:r,width:o}=y.size(t);this.data=e||Array.from({length:r},(()=>g(o,void 0))),this.height=r,this.width=o}point(t){return this.data[t.y][t.x]}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:e,y:r}=this.xy(t);return{height:this.height-r,width:this.width-e}}xy(t){if("number"==typeof t&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=u(t.x,this.width),t.y=u(t.y,this.height),t}rect(t,e,r){const{x:o,y:n}=this.xy(t),{height:i,width:l}=y.size(e,this.size({x:o,y:n}));for(let t=0;t<i;t++)for(let e=0;e<l;e++)this.data[n+t][o+e]="function"==typeof r?r({x:e,y:t},this.data[n+t][o+e]):r;return this}rectRead(t,e,r){return this.rect(t,e,((t,e)=>(r(t,e),e)))}hLine(t,e,r){return this.rect(t,{width:e,height:1},r)}vLine(t,e,r){return this.rect(t,{width:1,height:e},r)}border(t=2,e){const r=this.height+2*t,o=this.width+2*t,n=g(t,e),i=Array.from({length:t},(()=>g(o,e)));return new y({height:r,width:o},[...i,...this.data.map((t=>[...n,...t,...n])),...i])}embed(t,e){return this.rect(t,e.size(),(({x:t,y:r})=>e.data[r][t]))}rectSlice(t,e=this.size()){const r=new y(y.size(e,this.size(this.xy(t))));return this.rect(t,e,(({x:t,y:e},o)=>r.data[e][t]=o)),r}inverse(){const{height:t,width:e}=this;return new y({height:e,width:t}).rect({x:0,y:0},1/0,(({x:t,y:e})=>this.data[t][e]))}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:e,width:r}=this;return new y({height:t*e,width:t*r}).rect({x:0,y:0},1/0,(({x:e,y:r})=>this.data[Math.floor(r/t)][Math.floor(e/t)]))}clone(){return new y(this.size()).rect({x:0,y:0},this.size(),(({x:t,y:e})=>this.data[e][t]))}assertDrawn(){this.rectRead(0,1/0,((t,e)=>{if("boolean"!=typeof e)throw new Error("Invalid color type="+typeof e)}))}toString(){return this.data.map((t=>t.map((t=>void 0===t?"?":t?"X":" ")).join(""))).join(String.fromCharCode(c))}toASCII(){const{height:t,width:e,data:r}=this;let o="";for(let n=0;n<t;n+=2){for(let i=0;i<e;i++){const e=r[n][i],l=n+1>=t||r[n+1][i];e||l?!e&&l?o+="▀":e&&!l?o+="▄":e&&l&&(o+=" "):o+="█"}o+=String.fromCharCode(c)}return o}toTerm(){const t=String.fromCharCode(d),e=t+"[0m",r=t+"[1;47m "+e,o=t+"[40m "+e;return this.data.map((t=>t.map((t=>t?o:r)).join(""))).join(String.fromCharCode(c))}toSVG(t=!0){let e,r=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,o="";return this.rectRead(0,1/0,((n,i)=>{if(!i)return;const{x:l,y:a}=n;if(!t)return void(r+=`<rect x="${l}" y="${a}" width="1" height="1" />`);let h=`M${l} ${a}`;if(e){const t=`m${l-e.x} ${a-e.y}`;t.length<=h.length&&(h=t)}o+=`${h}h1v1${l<10?`H${l}`:"h-1"}Z`,e=n})),t&&(r+=`<path d="${o}"/>`),r+="</svg>",r}toGIF(){const t=t=>[255&t,t>>>8&255],e=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,((t,e)=>r.push(+(!0===e))));const o=126,n=[71,73,70,56,55,97,...e,246,0,0,255,255,255,...g(381,0),44,0,0,0,0,...e,0,7],i=Math.floor(r.length/o);for(let t=0;t<i;t++)n.push(127,128,...r.slice(o*t,o*(t+1)).map((t=>+t)));return n.push(r.length%o+1,128,...r.slice(i*o).map((t=>+t))),n.push(1,129,0,59),new Uint8Array(n)}toImage(t=!1){const{height:e,width:r}=this.size(),o=new Uint8Array(e*r*(t?3:4));let n=0;for(let i=0;i<e;i++)for(let e=0;e<r;e++){const r=this.data[i][e]?0:255;o[n++]=r,o[n++]=r,o[n++]=r,t||(o[n++]=255)}return{height:e,width:r,data:o}}}const v=["low","medium","quartile","high"],b=["numeric","alphanumeric","byte","kanji","eci"],x=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],$={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},E={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},S={size:{encode:t=>21+4*(t-1),decode:t=>(t-17)/4},sizeType:t=>Math.floor((t+7)/17),alignmentPatterns(t){if(1===t)return[];const e=S.size.encode(t)-6-1,r=e-6,o=Math.ceil(r/28);let n=Math.floor(r/o);n%2?n+=1:r%o*2>=o&&(n+=2);const i=[6];for(let t=1;t<o;t++)i.push(e-(o-t)*n);return i.push(e),i},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(t,e){const r=S.ECCode[t]<<3|e;let o=r;for(let t=0;t<10;t++)o=o<<1^1335*(o>>9);return(r<<10|o)^S.formatMask},versionBits(t){let e=t;for(let t=0;t<12;t++)e=e<<1^7973*(e>>11);return t<<12|e},alphabet:{numeric:p("0123456789"),alphanumerc:p("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits:(t,e)=>({numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[e][S.sizeType(t)]),modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(t,e){const r=x[t-1],o=$[e][t-1],n=E[e][t-1],i=Math.floor(r/n)-o,l=n-r%n;return{words:o,numBlocks:n,shortBlocks:l,blockLen:i,capacity:8*(r-o*n),total:(o+i)*n+n-l}}},k=[(t,e)=>(t+e)%2==0,(t,e)=>e%2==0,(t,e)=>t%3==0,(t,e)=>(t+e)%3==0,(t,e)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(t,e)=>t*e%2+t*e%3==0,(t,e)=>(t*e%2+t*e%3)%2==0,(t,e)=>((t+e)%2+t*e%3)%2==0],z={tables:(()=>{const t=g(256,0),e=g(256,0);for(let r=0,o=1;r<256;r++)t[r]=o,e[o]=r,o<<=1,256&o&&(o^=285);return{exp:t,log:e}})(),exp:t=>z.tables.exp[t],log(t){if(0===t)throw new Error(`GF.log: invalid arg=${t}`);return z.tables.log[t]%255},mul:(t,e)=>0===t||0===e?0:z.tables.exp[(z.tables.log[t]+z.tables.log[e])%255],add:(t,e)=>t^e,pow:(t,e)=>z.tables.exp[z.tables.log[t]*e%255],inv(t){if(0===t)throw new Error(`GF.inverse: invalid arg=${t}`);return z.tables.exp[255-z.tables.log[t]]},polynomial(t){if(0==t.length)throw new Error("GF.polymomial: invalid length");if(0!==t[0])return t;let e=0;for(;e<t.length-1&&0==t[e];e++);return t.slice(e)},monomial(t,e){if(t<0)throw new Error(`GF.monomial: invalid degree=${t}`);if(0==e)return[0];let r=g(t+1,0);return r[0]=e,z.polynomial(r)},degree:t=>t.length-1,coefficient:(t,e)=>t[z.degree(t)-e],mulPoly(t,e){if(0===t[0]||0===e[0])return[0];const r=g(t.length+e.length-1,0);for(let o=0;o<t.length;o++)for(let n=0;n<e.length;n++)r[o+n]=z.add(r[o+n],z.mul(t[o],e[n]));return z.polynomial(r)},mulPolyScalar(t,e){if(0==e)return[0];if(1==e)return t;const r=g(t.length,0);for(let o=0;o<t.length;o++)r[o]=z.mul(t[o],e);return z.polynomial(r)},mulPolyMonomial(t,e,r){if(e<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(0==r)return[0];const o=g(t.length+e,0);for(let e=0;e<t.length;e++)o[e]=z.mul(t[e],r);return z.polynomial(o)},addPoly(t,e){if(0===t[0])return e;if(0===e[0])return t;let r=t,o=e;r.length>o.length&&([r,o]=[o,r]);let n=g(o.length,0),i=o.length-r.length,l=o.slice(0,i);for(let t=0;t<l.length;t++)n[t]=l[t];for(let t=i;t<o.length;t++)n[t]=z.add(r[t-i],o[t]);return z.polynomial(n)},remainderPoly(t,e){const r=Array.from(t);for(let o=0;o<t.length-e.length+1;o++){const t=r[o];if(0!==t)for(let n=1;n<e.length;n++)0!==e[n]&&(r[o+n]=z.add(r[o+n],z.mul(e[n],t)))}return r.slice(t.length-e.length+1,r.length)},divisorPoly(t){let e=[1];for(let r=0;r<t;r++)e=z.mulPoly(e,[1,z.pow(2,r)]);return e},evalPoly(t,e){if(0==e)return z.coefficient(t,0);let r=t[0];for(let o=1;o<t.length;o++)r=z.add(z.mul(e,r),t[o]);return r},euclidian(t,e,r){z.degree(t)<z.degree(e)&&([t,e]=[e,t]);let o=t,n=e,i=[0],l=[1];for(;2*z.degree(n)>=r;){let t=o,e=i;if(o=n,i=l,0===o[0])throw new Error("rLast[0] === 0");n=t;let r=[0];const a=z.inv(o[0]);for(;z.degree(n)>=z.degree(o)&&0!==n[0];){const t=z.degree(n)-z.degree(o),e=z.mul(n[0],a);r=z.addPoly(r,z.monomial(t,e)),n=z.addPoly(n,z.mulPolyMonomial(o,t,e))}if(r=z.mulPoly(r,i),l=z.addPoly(r,e),z.degree(n)>=z.degree(o))throw new Error(`Division failed r: ${n}, rLast: ${o}`)}const a=z.coefficient(l,0);if(0==a)throw new Error("sigmaTilde(0) was zero");const h=z.inv(a);return[z.mulPolyScalar(l,h),z.mulPolyScalar(n,h)]}};function A(t,e){const{words:r,shortBlocks:o,numBlocks:n,blockLen:i,total:l}=S.capacity(t,e),a=(h=r,{encode(t){const e=z.divisorPoly(h),r=Array.from(t);return r.push(...e.slice(0,-1).fill(0)),Uint8Array.from(z.remainderPoly(r,e))},decode(t){const e=t.slice(),r=z.polynomial(Array.from(t));let o=g(h,0),n=!1;for(let t=0;t<h;t++){const e=z.evalPoly(r,z.exp(t));o[o.length-1-t]=e,0!==e&&(n=!0)}if(!n)return e;o=z.polynomial(o);const i=z.monomial(h,1),[l,a]=z.euclidian(i,o,h),s=g(z.degree(l),0);let c=0;for(let t=1;t<256&&c<s.length;t++)0===z.evalPoly(l,t)&&(s[c++]=z.inv(t));if(c!==s.length)throw new Error("RS.decode: invalid errors number");for(let t=0;t<s.length;t++){const r=e.length-1-z.log(s[t]);if(r<0)throw new Error("RS.decode: invalid error location");const o=z.inv(s[t]);let n=1;for(let e=0;e<s.length;e++)t!==e&&(n=z.mul(n,z.add(1,z.mul(s[e],o))));e[r]=z.add(e[r],z.mul(z.evalPoly(a,o),z.inv(n)))}return e}});var h;return{encode(t){const e=[],r=[];for(let l=0;l<n;l++){const n=i+(l<o?0:1);e.push(t.subarray(0,n)),r.push(a.encode(t.subarray(0,n))),t=t.subarray(n)}const l=m(...e),h=m(...r),s=new Uint8Array(l.length+h.length);return s.set(l),s.set(h,l.length),s},decode(t){if(t.length!==l)throw new Error(`interleave.decode: len(data)=${t.length}, total=${l}`);const e=[];for(let t=0;t<n;t++){const n=t<o;e.push(new Uint8Array(r+i+(n?0:1)))}let h=0;for(let r=0;r<i;r++)for(let o=0;o<n;o++)e[o][r]=t[h++];for(let r=o;r<n;r++)e[r][i]=t[h++];for(let l=i;l<i+r;l++)for(let r=0;r<n;r++){const n=r<o;e[r][l+(n?0:1)]=t[h++]}const s=[];for(const t of e)s.push(...Array.from(a.decode(t)).slice(0,-r));return Uint8Array.from(s)}}}function M(t,e,r,o){let n="",i=r.length;if("numeric"===o){const t=S.alphabet.numeric.decode(r.split("")),e=t.length;for(let r=0;r<e-2;r+=3)n+=f(100*t[r]+10*t[r+1]+t[r+2],10);e%3==1?n+=f(t[e-1],4):e%3==2&&(n+=f(10*t[e-2]+t[e-1],7))}else if("alphanumeric"===o){const t=S.alphabet.alphanumerc.decode(r.split("")),e=t.length;for(let r=0;r<e-1;r+=2)n+=f(45*t[r]+t[r+1],11);e%2==1&&(n+=f(t[e-1],6))}else{if("byte"!==o)throw new Error("encode: unsupported type");{const t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(r);i=t.length,n=Array.from(t).map((t=>f(t,8))).join("")}}const{capacity:l}=S.capacity(t,e),a=f(i,S.lengthBits(t,o));let h=S.modeBits[o]+a+n;if(h.length>l)throw new Error("Capacity overflow");h+="0".repeat(Math.min(4,Math.max(0,l-h.length))),h.length%8&&(h+="0".repeat(8-h.length%8));const s="1110110000010001";for(let t=0;h.length!==l;t++)h+=s[t%16];const c=Uint8Array.from(h.match(/(.{8})/g).map((t=>Number(`0b${t}`))));return A(t,e).encode(c)}function P(t,e,r,o,n=!1){const i=function(t,e,r,o=!1){const n=S.size.encode(t);let i=new y(n+2);const l=new y(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);i=i.embed(0,l).embed({x:-l.width,y:0},l).embed({x:0,y:-l.height},l),i=i.rectSlice(1,n);const a=new y(1).rect(0,1,!0).border(1,!1).border(1,!0),h=S.alignmentPatterns(t);for(const t of h)for(const e of h)void 0===i.data[t][e]&&i.embed({x:e-2,y:t-2},a);i=i.hLine({x:0,y:6},1/0,(({x:t},e)=>void 0===e?t%2==0:e)).vLine({x:6,y:0},1/0,(({y:t},e)=>void 0===e?t%2==0:e));{const t=S.formatBits(e,r),l=e=>!o&&1==(t>>e&1);for(let t=0;t<6;t++)i.data[t][8]=l(t);for(let t=6;t<8;t++)i.data[t+1][8]=l(t);for(let t=8;t<15;t++)i.data[n-15+t][8]=l(t);for(let t=0;t<8;t++)i.data[8][n-t-1]=l(t);for(let t=8;t<9;t++)i.data[8][15-t-1+1]=l(t);for(let t=9;t<15;t++)i.data[8][15-t-1]=l(t);i.data[n-8][8]=!o}if(t>=7){const e=S.versionBits(t);for(let t=0;t<18;t+=1){const r=!o&&1==(e>>t&1),l=Math.floor(t/3),a=t%3+n-8-3;i.data[l][a]=r,i.data[a][l]=r}}return i}(t,e,o,n);let l=0;const a=8*r.length;if(function(t,e,r){const o=t.height,n=k[e];let i=-1,l=o-1;for(let e=o-1;e>0;e-=2){for(6==e&&(e=5);;l+=i){for(let o=0;o<2;o+=1){const i=e-o;void 0===t.data[l][i]&&r(i,l,n(i,l))}if(l+i<0||l+i>=o)break}i=-i}}(i,o,((t,e,o)=>{let n=!1;l<a&&(n=!!(r[l>>>3]>>(7-l&7)&1),l++),i.data[e][t]=n!==o})),l!==a)throw new Error("QR: bytes left after draw");return i}function C(t){const e=t.inverse(),r=t=>{let e=0;for(let r,o=0,n=1;o<t.length;o++)r===t[o]&&(n++,o!==t.length-1)||(n>=5&&(e+=n-5+3),r=t[o],n=1);return e};let o=0;t.data.forEach((t=>o+=r(t))),e.data.forEach((t=>o+=r(t)));let n=0,i=t.data;const l=t.width-1,a=t.height-1;for(let t=0;t<l;t++)for(let e=0;e<a;e++){const r=t+1,o=e+1;i[t][e]===i[r][e]&&i[r][e]===i[t][o]&&i[r][e]===i[r][o]&&(n+=3)}const h=t=>{const e=[!0,!1,!0,!0,!0,!1,!0],r=[!1,!1,!1,!1],o=[...e,...r],n=[...r,...e];let i=0;for(let e=0;e<t.length;e++)w(t,o,e)&&(i+=40),w(t,n,e)&&(i+=40);return i};let s=0;for(const e of t.data)s+=h(e);for(const t of e.data)s+=h(t);let c=0;t.rectRead(0,1/0,((t,e)=>c+=e?1:0));const d=c/(t.height*t.width)*100,f=10*Math.floor(Math.abs(d-50)/5);return o+n+s+f}function B(t,e="raw",r={}){const o=void 0!==r.ecc?r.ecc:"medium";!function(t){if(!v.includes(t))throw new Error(`Invalid error correction mode=${t}. Expected: ${v}`)}(o);const n=void 0!==r.encoding?r.encoding:function(t){let e="numeric";for(let r of t)if(!S.alphabet.numeric.has(r)&&(e="alphanumeric",!S.alphabet.alphanumerc.has(r)))return"byte";return e}(t);!function(t){if(!b.includes(t))throw new Error(`Encoding: invalid mode=${t}. Expected: ${b}`);if("kanji"===t||"eci"===t)throw new Error(`Encoding: ${t} is not supported (yet?).`)}(n),void 0!==r.mask&&function(t){if(![0,1,2,3,4,5,6,7].includes(t)||!k[t])throw new Error(`Invalid mask=${t}. Expected number [0..7]`)}(r.mask);let i,l=r.version,a=new Error("Unknown error");if(void 0!==l)!function(t){if(!Number.isSafeInteger(t)||t<1||t>40)throw new Error(`Invalid version=${t}. Expected number [1..40]`)}(l),i=M(l,o,t,n);else for(let e=1;e<=40;e++)try{i=M(e,o,t,n),l=e;break}catch(t){a=t}if(!l||!i)throw a;let h=function(t,e,r,o){if(void 0===o){const n=function(){let t,e=1/0;return{add(r,o){r>=e||(t=o,e=r)},get:()=>t,score:()=>e}}();for(let o=0;o<k.length;o++)n.add(C(P(t,e,r,o,!0)),o);o=n.get()}if(void 0===o)throw new Error("Cannot find mask");return P(t,e,r,o)}(l,o,i,r.mask);h.assertDrawn();const s=void 0===r.border?2:r.border;if(!Number.isSafeInteger(s))throw new Error("invalid border type="+typeof s);if(h=h.border(s,!1),void 0!==r.scale&&(h=h.scale(r.scale)),"raw"===e)return h.data;if("ascii"===e)return h.toASCII();if("svg"===e)return h.toSVG(r.optimize);if("gif"===e)return h.toGIF();if("term"===e)return h.toTerm();throw new Error(`Unknown output: ${e}`)}const I=e`:host{display:inline-block}.n-qrcode{position:relative}canvas{block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0;position:absolute}`,U={L:"low",M:"medium",Q:"quartile",H:"high"};let j=class extends r{constructor(){super(...arguments),this.value="",this.label="",this.size=128,this.color="var(--n-color-text)",this.background="var(--n-color-surface)",this.correction="H"}firstUpdated(){this.generate()}generate(){if(!this.hasUpdated)return;const{backgroundColor:t,color:e}=getComputedStyle(this.computed),r=B(this.value,"raw",{ecc:U[this.correction],border:0}),o=2*this.size,n=this.canvas.getContext("2d"),i=o/r.length;this.canvas.width=o,this.canvas.height=o,n&&(n.fillStyle=t,n.fillRect(0,0,o,o),r.forEach(((t,r)=>{t.forEach(((t,o)=>{t&&(n.fillStyle=e,n.fillRect(o*i,r*i,i,i))}))})))}render(){return o`<div class="n-qrcode" style="${a({"inline-size":`${this.size}px`,"block-size":`${this.size}px`})}"><canvas role="img" aria-label="${this.label.length>0?this.label:this.value}"></canvas></div><div class="computed" hidden style="${a({"background-color":`${this.background}`,color:`${this.color}`})}"></div>`}};j.styles=[s,I],t([n("canvas",!0)],j.prototype,"canvas",void 0),t([n(".computed",!0)],j.prototype,"computed",void 0),t([i({reflect:!0})],j.prototype,"value",void 0),t([i({reflect:!0})],j.prototype,"label",void 0),t([i({reflect:!0,type:Number})],j.prototype,"size",void 0),t([i({reflect:!0})],j.prototype,"color",void 0),t([i({reflect:!0})],j.prototype,"background",void 0),t([i({reflect:!0})],j.prototype,"correction",void 0),t([h("correction"),h("color"),h("background"),h("size"),h("value")],j.prototype,"generate",null),j=t([l("nord-qrcode")],j);var N=j;export{N as default};
|
|
19
19
|
//# sourceMappingURL=Qrcode.js.map
|