@nldd/design-system 0.15.0 → 0.16.1
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 +1201 -172
- package/dist/components/actions/button/button.d.ts +2 -17
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +10 -35
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +2 -1
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +8 -2
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +9 -1
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +11 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +63 -34
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.i18n.d.ts +1 -1
- package/dist/components/actions/split-button/split-button.i18n.js +1 -1
- package/dist/components/actions/split-button/split-button.i18n.js.map +1 -1
- package/dist/components/actions/split-button/split-button.js +116 -76
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/split-button/split-button.styles.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.styles.js +4 -0
- package/dist/components/actions/split-button/split-button.styles.js.map +1 -1
- package/dist/components/actions/split-button/split-button.template.d.ts +2 -1
- package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.template.js +25 -20
- package/dist/components/actions/split-button/split-button.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.story-sync.d.ts +13 -0
- package/dist/components/actions/toolbar/toolbar.story-sync.d.ts.map +1 -0
- package/dist/components/actions/toolbar/toolbar.story-sync.js +89 -0
- package/dist/components/actions/toolbar/toolbar.story-sync.js.map +1 -0
- package/dist/components/components.js +1214 -276
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +5 -2
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +2 -0
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +13 -1
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +49 -5
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +9 -0
- package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
- package/dist/components/{decorate-CzRe1eif.js → decorate-pEFCObfp.js} +1 -1
- package/dist/components/{defer-focus-DIPAUUJa.js → defer-focus-CkNrCf_g.js} +2 -2
- package/dist/components/{dev-checks-tdnaA2UV.js → dev-checks--aiYe9Pe.js} +85 -4
- package/dist/components/{icon-BPNDyhu9.js → icon-BQjRjtKH.js} +2 -1
- package/dist/components/{icon-button-Dbo_SGor.js → icon-button-CDYZPHYe.js} +93 -12
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +0 -5
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +0 -5
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.js +9 -9
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +6 -0
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +17 -17
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +3 -2
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts +5 -12
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.i18n.d.ts +8 -0
- package/dist/components/inputs/password-field/password-field.i18n.d.ts.map +1 -0
- package/dist/components/inputs/password-field/password-field.i18n.js +7 -0
- package/dist/components/inputs/password-field/password-field.i18n.js.map +1 -0
- package/dist/components/inputs/password-field/password-field.js +10 -23
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.template.js +2 -2
- package/dist/components/inputs/password-field/password-field.template.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts +0 -5
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +0 -5
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +9 -9
- package/dist/components/inputs/slider/slider.d.ts +19 -4
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +87 -19
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.styles.js +21 -6
- package/dist/components/inputs/slider/slider.styles.js.map +1 -1
- package/dist/components/inputs/slider/slider.template.js +1 -1
- package/dist/components/inputs/slider/slider.template.js.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +185 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts +22 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js +21 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.js +491 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts +3 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.styles.js +180 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.styles.js.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts +6 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts.map +1 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.template.js +44 -0
- package/dist/components/inputs/swatch-picker/swatch-picker.template.js.map +1 -0
- package/dist/components/inputs/switch/switch.d.ts +0 -5
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +0 -5
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch/switch.styles.js +2 -2
- package/dist/components/{just-in-time-education.i18n-BgCd3s-c.js → just-in-time-education.i18n-S05IOgqk.js} +30 -2
- package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.styles.js +11 -3
- package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +1 -1
- package/dist/components/layout/popover/popover.d.ts +5 -3
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +5 -3
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/task-board/task-board.d.ts +8 -0
- package/dist/components/layout/task-board/task-board.d.ts.map +1 -1
- package/dist/components/layout/task-board/task-board.js +59 -0
- package/dist/components/layout/task-board/task-board.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +0 -6
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +5 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/navigation/link-group/link-group.d.ts +47 -0
- package/dist/components/navigation/link-group/link-group.d.ts.map +1 -0
- package/dist/components/navigation/link-group/link-group.js +81 -0
- package/dist/components/navigation/link-group/link-group.js.map +1 -0
- package/dist/components/navigation/link-group/link-group.styles.d.ts +2 -0
- package/dist/components/navigation/link-group/link-group.styles.d.ts.map +1 -0
- package/dist/components/navigation/link-group/link-group.styles.js +60 -0
- package/dist/components/navigation/link-group/link-group.styles.js.map +1 -0
- package/dist/components/navigation/link-group/link-group.template.d.ts +3 -0
- package/dist/components/navigation/link-group/link-group.template.d.ts.map +1 -0
- package/dist/components/navigation/link-group/link-group.template.js +15 -0
- package/dist/components/navigation/link-group/link-group.template.js.map +1 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +7 -6
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/{nl.generated-D-8UF1iR.js → nl.generated-CUo20aPV.js} +3 -1
- package/dist/components/{visibility-mixin-CNCT26tu.js → visibility-mixin-Ce0goNS6.js} +1 -1
- package/dist/css/variables.css +3 -1
- package/dist/nldd.min.js +1087 -771
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +23 -1
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts +3 -3
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +38 -1
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +23 -1
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +4 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts +3 -3
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +38 -1
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts +3 -3
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +38 -1
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +111 -33
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +90 -3
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/owner-form.d.ts +21 -0
- package/dist/utilities/owner-form.d.ts.map +1 -0
- package/dist/utilities/owner-form.js +39 -0
- package/dist/utilities/owner-form.js.map +1 -0
- package/dist/utilities/popover-target.d.ts +11 -0
- package/dist/utilities/popover-target.d.ts.map +1 -1
- package/dist/utilities/popover-target.js +27 -0
- package/dist/utilities/popover-target.js.map +1 -1
- package/dist/utilities/popup-anchor-controller.d.ts.map +1 -1
- package/dist/utilities/popup-anchor-controller.js +5 -1
- package/dist/utilities/popup-anchor-controller.js.map +1 -1
- package/lint/cli.js +4 -4
- package/lint/data.generated.json +1 -1
- package/package.json +18 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
|
|
2
|
-
import { n as customElement, t as __decorate } from "./decorate-
|
|
2
|
+
import { n as customElement, t as __decorate } from "./decorate-pEFCObfp.js";
|
|
3
3
|
import { n as slottedReset, t as inheritedTextReset } from "./shadow-resets-BwOyyZFH.js";
|
|
4
|
-
import { a as downloadLinkHintKey, c as linkRel, i as translate, n as withTranslations, o as linkHintKey, r as setTranslations, s as markDownloadTarget, t as deferFocus } from "./defer-focus-
|
|
4
|
+
import { a as downloadLinkHintKey, c as linkRel, i as translate, n as withTranslations, o as linkHintKey, r as setTranslations, s as markDownloadTarget, t as deferFocus } from "./defer-focus-CkNrCf_g.js";
|
|
5
5
|
import { n as internalsOf, r as setState$1 } from "./element-state-BnarBv0M.js";
|
|
6
|
-
import { a as releaseContext, c as
|
|
6
|
+
import { a as releaseContext, c as anchorPopoverTarget, d as ShortcutAvailabilityController, f as hasShortcut, i as langOf, l as popoverTargetOf, m as shortcutsAvailable, n as NLDDTooltip, o as NLDDActivityIndicator, p as shortcutLabel, r as carryContext, s as PopupAnchorController, t as NLDDIconButton, u as NLDDKeyboardShortcut } from "./icon-button-CDYZPHYe.js";
|
|
7
7
|
import { t as reflectNonDefault } from "./reflect-non-default-B9wQcnne.js";
|
|
8
8
|
import { t as nlddButtonTranslations } from "./button.i18n-DiDGynnq.js";
|
|
9
|
-
import { t as NLDDIcon } from "./icon-
|
|
9
|
+
import { t as NLDDIcon } from "./icon-BQjRjtKH.js";
|
|
10
10
|
import { n as isPointerMode, r as isTouchMode, t as isKeyboardMode } from "./input-modality-CiPLYYMN.js";
|
|
11
|
-
import { A as nlddStepperTranslations, B as
|
|
11
|
+
import { A as nlddStepperTranslations, B as nlddComboBoxTranslations, C as nlddCardTranslations, D as nlddTimeFieldTranslations, E as nlddTokenFieldTranslations, F as nlddFileFieldTranslations, G as nlddCodeViewerTranslations, H as nlddTokenTranslations, I as nlddDateFieldTranslations, J as nlddAvatarTranslations, K as nlddAvatarGroupTranslations, L as MONTH_KEYS, M as nlddSearchFieldTranslations, N as nlddPasswordFieldTranslations, O as nlddTimePickerTranslations, P as nlddNumberFieldTranslations, R as WEEKDAY_KEYS, S as nlddCollectionTranslations, T as nlddSliderTranslations, U as nlddRichTextTranslations, V as nlddValidationListTranslations, W as nlddImageTranslations, X as nlddMenuTranslations, Y as nlddToolbarTranslations, Z as nlddSplitButtonTranslations, _ as nlddTableTranslations, a as nlddBadgeTranslations, b as nlddPageFooterTranslations, c as nlddPaginationTranslations, d as nlddTopNavigationBarTranslations, f as nlddSkipLinkTranslations, g as nlddDragHandleCellTranslations, h as nlddBreadcrumbsTranslations, i as nlddProgressBarTranslations, j as nlddSwatchPickerItemTranslations, k as nlddTextEditorTranslations, l as nlddDocumentTabBarTranslations, m as nlddMenuBarTranslations, n as nlddStepBarTranslations, o as nlddNotificationTranslations, p as nlddLinkTranslations, q as nlddPopoverTranslations, r as nlddProgressCircleTranslations, s as nlddBannerTranslations, t as nlddJustInTimeEducationTranslations, u as nlddTabBarTranslations, v as nlddListItemSegmentTranslations, w as nlddSidebarSectionTranslations, x as nlddWindowTranslations, y as nlddTaskBoardTranslations, z as nlddDatePickerTranslations } from "./just-in-time-education.i18n-S05IOgqk.js";
|
|
12
12
|
import { n as queryBreakpoints, r as rootFontSize, t as breakpointPx } from "./breakpoints-Bti55RWY.js";
|
|
13
|
-
import { t as VisibilityMixin } from "./visibility-mixin-
|
|
13
|
+
import { t as VisibilityMixin } from "./visibility-mixin-Ce0goNS6.js";
|
|
14
14
|
import { t as nlddListTranslations } from "./list.i18n-CKqbhFQ_.js";
|
|
15
15
|
import { t as nlddListItemTranslations } from "./list-item.i18n-89uqlBMK.js";
|
|
16
16
|
import { $ as ChangeSet, A as syntaxTree, B as getDrawSelectionConfig, C as indentNodeProp, D as matchBrackets, E as languageDataProp, F as RectangleMarker, G as layer, H as gutter, I as ViewPlugin, J as placeholder, K as lineNumbers, L as WidgetType, M as Direction, N as EditorView, P as GutterMarker, Q as ChangeDesc, R as drawSelection, S as getIndentation, T as indentUnit, U as gutterLineClass, W as keymap, X as tooltips, Y as showTooltip, Z as Annotation, _t as findClusterBreak, a as HighlightStyle, at as Prec, b as foldService, c as Language, d as ParseContext, dt as Text, et as Compartment, f as StreamLanguage, ft as Transaction, gt as countColumn, h as defineLanguageFacet, ht as combineConfig, j as Decoration, k as syntaxHighlighting, l as LanguageDescription, lt as StateEffect, nt as EditorState, o as IndentContext, ot as RangeSet, rt as Facet, st as RangeSetBuilder, tt as EditorSelection, u as LanguageSupport, ut as StateField, w as indentString, x as getIndentUnit, y as foldNodeProp, z as dropCursor } from "./dist-BFZM0YsR.js";
|
|
@@ -834,6 +834,38 @@ function DescribedBy(Base) {
|
|
|
834
834
|
__decorate([property({ attribute: false })], DescribedByMixin.prototype, "describedByElements", void 0);
|
|
835
835
|
return DescribedByMixin;
|
|
836
836
|
}
|
|
837
|
+
// src/utilities/owner-form.ts
|
|
838
|
+
/**
|
|
839
|
+
* The form a form-associated button acts on: the one it sits in, or the one
|
|
840
|
+
* its `form` attribute names.
|
|
841
|
+
*
|
|
842
|
+
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
843
|
+
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
844
|
+
* the consumer wrote, so an id pointing at the component finds an element
|
|
845
|
+
* that is not a form, and the button ends up with no form owner at all. That
|
|
846
|
+
* is the whole reason a save button in a page footer, outside the form it
|
|
847
|
+
* belongs to, used to do nothing.
|
|
848
|
+
*
|
|
849
|
+
* The id is looked up in the host's own root, the same scope the platform
|
|
850
|
+
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
851
|
+
* one in the document around it. Put the two in the same tree, or hand the
|
|
852
|
+
* button its form another way.
|
|
853
|
+
*
|
|
854
|
+
* Shared by nldd-button and nldd-split-button, whose action button sits in a
|
|
855
|
+
* shadow root and so has no form owner of its own.
|
|
856
|
+
*/
|
|
857
|
+
function ownerForm(host, internals) {
|
|
858
|
+
const id = host.getAttribute("form");
|
|
859
|
+
const root = host.getRootNode();
|
|
860
|
+
const target = id && "getElementById" in root ? root.getElementById(id) : null;
|
|
861
|
+
const rendered = target?.form;
|
|
862
|
+
let form = null;
|
|
863
|
+
if (target instanceof HTMLFormElement) form = target;
|
|
864
|
+
else if (rendered instanceof HTMLFormElement) form = rendered;
|
|
865
|
+
setState$1(host, "no-form-target", Boolean(id) && !target);
|
|
866
|
+
setState$1(host, "form-target-not-a-form", Boolean(target) && !form);
|
|
867
|
+
return id ? form : internals.form;
|
|
868
|
+
}
|
|
837
869
|
// src/components/actions/button/button.ts
|
|
838
870
|
/**
|
|
839
871
|
* Nederlandse Digitale Dienst Button Component (Lit + TypeScript)
|
|
@@ -846,7 +878,7 @@ function DescribedBy(Base) {
|
|
|
846
878
|
* @attr {string} loading-text - What the screen reader announces while `loading` is on, for a button that does more than load: "Aan het bewaren". Leave it out and the activity indicator says its translated "Laden".
|
|
847
879
|
* @attr {boolean} disabled - Disabled state. Avoid it: let the action run and say afterwards what is missing; the design guidelines say why.
|
|
848
880
|
* @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
|
|
849
|
-
* @attr {string} popovertarget - ID of a popover element this button invokes, looked up in the tree of this button; the inner button gets the element. Use the popoverTargetElement property instead when the popover lives in another tree.
|
|
881
|
+
* @attr {string} popovertarget - ID of a popover element this button invokes, looked up in the tree of this button; the inner button gets the element. Use the popoverTargetElement property instead when the popover lives in another tree. An nldd-menu or nldd-popover it points at is also positioned against this control, so it needs no `anchor`.
|
|
850
882
|
* @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
|
|
851
883
|
* @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
|
|
852
884
|
* @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
|
|
@@ -915,7 +947,12 @@ var _NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitEleme
|
|
|
915
947
|
this._popup = new PopupAnchorController(this);
|
|
916
948
|
this._shortcutAvailability = new ShortcutAvailabilityController(this);
|
|
917
949
|
}
|
|
950
|
+
disconnectedCallback() {
|
|
951
|
+
super.disconnectedCallback();
|
|
952
|
+
anchorPopoverTarget(this, null);
|
|
953
|
+
}
|
|
918
954
|
updated(changedProperties) {
|
|
955
|
+
anchorPopoverTarget(this, popoverTargetOf(this, this.popovertarget, this.popoverTargetElement));
|
|
919
956
|
if (changedProperties.has("maxWidth")) {
|
|
920
957
|
const isValidLength = !!this.maxWidth && CSS.supports("max-width", this.maxWidth);
|
|
921
958
|
this.style.maxWidth = isValidLength ? this.maxWidth : "";
|
|
@@ -935,7 +972,10 @@ var _NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitEleme
|
|
|
935
972
|
e.stopPropagation();
|
|
936
973
|
return;
|
|
937
974
|
}
|
|
938
|
-
if (e.currentTarget instanceof HTMLButtonElement)
|
|
975
|
+
if (e.currentTarget instanceof HTMLButtonElement) {
|
|
976
|
+
e.currentTarget.popoverTargetElement = popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
|
|
977
|
+
anchorPopoverTarget(this, e.currentTarget.popoverTargetElement);
|
|
978
|
+
}
|
|
939
979
|
if (this._popup.handleClick(e)) {
|
|
940
980
|
e.preventDefault();
|
|
941
981
|
return;
|
|
@@ -945,33 +985,8 @@ var _NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitEleme
|
|
|
945
985
|
if (this.type === "submit") form?.requestSubmit();
|
|
946
986
|
else if (this.type === "reset") form?.reset();
|
|
947
987
|
}
|
|
948
|
-
/**
|
|
949
|
-
* The form this button acts on: the one it sits in, or the one its `form`
|
|
950
|
-
* attribute names.
|
|
951
|
-
*
|
|
952
|
-
* The platform resolves that attribute itself, but only to a real `<form>`.
|
|
953
|
-
* An `nldd-form` renders its form in the light DOM without handing it the id
|
|
954
|
-
* the consumer wrote, so an id pointing at the component finds an element
|
|
955
|
-
* that is not a form, and the button ends up with no form owner at all. That
|
|
956
|
-
* is the whole reason a save button in a page footer, outside the form it
|
|
957
|
-
* belongs to, used to do nothing.
|
|
958
|
-
*
|
|
959
|
-
* The id is looked up in the button's own root, the same scope the platform
|
|
960
|
-
* searches: a button inside a shadow tree reaches the forms in that tree, not
|
|
961
|
-
* one in the document around it. Put the two in the same tree, or hand the
|
|
962
|
-
* button its form another way.
|
|
963
|
-
*/
|
|
964
988
|
_ownerForm() {
|
|
965
|
-
|
|
966
|
-
const root = this.getRootNode();
|
|
967
|
-
const target = id && "getElementById" in root ? root.getElementById(id) : null;
|
|
968
|
-
const rendered = target?.form;
|
|
969
|
-
let form = null;
|
|
970
|
-
if (target instanceof HTMLFormElement) form = target;
|
|
971
|
-
else if (rendered instanceof HTMLFormElement) form = rendered;
|
|
972
|
-
setState$1(this, "no-form-target", Boolean(id) && !target);
|
|
973
|
-
setState$1(this, "form-target-not-a-form", Boolean(target) && !form);
|
|
974
|
-
return id ? form : this._internals.form;
|
|
989
|
+
return ownerForm(this, this._internals);
|
|
975
990
|
}
|
|
976
991
|
/**
|
|
977
992
|
* Delegates focus to the inner `<button>` (or `<a>` when `href` is set), so
|
|
@@ -1121,9 +1136,11 @@ var splitButtonStyles = css`
|
|
|
1121
1136
|
--_split-button-highlight-border-color: var(--semantics-buttons-neutral-tinted-highlight-border-color);
|
|
1122
1137
|
--_split-button-divider-length: var(--semantics-buttons-md-divider-length);
|
|
1123
1138
|
--_split-button-width: auto;
|
|
1139
|
+
--_split-button-host-width: auto;
|
|
1124
1140
|
|
|
1125
1141
|
${inheritedTextReset}
|
|
1126
1142
|
display: inline-flex;
|
|
1143
|
+
width: var(--_split-button-host-width);
|
|
1127
1144
|
isolation: isolate;
|
|
1128
1145
|
-webkit-tap-highlight-color: transparent;
|
|
1129
1146
|
}
|
|
@@ -1182,6 +1199,8 @@ var splitButtonStyles = css`
|
|
|
1182
1199
|
display: none;
|
|
1183
1200
|
}
|
|
1184
1201
|
|
|
1202
|
+
/* The host fades, not its buttons: the highlight border is drawn here and
|
|
1203
|
+
has to fade with them. */
|
|
1185
1204
|
:host([disabled]) {
|
|
1186
1205
|
opacity: var(--primitives-opacity-disabled);
|
|
1187
1206
|
pointer-events: none;
|
|
@@ -1237,42 +1256,47 @@ var splitButtonStyles = css`
|
|
|
1237
1256
|
}
|
|
1238
1257
|
`;
|
|
1239
1258
|
// src/components/actions/split-button/split-button.template.ts
|
|
1240
|
-
function
|
|
1259
|
+
function splitButtonTemplate(component) {
|
|
1241
1260
|
return html`
|
|
1242
1261
|
<div class="split-button">
|
|
1243
1262
|
<nldd-button
|
|
1244
|
-
appearance=${
|
|
1245
|
-
size=${
|
|
1246
|
-
text=${
|
|
1247
|
-
start-icon=${
|
|
1248
|
-
shortcut=${
|
|
1249
|
-
shortcut-mac=${
|
|
1250
|
-
shortcut-windows=${
|
|
1251
|
-
shortcut-linux=${
|
|
1263
|
+
appearance=${component._buttonAppearance()}
|
|
1264
|
+
size=${component.size}
|
|
1265
|
+
text=${component.text}
|
|
1266
|
+
start-icon=${component.icon || nothing}
|
|
1267
|
+
shortcut=${component.shortcut || nothing}
|
|
1268
|
+
shortcut-mac=${component.shortcutMac || nothing}
|
|
1269
|
+
shortcut-windows=${component.shortcutWindows || nothing}
|
|
1270
|
+
shortcut-linux=${component.shortcutLinux || nothing}
|
|
1271
|
+
href=${component.href || nothing}
|
|
1272
|
+
download=${component.download ?? nothing}
|
|
1273
|
+
loading-text=${component.loadingText || nothing}
|
|
1252
1274
|
horizontal-alignment="left"
|
|
1253
1275
|
width="full"
|
|
1254
1276
|
no-highlight-border
|
|
1255
|
-
|
|
1256
|
-
|
|
1277
|
+
single-line
|
|
1278
|
+
?loading=${component.loading}
|
|
1279
|
+
?disabled=${component.disabled}
|
|
1280
|
+
@click=${component._handleActionClick}
|
|
1257
1281
|
></nldd-button>
|
|
1258
1282
|
<div class="split-button__divider"></div>
|
|
1259
1283
|
<div class="split-button__popup-button">
|
|
1260
1284
|
<nldd-icon-button
|
|
1261
|
-
appearance=${
|
|
1262
|
-
size=${
|
|
1285
|
+
appearance=${component._buttonAppearance()}
|
|
1286
|
+
size=${component.size}
|
|
1263
1287
|
icon="chevron-down-small"
|
|
1264
|
-
text=${
|
|
1288
|
+
text=${component._t("components.split-button.show-options-action", { text: component.text })}
|
|
1265
1289
|
tooltip-timing="never"
|
|
1266
1290
|
no-highlight-border
|
|
1267
1291
|
hide-lg-text
|
|
1268
|
-
?disabled=${
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1292
|
+
?disabled=${component.disabled}
|
|
1293
|
+
.popoverTargetElement=${component._popoverTarget()}
|
|
1294
|
+
>
|
|
1295
|
+
<slot name="popup" slot="popup"></slot>
|
|
1296
|
+
<slot slot="popup"></slot>
|
|
1297
|
+
</nldd-icon-button>
|
|
1273
1298
|
</div>
|
|
1274
1299
|
</div>
|
|
1275
|
-
<slot @slotchange=${this._popup.handleSlotChange}></slot>
|
|
1276
1300
|
`;
|
|
1277
1301
|
}
|
|
1278
1302
|
// src/components/actions/menu/menu.styles.ts
|
|
@@ -2048,7 +2072,7 @@ var iconCellStyles = css`
|
|
|
2048
2072
|
}
|
|
2049
2073
|
`;
|
|
2050
2074
|
// src/components/lists-and-tables/cells/icon-cell/icon-cell.template.ts
|
|
2051
|
-
function template$
|
|
2075
|
+
function template$22() {
|
|
2052
2076
|
return html`
|
|
2053
2077
|
<span
|
|
2054
2078
|
part="icon"
|
|
@@ -2087,7 +2111,7 @@ var _NLDDIconCell = class NLDDIconCell extends VisibilityMixin(LitElement, "cell
|
|
|
2087
2111
|
this.icon = "";
|
|
2088
2112
|
}
|
|
2089
2113
|
render() {
|
|
2090
|
-
return template$
|
|
2114
|
+
return template$22.call(this);
|
|
2091
2115
|
}
|
|
2092
2116
|
};
|
|
2093
2117
|
var NLDDIconCell = (_NLDDIconCell.styles = iconCellStyles, _NLDDIconCell);
|
|
@@ -2431,7 +2455,7 @@ function renderQueryMark(text, query, mode = "predictive") {
|
|
|
2431
2455
|
return html`${segments.map((s) => s.bold ? html`<b>${s.text}</b>` : s.text)}`;
|
|
2432
2456
|
}
|
|
2433
2457
|
// src/components/lists-and-tables/cells/text-cell/text-cell.template.ts
|
|
2434
|
-
function template$
|
|
2458
|
+
function template$21() {
|
|
2435
2459
|
return html`
|
|
2436
2460
|
<p
|
|
2437
2461
|
class="text-cell__overline"
|
|
@@ -2609,7 +2633,7 @@ var _NLDDTextCell = class NLDDTextCell extends RowHeaderMixin(VisibilityMixin(Li
|
|
|
2609
2633
|
else this.style.removeProperty("--_text-cell-min-height");
|
|
2610
2634
|
}
|
|
2611
2635
|
render() {
|
|
2612
|
-
return template$
|
|
2636
|
+
return template$21.call(this);
|
|
2613
2637
|
}
|
|
2614
2638
|
};
|
|
2615
2639
|
var NLDDTextCell = (_NLDDTextCell.styles = [textCellStyles], _NLDDTextCell);
|
|
@@ -3011,7 +3035,7 @@ var buttonGroupStyles = css`
|
|
|
3011
3035
|
}
|
|
3012
3036
|
`;
|
|
3013
3037
|
// src/components/actions/button-group/button-group.template.ts
|
|
3014
|
-
function template$
|
|
3038
|
+
function template$20() {
|
|
3015
3039
|
return html`
|
|
3016
3040
|
<div class="button-group">
|
|
3017
3041
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
@@ -3160,7 +3184,7 @@ var NLDDButtonGroup = (_NLDDButtonGroup = class NLDDButtonGroup extends LitEleme
|
|
|
3160
3184
|
this._collapseVerdict = 0;
|
|
3161
3185
|
}
|
|
3162
3186
|
render() {
|
|
3163
|
-
return template$
|
|
3187
|
+
return template$20.call(this);
|
|
3164
3188
|
}
|
|
3165
3189
|
}, _NLDDButtonGroup.styles = buttonGroupStyles, _NLDDButtonGroup);
|
|
3166
3190
|
__decorate([property({
|
|
@@ -4061,7 +4085,7 @@ var ANNOUNCE_RESULTS_DELAY_MS = 500;
|
|
|
4061
4085
|
* @attr {'menu'|'listbox'|'navigation'} variant - What the menu is (default 'menu'). `menu` is a menu of actions: `role="menu"` with menu items, for things you do. `listbox` is the popup of a combobox: `role="listbox"` with options, focus stays in the field. `navigation` is a submenu in a site navigation: a list of links (`role="list"`, each item a list item around a real link), because a screen reader treats a menu as an application and reads a list of links as what it is. Every item takes an `href`. Tab reaches each link, the arrow keys, Home and End move between them, Escape closes and returns focus to the trigger, and the menu closes when focus leaves it. The trigger says `aria-expanded` and promises no menu. Checkbox and radio items, shortcuts and `filter()` belong to actions and warn in development here. A submenu of a navigation menu is a navigation menu too. The variant sets `role="listitem"` on its items and groups, and takes it off again when it changes back, also where you had set that role yourself.
|
|
4062
4086
|
* @attr {string} width - Explicit width, pinned exactly. Without it the menu sizes to its content between a minimum and a viewport-aware maximum (min(100vw - inset, 640px)).
|
|
4063
4087
|
* @attr {string} accessible-label - Name of the menu or listbox for assistive technology, on the element that has the role. Without it the menu takes the name of its anchor (the `accessible-label`, `aria-label`, `text` or text of the button or field it hangs off), and a submenu the text of the item that opens it, so a listbox under a search field is "Zoeken" rather than nameless (WCAG 4.1.2). The list of an nldd-combo-box or nldd-token-field takes the name of the field.
|
|
4064
|
-
* @attr {string} anchor - ID of the anchor element. Positions the menu against it AND makes it a toggle: the menu listens on document click and opens/closes itself when the click lands on the anchor. Use this for a
|
|
4088
|
+
* @attr {string} anchor - ID of the anchor element. Positions the menu against it AND makes it a toggle: the menu listens on document click and opens/closes itself when the click lands on the anchor. Use this for a trigger that is not an nldd component, such as a plain `<button>`. An nldd-button, nldd-icon-button, nldd-split-button or nldd-list-item-segment needs no anchor: put the menu in its `popup` slot, or point its `popovertarget` at the menu, and it anchors and opens the menu itself. For a menu you open yourself (a type-ahead under a text field, say), set the `anchorElement` property instead — same positioning, no toggle.
|
|
4065
4089
|
* @attr {string} placement - Floating UI placement. Default: 'bottom-start'.
|
|
4066
4090
|
* @attr {number} max-items - Maximum number of visible items before scrolling. Sets --_menu-max-items internally. Default: 0 (no limit).
|
|
4067
4091
|
* @attr {string} empty-text - Text of the default empty-state dialog. Falls back to Dutch i18n "Geen opties beschikbaar".
|
|
@@ -4433,6 +4457,16 @@ var NLDDMenu = class NLDDMenu extends LitElement {
|
|
|
4433
4457
|
_shownForInvoker() {
|
|
4434
4458
|
return this.matches(":popover-open") || this._openChain.length > 0 || this._collapsedByPointerGesture;
|
|
4435
4459
|
}
|
|
4460
|
+
/**
|
|
4461
|
+
* Called by the invoking control once it has handled its click. The gesture
|
|
4462
|
+
* marker is normally cleared by the document click, but a control that stops
|
|
4463
|
+
* its click (nldd-split-button) keeps that from ever arriving, and a marker
|
|
4464
|
+
* left behind makes `_shownForInvoker()` report open on every later press.
|
|
4465
|
+
* @internal
|
|
4466
|
+
*/
|
|
4467
|
+
_endInvokerGesture() {
|
|
4468
|
+
this._collapsedByPointerGesture = false;
|
|
4469
|
+
}
|
|
4436
4470
|
/** @internal */
|
|
4437
4471
|
_getAnchorEl() {
|
|
4438
4472
|
if (this.anchorElement) return this.anchorElement;
|
|
@@ -4919,114 +4953,130 @@ if (!customElements.get("nldd-menu")) customElements.define("nldd-menu", NLDDMen
|
|
|
4919
4953
|
/**
|
|
4920
4954
|
* Nederlandse Digitale Dienst Split Button Component (Lit + TypeScript)
|
|
4921
4955
|
*
|
|
4922
|
-
* A split button combines a primary action
|
|
4923
|
-
* The main button performs the default action
|
|
4924
|
-
* menu or popover.
|
|
4956
|
+
* A split button combines a primary action with a chevron that opens its
|
|
4957
|
+
* alternatives. The main button performs the default action; the chevron opens
|
|
4958
|
+
* a menu or popover of variants of that same action.
|
|
4925
4959
|
*
|
|
4926
|
-
*
|
|
4927
|
-
*
|
|
4960
|
+
* The overlay is required. Put an `nldd-menu` or `nldd-popover` in the `popup`
|
|
4961
|
+
* slot, as on nldd-button and nldd-icon-button:
|
|
4928
4962
|
*
|
|
4929
4963
|
* ```html
|
|
4930
|
-
* <nldd-split-button text="
|
|
4931
|
-
* <nldd-menu>
|
|
4964
|
+
* <nldd-split-button text="Bewaar">
|
|
4965
|
+
* <nldd-menu slot="popup">
|
|
4932
4966
|
* <nldd-menu-item text="Opslaan als…"></nldd-menu-item>
|
|
4933
4967
|
* </nldd-menu>
|
|
4934
4968
|
* </nldd-split-button>
|
|
4935
4969
|
* ```
|
|
4936
4970
|
*
|
|
4937
|
-
* The
|
|
4938
|
-
*
|
|
4939
|
-
*
|
|
4940
|
-
*
|
|
4971
|
+
* The split button has no other slots, so an overlay without `slot="popup"`
|
|
4972
|
+
* works too. When both hold one, the one in `popup` wins. For an overlay that
|
|
4973
|
+
* lives elsewhere, point `popovertarget` at it instead.
|
|
4974
|
+
*
|
|
4975
|
+
* The chevron is the overlay's invoker: it anchors it, opens and closes it, and
|
|
4976
|
+
* takes `aria-expanded` and `aria-haspopup` from it, exactly as an
|
|
4977
|
+
* nldd-icon-button with a slotted overlay does. Its accessible name says which
|
|
4978
|
+
* action it belongs to ("Meer opties voor Bewaar").
|
|
4979
|
+
*
|
|
4980
|
+
* The API is narrower than nldd-button on purpose: a split button is an action
|
|
4981
|
+
* with variants, so it has no supporting text, no end icon and no link target.
|
|
4982
|
+
* Its label always stays on one line, without an ellipsis: keep it short.
|
|
4941
4983
|
*
|
|
4942
4984
|
* @element nldd-split-button
|
|
4943
4985
|
* @attr {string} size - Button size: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
|
|
4944
|
-
* @attr {string} appearance - Visual style (default
|
|
4986
|
+
* @attr {string} appearance - Visual style: 'neutral-tinted' (default) | 'neutral-base' | 'accent-filled' | 'primary' | 'secondary' | 'inherit-tinted' | 'inherit-filled'. 'primary' is 'accent-filled' and 'secondary' is 'neutral-tinted'. The inherit appearances are for a colored surface. There are no transparent appearances: the split button needs a surface of its own to show it is one control.
|
|
4945
4987
|
* @attr {boolean} disabled - Disabled state. Avoid it: let the action run and say afterwards what is missing; the design guidelines say why.
|
|
4988
|
+
* @attr {boolean} loading - Loading state of the main action, as on nldd-button. The chevron stays available.
|
|
4989
|
+
* @attr {string} loading-text - What the screen reader announces while `loading` is on, as on nldd-button.
|
|
4946
4990
|
* @attr {string} width - Width mode: 'full' (stretches to container) or any CSS length; the main action button fills the available space
|
|
4947
4991
|
* @attr {string} text - Button text for the primary action
|
|
4948
4992
|
* @attr {string} icon - Icon name shown before the text on the primary action button
|
|
4993
|
+
* @attr {string} type - What the main action does in a form: 'button' (default) | 'submit' | 'reset'. Ignored when `href` is set.
|
|
4994
|
+
* @attr {string} form - Id of the form the main action submits or resets, for a split button outside it. Takes an `nldd-form` as well as a plain `<form>`, as on nldd-button.
|
|
4995
|
+
* @attr {string} href - Turns the main action into a link, as on nldd-button.
|
|
4996
|
+
* @attr {string} download - Saves the file `href` points at instead of opening it, as on nldd-button. Only used with `href`.
|
|
4997
|
+
* @attr {string} popovertarget - ID of an `nldd-menu` or `nldd-popover` elsewhere in this tree that the chevron opens, for an overlay that cannot be a child. A slotted overlay wins.
|
|
4949
4998
|
* @attr {string} shortcut - Keyboard shortcut hint for the primary action, shown right after its text, e.g. 'Cmd+S'. Forwarded to the inner nldd-button; display only, wire up the handling in your app.
|
|
4950
4999
|
* @attr {string} shortcut-mac - Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`).
|
|
4951
5000
|
* @attr {string} shortcut-windows - Override of `shortcut` on Windows (falls back to `shortcut`).
|
|
4952
5001
|
* @attr {string} shortcut-linux - Override of `shortcut` on Linux (falls back to `shortcut`).
|
|
4953
5002
|
* @attr {object} translations - Translations; unset keys fall back to Dutch
|
|
4954
5003
|
*
|
|
4955
|
-
* @slot -
|
|
5004
|
+
* @slot popup - The `nldd-menu` or `nldd-popover` the chevron opens.
|
|
5005
|
+
* @slot - Fallback for the overlay when it has no `slot="popup"`. Anything that is not an `nldd-menu` or `nldd-popover` does nothing here.
|
|
4956
5006
|
*
|
|
4957
5007
|
* @fires action-click - Fired when the main button is clicked
|
|
4958
|
-
* @fires menu-click - Fired when the dropdown trigger is clicked and no overlay is slotted
|
|
4959
5008
|
*/
|
|
4960
5009
|
var _NLDDSplitButton = class NLDDSplitButton extends LitElement {
|
|
4961
5010
|
constructor(..._args) {
|
|
4962
5011
|
super(..._args);
|
|
5012
|
+
this._internals = internalsOf(this);
|
|
4963
5013
|
this.size = "md";
|
|
4964
5014
|
this.appearance = "neutral-tinted";
|
|
4965
5015
|
this.disabled = false;
|
|
5016
|
+
this.loading = false;
|
|
5017
|
+
this.loadingText = "";
|
|
4966
5018
|
this.width = "";
|
|
4967
5019
|
this.text = "";
|
|
5020
|
+
this.icon = "";
|
|
5021
|
+
this.type = "button";
|
|
5022
|
+
this.popoverTargetElement = null;
|
|
4968
5023
|
this.shortcut = "";
|
|
4969
5024
|
this.shortcutMac = "";
|
|
4970
5025
|
this.shortcutWindows = "";
|
|
4971
5026
|
this.shortcutLinux = "";
|
|
4972
|
-
this.icon = "";
|
|
4973
5027
|
this.translations = {};
|
|
4974
|
-
this.
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
onChange: (overlay, previous) => {
|
|
4978
|
-
previous?.removeEventListener("toggle", this._handleMenuToggle);
|
|
4979
|
-
this._menuIsOpen = false;
|
|
4980
|
-
overlay?.addEventListener("toggle", this._handleMenuToggle);
|
|
4981
|
-
}
|
|
4982
|
-
});
|
|
4983
|
-
this._handleMenuToggle = (event) => {
|
|
4984
|
-
this._menuIsOpen = event.newState === "open";
|
|
5028
|
+
this._refreshPopoverTarget = () => {
|
|
5029
|
+
const chevron = this.renderRoot.querySelector(".split-button__popup-button nldd-icon-button");
|
|
5030
|
+
if (chevron) chevron.popoverTargetElement = this._popoverTarget();
|
|
4985
5031
|
};
|
|
4986
5032
|
}
|
|
4987
|
-
_t(key) {
|
|
4988
|
-
return translate(this.translations, nlddSplitButtonTranslations, key);
|
|
5033
|
+
_t(key, vars) {
|
|
5034
|
+
return translate(this.translations, nlddSplitButtonTranslations, key, vars);
|
|
4989
5035
|
}
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
5036
|
+
/** The appearance for the two buttons inside: they take the aliases'
|
|
5037
|
+
* meaning, not the alias, so 'secondary' is never a fall-through there. */
|
|
5038
|
+
_buttonAppearance() {
|
|
5039
|
+
if (this.appearance === "primary") return "accent-filled";
|
|
5040
|
+
if (this.appearance === "secondary") return "neutral-tinted";
|
|
5041
|
+
return this.appearance;
|
|
4993
5042
|
}
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
5043
|
+
/** The overlay `popovertarget` names, for the chevron. Looked up in the tree
|
|
5044
|
+
* of this host: in the chevron's own tree the id would find nothing. */
|
|
5045
|
+
_popoverTarget() {
|
|
5046
|
+
return popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
|
|
4997
5047
|
}
|
|
4998
5048
|
_handleActionClick(e) {
|
|
4999
|
-
if (this.disabled) return;
|
|
5049
|
+
if (this.disabled || this.loading) return;
|
|
5000
5050
|
e.stopPropagation();
|
|
5001
5051
|
this.dispatchEvent(new CustomEvent("action-click", {
|
|
5002
5052
|
bubbles: true,
|
|
5003
5053
|
composed: true
|
|
5004
5054
|
}));
|
|
5055
|
+
if (this.href) return;
|
|
5056
|
+
const form = ownerForm(this, this._internals);
|
|
5057
|
+
if (this.type === "submit") form?.requestSubmit();
|
|
5058
|
+
else if (this.type === "reset") form?.reset();
|
|
5005
5059
|
}
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
e.stopPropagation();
|
|
5009
|
-
if (this._popup.handleClick(e)) return;
|
|
5010
|
-
this.dispatchEvent(new CustomEvent("menu-click", {
|
|
5011
|
-
bubbles: true,
|
|
5012
|
-
composed: true
|
|
5013
|
-
}));
|
|
5060
|
+
firstUpdated() {
|
|
5061
|
+
this.renderRoot.querySelector(".split-button__popup-button")?.addEventListener("click", this._refreshPopoverTarget, true);
|
|
5014
5062
|
}
|
|
5015
|
-
willUpdate(
|
|
5016
|
-
if (
|
|
5063
|
+
willUpdate(changed) {
|
|
5064
|
+
if (changed.has("width")) {
|
|
5017
5065
|
const w = this.width;
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5066
|
+
if (w && w !== "full" && CSS.supports("width", w)) {
|
|
5067
|
+
this.style.setProperty("--_split-button-host-width", w);
|
|
5068
|
+
this.style.setProperty("--_split-button-width", "100%");
|
|
5069
|
+
} else {
|
|
5070
|
+
this.style.removeProperty("--_split-button-host-width");
|
|
5071
|
+
this.style.removeProperty("--_split-button-width");
|
|
5072
|
+
}
|
|
5023
5073
|
}
|
|
5024
5074
|
}
|
|
5025
5075
|
render() {
|
|
5026
|
-
return
|
|
5076
|
+
return splitButtonTemplate(this);
|
|
5027
5077
|
}
|
|
5028
5078
|
};
|
|
5029
|
-
var NLDDSplitButton = (_NLDDSplitButton.styles = splitButtonStyles, _NLDDSplitButton);
|
|
5079
|
+
var NLDDSplitButton = (_NLDDSplitButton.styles = splitButtonStyles, _NLDDSplitButton.formAssociated = true, _NLDDSplitButton);
|
|
5030
5080
|
__decorate([property({
|
|
5031
5081
|
reflect: true,
|
|
5032
5082
|
converter: reflectNonDefault("md")
|
|
@@ -5039,6 +5089,11 @@ __decorate([property({
|
|
|
5039
5089
|
type: Boolean,
|
|
5040
5090
|
reflect: true
|
|
5041
5091
|
})], NLDDSplitButton.prototype, "disabled", void 0);
|
|
5092
|
+
__decorate([property({
|
|
5093
|
+
type: Boolean,
|
|
5094
|
+
reflect: true
|
|
5095
|
+
})], NLDDSplitButton.prototype, "loading", void 0);
|
|
5096
|
+
__decorate([property({ attribute: "loading-text" })], NLDDSplitButton.prototype, "loadingText", void 0);
|
|
5042
5097
|
__decorate([property({
|
|
5043
5098
|
reflect: true,
|
|
5044
5099
|
converter: reflectNonDefault("")
|
|
@@ -5047,6 +5102,15 @@ __decorate([property({
|
|
|
5047
5102
|
reflect: true,
|
|
5048
5103
|
converter: reflectNonDefault("")
|
|
5049
5104
|
})], NLDDSplitButton.prototype, "text", void 0);
|
|
5105
|
+
__decorate([property({ type: String })], NLDDSplitButton.prototype, "icon", void 0);
|
|
5106
|
+
__decorate([property({
|
|
5107
|
+
reflect: true,
|
|
5108
|
+
converter: reflectNonDefault("button")
|
|
5109
|
+
})], NLDDSplitButton.prototype, "type", void 0);
|
|
5110
|
+
__decorate([property()], NLDDSplitButton.prototype, "href", void 0);
|
|
5111
|
+
__decorate([property()], NLDDSplitButton.prototype, "download", void 0);
|
|
5112
|
+
__decorate([property()], NLDDSplitButton.prototype, "popovertarget", void 0);
|
|
5113
|
+
__decorate([property({ attribute: false })], NLDDSplitButton.prototype, "popoverTargetElement", void 0);
|
|
5050
5114
|
__decorate([property({
|
|
5051
5115
|
reflect: true,
|
|
5052
5116
|
converter: reflectNonDefault("")
|
|
@@ -5066,10 +5130,7 @@ __decorate([property({
|
|
|
5066
5130
|
attribute: "shortcut-linux",
|
|
5067
5131
|
converter: reflectNonDefault("")
|
|
5068
5132
|
})], NLDDSplitButton.prototype, "shortcutLinux", void 0);
|
|
5069
|
-
__decorate([property({ type: String })], NLDDSplitButton.prototype, "icon", void 0);
|
|
5070
5133
|
__decorate([property({ type: Object })], NLDDSplitButton.prototype, "translations", void 0);
|
|
5071
|
-
__decorate([query(".split-button__popup-button")], NLDDSplitButton.prototype, "_popupButtonWrapper", void 0);
|
|
5072
|
-
__decorate([state()], NLDDSplitButton.prototype, "_menuIsOpen", void 0);
|
|
5073
5134
|
NLDDSplitButton = __decorate([customElement("nldd-split-button")], NLDDSplitButton);
|
|
5074
5135
|
// src/components/actions/button-bar/button-bar.styles.ts
|
|
5075
5136
|
var buttonBarStyles = css`
|
|
@@ -5200,7 +5261,7 @@ var buttonBarStyles = css`
|
|
|
5200
5261
|
}
|
|
5201
5262
|
`;
|
|
5202
5263
|
// src/components/actions/button-bar/button-bar.template.ts
|
|
5203
|
-
function template$
|
|
5264
|
+
function template$19() {
|
|
5204
5265
|
return html`
|
|
5205
5266
|
<div class="button-bar"
|
|
5206
5267
|
part="bar"
|
|
@@ -5337,7 +5398,7 @@ var NLDDButtonBar = (_NLDDButtonBar = class NLDDButtonBar extends LitElement {
|
|
|
5337
5398
|
this._building = false;
|
|
5338
5399
|
}
|
|
5339
5400
|
render() {
|
|
5340
|
-
return template$
|
|
5401
|
+
return template$19.call(this);
|
|
5341
5402
|
}
|
|
5342
5403
|
}, _NLDDButtonBar.styles = buttonBarStyles, _NLDDButtonBar);
|
|
5343
5404
|
__decorate([property({
|
|
@@ -5736,7 +5797,7 @@ var toolbarTitleStyles = css`
|
|
|
5736
5797
|
}
|
|
5737
5798
|
`;
|
|
5738
5799
|
// src/components/actions/toolbar/toolbar.template.ts
|
|
5739
|
-
function template$
|
|
5800
|
+
function template$18(component, hasCenterChildren, leftSpacerZero, rightSpacerZero, isSoloFluidItem, hasOverflow, menuOpen, label, centerOnly, t) {
|
|
5740
5801
|
return html`
|
|
5741
5802
|
<div class="toolbar"
|
|
5742
5803
|
role="toolbar"
|
|
@@ -6573,7 +6634,7 @@ var _NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
6573
6634
|
}
|
|
6574
6635
|
render() {
|
|
6575
6636
|
const isSoloFluid = this._soloFluid || fillsRowAlone(this._allHostChildren().filter((c) => !this._overflowIds.has(c.id)));
|
|
6576
|
-
return template$
|
|
6637
|
+
return template$18(this, this._centerChildren.length > 0, this._leftSpacerZero, this._rightSpacerZero, isSoloFluid, this._pinnedOverflowItems.length > 0 || this._overflowIds.size > 0, this._overflowMenu.open, this.accessibleLabel, this._centerOnly, (key) => this._t(key));
|
|
6577
6638
|
}
|
|
6578
6639
|
};
|
|
6579
6640
|
var NLDDToolbar = (_NLDDToolbar.styles = toolbarStyles, _NLDDToolbar);
|
|
@@ -7141,7 +7202,7 @@ var blockquoteStyles = css`
|
|
|
7141
7202
|
}
|
|
7142
7203
|
`;
|
|
7143
7204
|
// src/components/content/blockquote/blockquote.template.ts
|
|
7144
|
-
function template$
|
|
7205
|
+
function template$17(component) {
|
|
7145
7206
|
return html`
|
|
7146
7207
|
<blockquote class="blockquote"
|
|
7147
7208
|
cite=${component.cite || nothing}
|
|
@@ -7185,7 +7246,7 @@ var _NLDDBlockquote = class NLDDBlockquote extends LitElement {
|
|
|
7185
7246
|
};
|
|
7186
7247
|
}
|
|
7187
7248
|
render() {
|
|
7188
|
-
return template$
|
|
7249
|
+
return template$17(this);
|
|
7189
7250
|
}
|
|
7190
7251
|
};
|
|
7191
7252
|
var NLDDBlockquote = (_NLDDBlockquote.styles = blockquoteStyles, _NLDDBlockquote);
|
|
@@ -7584,10 +7645,12 @@ function isDismissFromTitleBar(e) {
|
|
|
7584
7645
|
* handles opening, toggling and light dismiss; this component only handles
|
|
7585
7646
|
* positioning and focus.
|
|
7586
7647
|
*
|
|
7587
|
-
* The recommended use is through popovertarget, so the browser owns the toggle
|
|
7648
|
+
* The recommended use is through popovertarget, so the browser owns the toggle.
|
|
7649
|
+
* An nldd-button, nldd-icon-button, nldd-split-button or nldd-list-item-segment
|
|
7650
|
+
* also positions the popover against itself, so the popover needs no `anchor`:
|
|
7588
7651
|
*
|
|
7589
|
-
* <nldd-button
|
|
7590
|
-
* <nldd-popover id="info-popover"
|
|
7652
|
+
* <nldd-button popovertarget="info-popover">Info</nldd-button>
|
|
7653
|
+
* <nldd-popover id="info-popover" accessible-label="Info">
|
|
7591
7654
|
* <nldd-container>
|
|
7592
7655
|
* <p>Content of the popover.</p>
|
|
7593
7656
|
* </nldd-container>
|
|
@@ -10486,7 +10549,7 @@ var listStyles = css`
|
|
|
10486
10549
|
}
|
|
10487
10550
|
`;
|
|
10488
10551
|
// src/components/lists-and-tables/list/list.template.ts
|
|
10489
|
-
var template$
|
|
10552
|
+
var template$16 = ({ itemsLabel, hasToolbar, type, isEmpty, hasItems, hasEmptyState, hasNoResultsState, listbox }) => {
|
|
10490
10553
|
const isNavigation = type === "navigation";
|
|
10491
10554
|
const isListbox = type === "listbox";
|
|
10492
10555
|
const skipItemsLabel = isNavigation || isListbox;
|
|
@@ -11431,7 +11494,7 @@ var NLDDList = (_NLDDList2 = class NLDDList extends LitElement {
|
|
|
11431
11494
|
}));
|
|
11432
11495
|
}
|
|
11433
11496
|
render() {
|
|
11434
|
-
return template$
|
|
11497
|
+
return template$16({
|
|
11435
11498
|
itemsLabel: this.accessibleLabel || this._t("components.list.items-accessible-label"),
|
|
11436
11499
|
hasToolbar: this._hasToolbar,
|
|
11437
11500
|
type: this.type,
|
|
@@ -11683,10 +11746,6 @@ var listItemStyles = css`
|
|
|
11683
11746
|
--_list-item-background-color: var(--semantics-list-items-is-selected-background-color);
|
|
11684
11747
|
--context-content-color: var(--semantics-list-items-is-selected-content-color);
|
|
11685
11748
|
--context-content-secondary-color: var(--semantics-list-items-is-selected-content-color);
|
|
11686
|
-
/* A checked control on the gray row takes the content color: the accent
|
|
11687
|
-
can fall under 3:1 against it. */
|
|
11688
|
-
--context-selected-indicator-color: var(--semantics-list-items-is-selected-content-color);
|
|
11689
|
-
--context-selected-contrast-color: var(--semantics-list-items-is-selected-background-color);
|
|
11690
11749
|
}
|
|
11691
11750
|
|
|
11692
11751
|
|
|
@@ -11696,8 +11755,6 @@ var listItemStyles = css`
|
|
|
11696
11755
|
--_list-item-background-color: var(--semantics-list-items-is-selected-background-color);
|
|
11697
11756
|
--context-content-color: var(--semantics-list-items-is-selected-content-color);
|
|
11698
11757
|
--context-content-secondary-color: var(--semantics-list-items-is-selected-content-color);
|
|
11699
|
-
--context-selected-indicator-color: var(--semantics-list-items-is-selected-content-color);
|
|
11700
|
-
--context-selected-contrast-color: var(--semantics-list-items-is-selected-background-color);
|
|
11701
11758
|
}
|
|
11702
11759
|
|
|
11703
11760
|
/* Hover only on hover-capable devices, so a touch that turns into a scroll
|
|
@@ -11911,7 +11968,7 @@ var listItemStyles = css`
|
|
|
11911
11968
|
// src/components/lists-and-tables/list-item/list-item.template.ts
|
|
11912
11969
|
var content = html`<slot></slot>`;
|
|
11913
11970
|
var divider = html`<div class="list-item__divider"></div>`;
|
|
11914
|
-
var template$
|
|
11971
|
+
var template$15 = (button, href, target, rel, download, linkHint, actionTabindex, isHighlighted = false, checkbox = false, radio = false, checked = false, expanded, showChildren = false, hasCheckedSegment = false, disabled = false, childrenRole = "group", childrenOpen = expanded === true, accessibleLabel = "") => {
|
|
11915
11972
|
const ariaLabel = accessibleLabel ? [accessibleLabel, linkHint].filter(Boolean).join(", ") : nothing;
|
|
11916
11973
|
const ariaExpanded = expanded === void 0 ? nothing : String(expanded);
|
|
11917
11974
|
const children = showChildren ? html`<div class="list-item__children"
|
|
@@ -12687,7 +12744,7 @@ var NLDDListItem = (_NLDDListItem2 = class NLDDListItem extends withTranslations
|
|
|
12687
12744
|
if (this.href) markDownloadTarget(this, this.download, this.target);
|
|
12688
12745
|
const linkHint = hintKey ? this._t(`components.list-item.${hintKey}`) : void 0;
|
|
12689
12746
|
const actionTabindex = this._isListboxOption ? "-1" : this._arrowNavigation ? this._rovingActive ? "0" : "-1" : void 0;
|
|
12690
|
-
return template$
|
|
12747
|
+
return template$15(this.button, this.href, this.target, this.rel, this.download, linkHint, actionTabindex, this._highlighted, this.checkbox, this.radio, this.checked, this._resolvedExpanded, this._showChildren, this._hasCheckedSegment, this.disabled, this._parentType === "navigation" ? "list" : "group", this._childrenOpen, this.accessibleLabel);
|
|
12691
12748
|
}
|
|
12692
12749
|
}, _NLDDListItem = _NLDDListItem2, _NLDDListItem2.styles = [listItemStyles], _NLDDListItem2.SIZED_CELLS = "nldd-text-cell, nldd-drag-handle-cell", _NLDDListItem2);
|
|
12693
12750
|
__decorate([property({
|
|
@@ -12849,7 +12906,7 @@ var cellStyles = css`
|
|
|
12849
12906
|
}
|
|
12850
12907
|
`;
|
|
12851
12908
|
// src/components/lists-and-tables/cells/cell/cell.template.ts
|
|
12852
|
-
var template$
|
|
12909
|
+
var template$14 = () => html`<slot></slot>`;
|
|
12853
12910
|
// src/components/lists-and-tables/cells/cell/cell.ts
|
|
12854
12911
|
/**
|
|
12855
12912
|
* A generic cell for wrapping arbitrary content in a list item.
|
|
@@ -12899,7 +12956,7 @@ var _NLDDCell = class NLDDCell extends RowHeaderMixin(VisibilityMixin(LitElement
|
|
|
12899
12956
|
else this.style.removeProperty("--_cell-min-height");
|
|
12900
12957
|
}
|
|
12901
12958
|
render() {
|
|
12902
|
-
return template$
|
|
12959
|
+
return template$14();
|
|
12903
12960
|
}
|
|
12904
12961
|
};
|
|
12905
12962
|
var NLDDCell = (_NLDDCell.styles = [cellStyles], _NLDDCell);
|
|
@@ -13676,9 +13733,12 @@ var codeViewerStyles = css`
|
|
|
13676
13733
|
--_code-viewer-inline-padding: var(--primitives-space-16);
|
|
13677
13734
|
--_code-viewer-content-color: var(--semantics-content-color);
|
|
13678
13735
|
--_code-viewer-font: var(--primitives-font-monospace-sm-regular-snug);
|
|
13679
|
-
--_code-viewer-actions-
|
|
13736
|
+
--_code-viewer-actions-button-size: var(--semantics-controls-sm-min-size);
|
|
13737
|
+
/* Centers the copy button on the first line: one line of code is then
|
|
13738
|
+
as high as the box needs anyway, with the button in the middle. */
|
|
13739
|
+
--_code-viewer-actions-area-padding: calc((var(--_code-viewer-block-padding) * 2 + 1lh - var(--_code-viewer-actions-button-size)) / 2);
|
|
13680
13740
|
--_code-viewer-actions-gap: var(--primitives-space-8);
|
|
13681
|
-
--_code-viewer-actions-area-size: calc(var(--
|
|
13741
|
+
--_code-viewer-actions-area-size: calc(var(--_code-viewer-actions-button-size) + var(--_code-viewer-actions-area-padding) * 2);
|
|
13682
13742
|
--_code-viewer-actions-z-index: 1;
|
|
13683
13743
|
--_code-viewer-highlight-border-z-index: 1;
|
|
13684
13744
|
--_code-viewer-max-height: none;
|
|
@@ -14006,7 +14066,7 @@ function codeViewerTemplate(component) {
|
|
|
14006
14066
|
icon=${copyState === "success" ? "check-mark" : "copy"}
|
|
14007
14067
|
accessible-label=${buttonLabel}
|
|
14008
14068
|
tooltip-timing="never"
|
|
14009
|
-
size="
|
|
14069
|
+
size="sm"
|
|
14010
14070
|
@click=${component._onCopyClick}
|
|
14011
14071
|
@focusout=${component._onCopyBlur}
|
|
14012
14072
|
></nldd-icon-button>
|
|
@@ -15911,7 +15971,7 @@ var tagStyles = css`
|
|
|
15911
15971
|
}
|
|
15912
15972
|
`;
|
|
15913
15973
|
// src/components/content/tag/tag.template.ts
|
|
15914
|
-
function template$
|
|
15974
|
+
function template$13(component) {
|
|
15915
15975
|
const variant = component._effectiveVariant;
|
|
15916
15976
|
const showIcon = variant === "icon" || variant === "icon-and-text" && component._hasIcon;
|
|
15917
15977
|
const showText = (variant === "text" || variant === "icon-and-text") && component._hasText;
|
|
@@ -16009,7 +16069,7 @@ var _NLDDTag = class NLDDTag extends LitElement {
|
|
|
16009
16069
|
setState$1(this, "unnamed", this._effectiveVariant === "icon" && !this.accessibleLabel);
|
|
16010
16070
|
}
|
|
16011
16071
|
render() {
|
|
16012
|
-
return template$
|
|
16072
|
+
return template$13(this);
|
|
16013
16073
|
}
|
|
16014
16074
|
};
|
|
16015
16075
|
var NLDDTag = (_NLDDTag.styles = tagStyles, _NLDDTag);
|
|
@@ -16314,7 +16374,7 @@ var textStyles = css`
|
|
|
16314
16374
|
}
|
|
16315
16375
|
`;
|
|
16316
16376
|
// src/components/content/text/text.template.ts
|
|
16317
|
-
function template$
|
|
16377
|
+
function template$12() {
|
|
16318
16378
|
return html`
|
|
16319
16379
|
<slot></slot>
|
|
16320
16380
|
`;
|
|
@@ -16364,7 +16424,7 @@ var _NLDDText = class NLDDText extends LitElement {
|
|
|
16364
16424
|
this.horizontalAlignment = "left";
|
|
16365
16425
|
}
|
|
16366
16426
|
render() {
|
|
16367
|
-
return template$
|
|
16427
|
+
return template$12();
|
|
16368
16428
|
}
|
|
16369
16429
|
};
|
|
16370
16430
|
var NLDDText = (_NLDDText.styles = textStyles, _NLDDText);
|
|
@@ -17338,7 +17398,7 @@ var visuallyHiddenStyles = css`
|
|
|
17338
17398
|
}
|
|
17339
17399
|
`;
|
|
17340
17400
|
// src/components/content/visually-hidden/visually-hidden.template.ts
|
|
17341
|
-
function template$
|
|
17401
|
+
function template$11() {
|
|
17342
17402
|
return html`
|
|
17343
17403
|
<slot></slot>
|
|
17344
17404
|
`;
|
|
@@ -17370,7 +17430,7 @@ function template$10() {
|
|
|
17370
17430
|
*/
|
|
17371
17431
|
var _NLDDVisuallyHidden = class NLDDVisuallyHidden extends LitElement {
|
|
17372
17432
|
render() {
|
|
17373
|
-
return template$
|
|
17433
|
+
return template$11();
|
|
17374
17434
|
}
|
|
17375
17435
|
};
|
|
17376
17436
|
var NLDDVisuallyHidden = (_NLDDVisuallyHidden.styles = visuallyHiddenStyles, _NLDDVisuallyHidden);
|
|
@@ -19049,17 +19109,17 @@ var checkboxStyles = css`
|
|
|
19049
19109
|
--_checkbox-border-width: var(--primitives-border-width-regular);
|
|
19050
19110
|
--_checkbox-border-color: light-dark(var(--primitives-color-neutral-550), var(--primitives-color-neutral-650));
|
|
19051
19111
|
--_checkbox-background-color: var(--semantics-surfaces-base-background-color);
|
|
19052
|
-
--_checkbox-is-selected-border-color: var(--
|
|
19053
|
-
--_checkbox-is-selected-background-color: var(--
|
|
19054
|
-
--_checkbox-is-selected-icon-color: var(--
|
|
19112
|
+
--_checkbox-is-selected-border-color: var(--semantics-controls-is-selected-indicator-color);
|
|
19113
|
+
--_checkbox-is-selected-background-color: var(--semantics-controls-is-selected-indicator-color);
|
|
19114
|
+
--_checkbox-is-selected-icon-color: var(--semantics-controls-is-selected-mark-color);
|
|
19055
19115
|
--_checkbox-is-hovered-border-color: light-dark(var(--primitives-color-neutral-600), var(--primitives-color-neutral-700));
|
|
19056
|
-
--_checkbox-is-selected-is-hovered-border-color: var(--
|
|
19057
|
-
--_checkbox-is-selected-is-hovered-background-color: var(--
|
|
19058
|
-
--_checkbox-is-selected-is-hovered-icon-color: var(--
|
|
19116
|
+
--_checkbox-is-selected-is-hovered-border-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
19117
|
+
--_checkbox-is-selected-is-hovered-background-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
19118
|
+
--_checkbox-is-selected-is-hovered-icon-color: var(--semantics-controls-is-selected-mark-color);
|
|
19059
19119
|
--_checkbox-is-active-border-color: light-dark(var(--primitives-color-neutral-650), var(--primitives-color-neutral-750));
|
|
19060
|
-
--_checkbox-is-selected-is-active-border-color: var(--
|
|
19061
|
-
--_checkbox-is-selected-is-active-background-color: var(--
|
|
19062
|
-
--_checkbox-is-selected-is-active-icon-color: var(--
|
|
19120
|
+
--_checkbox-is-selected-is-active-border-color: var(--semantics-controls-is-selected-is-active-indicator-color);
|
|
19121
|
+
--_checkbox-is-selected-is-active-background-color: var(--semantics-controls-is-selected-is-active-indicator-color);
|
|
19122
|
+
--_checkbox-is-selected-is-active-icon-color: var(--semantics-controls-is-selected-mark-color);
|
|
19063
19123
|
|
|
19064
19124
|
display: inline-flex;
|
|
19065
19125
|
position: relative;
|
|
@@ -19251,11 +19311,6 @@ function checkboxTemplate(component) {
|
|
|
19251
19311
|
/**
|
|
19252
19312
|
* Nederlandse Digitale Dienst Checkbox Component (Lit + TypeScript)
|
|
19253
19313
|
*
|
|
19254
|
-
* On a selected row of nldd-list-item a checked control takes the colors of the
|
|
19255
|
-
* row: the row sets `--context-selected-indicator-color` and
|
|
19256
|
-
* `--context-selected-contrast-color`, because the accent can fall below 3:1 on
|
|
19257
|
-
* the gray of a selected row.
|
|
19258
|
-
*
|
|
19259
19314
|
* @element nldd-checkbox
|
|
19260
19315
|
* @attr {boolean} checked - Checked state
|
|
19261
19316
|
* @attr {boolean} disabled - Disabled state
|
|
@@ -21613,6 +21668,12 @@ var codeEditorStyles = css`
|
|
|
21613
21668
|
|
|
21614
21669
|
.code-editor .cm-editor {
|
|
21615
21670
|
isolation: isolate;
|
|
21671
|
+
border-radius: inherit;
|
|
21672
|
+
}
|
|
21673
|
+
|
|
21674
|
+
/* The scroller clips the gutter to the rounded frame. */
|
|
21675
|
+
:host .cm-scroller {
|
|
21676
|
+
border-radius: inherit;
|
|
21616
21677
|
}
|
|
21617
21678
|
|
|
21618
21679
|
:host([disabled]) .code-editor {
|
|
@@ -25560,10 +25621,10 @@ var fileFieldStyles = css`
|
|
|
25560
25621
|
flex-grow: 1;
|
|
25561
25622
|
align-self: stretch;
|
|
25562
25623
|
align-items: center;
|
|
25563
|
-
justify-content:
|
|
25624
|
+
justify-content: flex-start;
|
|
25564
25625
|
color: inherit;
|
|
25565
25626
|
font: inherit;
|
|
25566
|
-
text-align:
|
|
25627
|
+
text-align: start;
|
|
25567
25628
|
}
|
|
25568
25629
|
|
|
25569
25630
|
.file-field:not([class*="is-drag-"]) > .file-field__choose-button:hover {
|
|
@@ -25598,11 +25659,6 @@ var fileFieldStyles = css`
|
|
|
25598
25659
|
outline: none;
|
|
25599
25660
|
}
|
|
25600
25661
|
|
|
25601
|
-
:host([valid]) .file-field:not(.file-field--area) :is(.file-field__choose-button, .file-field__replace-area),
|
|
25602
|
-
:host([invalid]) .file-field:not(.file-field--area) :is(.file-field__choose-button, .file-field__replace-area) {
|
|
25603
|
-
padding-left: calc(var(--_file-field-validation-icon-size) + var(--_file-field-validation-icon-area-padding-right));
|
|
25604
|
-
}
|
|
25605
|
-
|
|
25606
25662
|
.file-field__text,
|
|
25607
25663
|
.file-field__value {
|
|
25608
25664
|
display: grid;
|
|
@@ -25656,7 +25712,8 @@ var fileFieldStyles = css`
|
|
|
25656
25712
|
font: var(--_file-field-choose-text-font);
|
|
25657
25713
|
}
|
|
25658
25714
|
|
|
25659
|
-
.file-field__file-icon
|
|
25715
|
+
.file-field__file-icon,
|
|
25716
|
+
.file-field__upload-icon {
|
|
25660
25717
|
flex-shrink: 0;
|
|
25661
25718
|
margin-left: var(--_file-field-inline-padding);
|
|
25662
25719
|
width: var(--_file-field-file-icon-size);
|
|
@@ -25664,6 +25721,14 @@ var fileFieldStyles = css`
|
|
|
25664
25721
|
color: var(--semantics-content-color);
|
|
25665
25722
|
}
|
|
25666
25723
|
|
|
25724
|
+
.file-field__upload-icon {
|
|
25725
|
+
color: var(--_file-field-accepted-types-color);
|
|
25726
|
+
}
|
|
25727
|
+
|
|
25728
|
+
.file-field:not(.file-field--area) .file-field__upload-icon + .file-field__text {
|
|
25729
|
+
padding-left: var(--_file-field-file-icon-gap);
|
|
25730
|
+
}
|
|
25731
|
+
|
|
25667
25732
|
.file-field:not(.file-field--area) .file-field__chosen-file {
|
|
25668
25733
|
@container file-field-chosen-area (max-width: 14.9375rem) {
|
|
25669
25734
|
.file-field__file-icon {
|
|
@@ -25744,7 +25809,7 @@ var fileFieldStyles = css`
|
|
|
25744
25809
|
display: flex;
|
|
25745
25810
|
height: 1lh;
|
|
25746
25811
|
align-items: center;
|
|
25747
|
-
justify-content:
|
|
25812
|
+
justify-content: flex-start;
|
|
25748
25813
|
}
|
|
25749
25814
|
|
|
25750
25815
|
.file-field__drop-hint-text {
|
|
@@ -25897,16 +25962,12 @@ var fileFieldStyles = css`
|
|
|
25897
25962
|
height: var(--_file-field-area-icon-size);
|
|
25898
25963
|
}
|
|
25899
25964
|
|
|
25900
|
-
.file-field
|
|
25901
|
-
color: var(--_file-field-accepted-types-color);
|
|
25902
|
-
}
|
|
25903
|
-
|
|
25904
|
-
.file-field--area.is-drag-over :is(.file-field__upload-icon, .file-field__accepted-types) {
|
|
25965
|
+
.file-field.is-drag-over :is(.file-field__upload-icon, .file-field__accepted-types) {
|
|
25905
25966
|
color: var(--_file-field-choose-text-color);
|
|
25906
25967
|
}
|
|
25907
25968
|
|
|
25908
|
-
.file-field
|
|
25909
|
-
.file-field
|
|
25969
|
+
.file-field.is-drag-rejected :is(.file-field__upload-icon, .file-field__accepted-types),
|
|
25970
|
+
.file-field.is-refused .file-field__upload-icon {
|
|
25910
25971
|
color: var(--_file-field-rejected-color);
|
|
25911
25972
|
}
|
|
25912
25973
|
|
|
@@ -25923,7 +25984,7 @@ var fileFieldStyles = css`
|
|
|
25923
25984
|
display: none;
|
|
25924
25985
|
}
|
|
25925
25986
|
|
|
25926
|
-
.file-field--area :is(.file-field__name, .file-field__folder) {
|
|
25987
|
+
.file-field--area :is(.file-field__name, .file-field__folder, .file-field__reading-text) {
|
|
25927
25988
|
justify-content: center;
|
|
25928
25989
|
}
|
|
25929
25990
|
|
|
@@ -26285,7 +26346,7 @@ function renderEmpty(component) {
|
|
|
26285
26346
|
}],
|
|
26286
26347
|
...reservedVariants(component)
|
|
26287
26348
|
]);
|
|
26288
|
-
const icon =
|
|
26349
|
+
const icon = html`<nldd-icon class="file-field__upload-icon" icon="upload-to-cloud" aria-hidden="true"></nldd-icon>`;
|
|
26289
26350
|
const buttons = buttonGroup && !refused ? renderChooseButtonGroup(component) : nothing;
|
|
26290
26351
|
const accepted = types ? html`<span class="file-field__accepted-types">${component._t("components.file-field.accepted-types-text", { types })}</span>` : nothing;
|
|
26291
26352
|
const content = area && reading ? html`${renderReadingIndicator(component)}${renderValidationIcon$5(component)}` : html`${icon}${buttons}${stack}${accepted}${renderValidationIcon$5(component)}`;
|
|
@@ -26433,6 +26494,7 @@ function renderChosen(component) {
|
|
|
26433
26494
|
icon="dismiss"
|
|
26434
26495
|
text=${component._t("components.file-field.clear-action")}
|
|
26435
26496
|
accessible-label=${component._clearAccessibleLabel()}
|
|
26497
|
+
tooltip-timing="never"
|
|
26436
26498
|
?disabled=${component.disabled}
|
|
26437
26499
|
@click=${component._handleClear}
|
|
26438
26500
|
></nldd-icon-button>
|
|
@@ -26445,7 +26507,7 @@ function renderChosen(component) {
|
|
|
26445
26507
|
"file-field__replace-area": true,
|
|
26446
26508
|
"is-active": replaced
|
|
26447
26509
|
})}>
|
|
26448
|
-
|
|
26510
|
+
<nldd-icon class="file-field__upload-icon" icon="upload-to-cloud" aria-hidden="true"></nldd-icon>
|
|
26449
26511
|
${renderStack("text", [...drags, ...reservedVariants(component)])}
|
|
26450
26512
|
${renderValidationIcon$5(component)}
|
|
26451
26513
|
</div>
|
|
@@ -28361,8 +28423,8 @@ function renderValidationIcon$3(component) {
|
|
|
28361
28423
|
}
|
|
28362
28424
|
function renderVisibilityToggle(component) {
|
|
28363
28425
|
const buttonSize = component.size === "sm" ? "xs" : "sm";
|
|
28364
|
-
const label = component.masked ?
|
|
28365
|
-
const accessibleLabel = component.masked ?
|
|
28426
|
+
const label = component._t(component.masked ? "components.password-field.show-action" : "components.password-field.hide-action");
|
|
28427
|
+
const accessibleLabel = component._t(component.masked ? "components.password-field.show-accessible-label" : "components.password-field.hide-accessible-label");
|
|
28366
28428
|
return html`
|
|
28367
28429
|
<div class="password-field__visibility-toggle-button">
|
|
28368
28430
|
<nldd-button
|
|
@@ -28422,10 +28484,7 @@ function passwordFieldTemplate(component) {
|
|
|
28422
28484
|
* @attr {boolean} invalid - Marks the field as invalid
|
|
28423
28485
|
* @attr {boolean} disabled - Disabled state
|
|
28424
28486
|
* @attr {boolean} masked - Whether the password is masked (default: true)
|
|
28425
|
-
* @attr {
|
|
28426
|
-
* @attr {string} hide-button-text - Visible toggle button text when unmasked (default: 'Verberg')
|
|
28427
|
-
* @attr {string} show-button-accessible-label - aria-label for toggle when masked (default: 'Toon wachtwoord')
|
|
28428
|
-
* @attr {string} hide-button-accessible-label - aria-label for toggle when unmasked (default: 'Verberg wachtwoord')
|
|
28487
|
+
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
28429
28488
|
* @attr {boolean} readonly - Readonly state
|
|
28430
28489
|
* @attr {boolean} required - Required state
|
|
28431
28490
|
* @attr {string} name - Input name for form submission
|
|
@@ -28451,10 +28510,7 @@ var _NLDDPasswordField = class NLDDPasswordField extends DescribedBy(FormAssocia
|
|
|
28451
28510
|
this.invalid = false;
|
|
28452
28511
|
this.disabled = false;
|
|
28453
28512
|
this.masked = true;
|
|
28454
|
-
this.
|
|
28455
|
-
this.hideButtonText = "Verberg";
|
|
28456
|
-
this.showButtonAccessibleLabel = "Toon wachtwoord";
|
|
28457
|
-
this.hideButtonAccessibleLabel = "Verberg wachtwoord";
|
|
28513
|
+
this.translations = {};
|
|
28458
28514
|
this.readonly = false;
|
|
28459
28515
|
this.required = false;
|
|
28460
28516
|
this.name = "";
|
|
@@ -28482,6 +28538,9 @@ var _NLDDPasswordField = class NLDDPasswordField extends DescribedBy(FormAssocia
|
|
|
28482
28538
|
formStateRestoreCallback(state) {
|
|
28483
28539
|
if (typeof state === "string") this.value = state;
|
|
28484
28540
|
}
|
|
28541
|
+
_t(key) {
|
|
28542
|
+
return translate(this.translations, nlddPasswordFieldTranslations, key);
|
|
28543
|
+
}
|
|
28485
28544
|
/** Enter submits the form this field belongs to, the way the browser would
|
|
28486
28545
|
* if the input were not in a shadow root. */
|
|
28487
28546
|
_handleKeydown(e) {
|
|
@@ -28555,22 +28614,7 @@ __decorate([property({
|
|
|
28555
28614
|
type: Boolean,
|
|
28556
28615
|
reflect: true
|
|
28557
28616
|
})], NLDDPasswordField.prototype, "masked", void 0);
|
|
28558
|
-
__decorate([property({
|
|
28559
|
-
type: String,
|
|
28560
|
-
attribute: "show-button-text"
|
|
28561
|
-
})], NLDDPasswordField.prototype, "showButtonText", void 0);
|
|
28562
|
-
__decorate([property({
|
|
28563
|
-
type: String,
|
|
28564
|
-
attribute: "hide-button-text"
|
|
28565
|
-
})], NLDDPasswordField.prototype, "hideButtonText", void 0);
|
|
28566
|
-
__decorate([property({
|
|
28567
|
-
type: String,
|
|
28568
|
-
attribute: "show-button-accessible-label"
|
|
28569
|
-
})], NLDDPasswordField.prototype, "showButtonAccessibleLabel", void 0);
|
|
28570
|
-
__decorate([property({
|
|
28571
|
-
type: String,
|
|
28572
|
-
attribute: "hide-button-accessible-label"
|
|
28573
|
-
})], NLDDPasswordField.prototype, "hideButtonAccessibleLabel", void 0);
|
|
28617
|
+
__decorate([property({ type: Object })], NLDDPasswordField.prototype, "translations", void 0);
|
|
28574
28618
|
__decorate([property({
|
|
28575
28619
|
type: Boolean,
|
|
28576
28620
|
reflect: true
|
|
@@ -28620,17 +28664,17 @@ var radioButtonStyles = css`
|
|
|
28620
28664
|
--_radio-button-border-color: light-dark(var(--primitives-color-neutral-550), var(--primitives-color-neutral-650));
|
|
28621
28665
|
--_radio-button-background-color: var(--semantics-surfaces-base-background-color);
|
|
28622
28666
|
--_radio-button-is-selected-inner-shape-border-width: var(--primitives-border-width-regular);
|
|
28623
|
-
--_radio-button-is-selected-inner-shape-border-color: var(--
|
|
28624
|
-
--_radio-button-is-selected-border-color: var(--
|
|
28625
|
-
--_radio-button-is-selected-background-color: var(--
|
|
28667
|
+
--_radio-button-is-selected-inner-shape-border-color: var(--semantics-controls-is-selected-mark-color);
|
|
28668
|
+
--_radio-button-is-selected-border-color: var(--semantics-controls-is-selected-indicator-color);
|
|
28669
|
+
--_radio-button-is-selected-background-color: var(--semantics-controls-is-selected-indicator-color);
|
|
28626
28670
|
--_radio-button-is-hovered-border-color: light-dark(var(--primitives-color-neutral-600), var(--primitives-color-neutral-700));
|
|
28627
|
-
--_radio-button-is-selected-is-hovered-border-color: var(--
|
|
28628
|
-
--_radio-button-is-selected-is-hovered-background-color: var(--
|
|
28629
|
-
--_radio-button-is-selected-is-hovered-inner-shape-border-color: var(--
|
|
28671
|
+
--_radio-button-is-selected-is-hovered-border-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
28672
|
+
--_radio-button-is-selected-is-hovered-background-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
28673
|
+
--_radio-button-is-selected-is-hovered-inner-shape-border-color: var(--semantics-controls-is-selected-mark-color);
|
|
28630
28674
|
--_radio-button-is-active-border-color: light-dark(var(--primitives-color-neutral-650), var(--primitives-color-neutral-750));
|
|
28631
|
-
--_radio-button-is-selected-is-active-border-color: var(--
|
|
28632
|
-
--_radio-button-is-selected-is-active-background-color: var(--
|
|
28633
|
-
--_radio-button-is-selected-is-active-inner-shape-border-color: var(--
|
|
28675
|
+
--_radio-button-is-selected-is-active-border-color: var(--semantics-controls-is-selected-is-active-indicator-color);
|
|
28676
|
+
--_radio-button-is-selected-is-active-background-color: var(--semantics-controls-is-selected-is-active-indicator-color);
|
|
28677
|
+
--_radio-button-is-selected-is-active-inner-shape-border-color: var(--semantics-controls-is-selected-mark-color);
|
|
28634
28678
|
|
|
28635
28679
|
display: inline-flex;
|
|
28636
28680
|
position: relative;
|
|
@@ -28914,11 +28958,6 @@ var RadioGrouping = class RadioGrouping {
|
|
|
28914
28958
|
* <nldd-radio-button name="options" value="2" accessible-label="Optie 2"></nldd-radio-button>
|
|
28915
28959
|
* </fieldset>
|
|
28916
28960
|
*
|
|
28917
|
-
* On a selected row of nldd-list-item a checked control takes the colors of the
|
|
28918
|
-
* row: the row sets `--context-selected-indicator-color` and
|
|
28919
|
-
* `--context-selected-contrast-color`, because the accent can fall below 3:1 on
|
|
28920
|
-
* the gray of a selected row.
|
|
28921
|
-
*
|
|
28922
28961
|
* @element nldd-radio-button
|
|
28923
28962
|
* @attr {boolean} checked - Checked state
|
|
28924
28963
|
* @attr {boolean} disabled - Disabled state
|
|
@@ -30981,6 +31020,623 @@ __decorate([property({
|
|
|
30981
31020
|
attribute: "accessible-labeled-by"
|
|
30982
31021
|
})], NLDDSegmentedControl.prototype, "accessibleLabeledBy", void 0);
|
|
30983
31022
|
NLDDSegmentedControl = _NLDDSegmentedControl = __decorate([customElement("nldd-segmented-control")], NLDDSegmentedControl);
|
|
31023
|
+
// src/components/inputs/swatch-picker/swatch-picker.styles.ts
|
|
31024
|
+
var swatchPickerStyles = css`
|
|
31025
|
+
|
|
31026
|
+
|
|
31027
|
+
/* # Host */
|
|
31028
|
+
|
|
31029
|
+
:host {
|
|
31030
|
+
--_swatch-picker-gap: var(--primitives-space-8);
|
|
31031
|
+
|
|
31032
|
+
box-sizing: border-box;
|
|
31033
|
+
display: block;
|
|
31034
|
+
}
|
|
31035
|
+
|
|
31036
|
+
:host([size="xs"]),
|
|
31037
|
+
:host([size="sm"]) {
|
|
31038
|
+
--_swatch-picker-gap: var(--primitives-space-6);
|
|
31039
|
+
}
|
|
31040
|
+
|
|
31041
|
+
:host([hidden]) {
|
|
31042
|
+
display: none;
|
|
31043
|
+
}
|
|
31044
|
+
|
|
31045
|
+
|
|
31046
|
+
/* # Block */
|
|
31047
|
+
|
|
31048
|
+
.swatch-picker {
|
|
31049
|
+
display: flex;
|
|
31050
|
+
flex-wrap: wrap;
|
|
31051
|
+
gap: var(--_swatch-picker-gap);
|
|
31052
|
+
}
|
|
31053
|
+
`;
|
|
31054
|
+
var swatchPickerItemStyles = css`
|
|
31055
|
+
|
|
31056
|
+
|
|
31057
|
+
/* # Host */
|
|
31058
|
+
|
|
31059
|
+
:host {
|
|
31060
|
+
--_swatch-picker-item-size: var(--semantics-controls-md-min-size);
|
|
31061
|
+
--_swatch-picker-item-custom-color: transparent;
|
|
31062
|
+
--_swatch-picker-item-background-color: var(--_swatch-picker-item-custom-color);
|
|
31063
|
+
--_swatch-picker-item-highlight-border-width: var(--primitives-border-width-thin);
|
|
31064
|
+
--_swatch-picker-item-highlight-border-color: light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.20));
|
|
31065
|
+
--_swatch-picker-item-indicator-size: 60%;
|
|
31066
|
+
--_swatch-picker-item-indicator-background-color: light-dark(rgba(255, 255, 255, 0.90), rgba(0, 0, 0, 0.60));
|
|
31067
|
+
--_swatch-picker-item-indicator-icon-size: 88%;
|
|
31068
|
+
--_swatch-picker-item-indicator-content-color: var(--primitives-color-neutral-1000);
|
|
31069
|
+
--context-tooltip-fingertip-size: var(--semantics-fingertip-size);
|
|
31070
|
+
/* The name sits over the swatch above it, and the swatches are what you
|
|
31071
|
+
click: a click on the name lands on that swatch, not on this one. */
|
|
31072
|
+
--context-tooltip-pointer-events: none;
|
|
31073
|
+
|
|
31074
|
+
box-sizing: border-box;
|
|
31075
|
+
display: inline-flex;
|
|
31076
|
+
border-radius: 50%;
|
|
31077
|
+
outline: none;
|
|
31078
|
+
-webkit-tap-highlight-color: transparent;
|
|
31079
|
+
}
|
|
31080
|
+
|
|
31081
|
+
:host([size="xs"]) {
|
|
31082
|
+
--_swatch-picker-item-size: var(--semantics-controls-xs-min-size);
|
|
31083
|
+
--_swatch-picker-item-indicator-icon-size: 100%;
|
|
31084
|
+
}
|
|
31085
|
+
|
|
31086
|
+
:host([size="sm"]) {
|
|
31087
|
+
--_swatch-picker-item-size: var(--semantics-controls-sm-min-size);
|
|
31088
|
+
--_swatch-picker-item-indicator-icon-size: 94%;
|
|
31089
|
+
}
|
|
31090
|
+
|
|
31091
|
+
:host([color="lintblauw"]) { --_swatch-picker-item-background-color: var(--semantics-categories-lintblauw-filled-background-color); }
|
|
31092
|
+
:host([color="donkerblauw"]) { --_swatch-picker-item-background-color: var(--semantics-categories-donkerblauw-filled-background-color); }
|
|
31093
|
+
:host([color="hemelblauw"]) { --_swatch-picker-item-background-color: var(--semantics-categories-hemelblauw-filled-background-color); }
|
|
31094
|
+
:host([color="lichtblauw"]) { --_swatch-picker-item-background-color: var(--semantics-categories-lichtblauw-filled-background-color); }
|
|
31095
|
+
:host([color="paars"]) { --_swatch-picker-item-background-color: var(--semantics-categories-paars-filled-background-color); }
|
|
31096
|
+
:host([color="violet"]) { --_swatch-picker-item-background-color: var(--semantics-categories-violet-filled-background-color); }
|
|
31097
|
+
:host([color="robijnrood"]) { --_swatch-picker-item-background-color: var(--semantics-categories-robijnrood-filled-background-color); }
|
|
31098
|
+
:host([color="roze"]) { --_swatch-picker-item-background-color: var(--semantics-categories-roze-filled-background-color); }
|
|
31099
|
+
:host([color="rood"]) { --_swatch-picker-item-background-color: var(--semantics-categories-rood-filled-background-color); }
|
|
31100
|
+
:host([color="oranje"]) { --_swatch-picker-item-background-color: var(--semantics-categories-oranje-filled-background-color); }
|
|
31101
|
+
:host([color="donkergeel"]) { --_swatch-picker-item-background-color: var(--semantics-categories-donkergeel-filled-background-color); }
|
|
31102
|
+
:host([color="geel"]) { --_swatch-picker-item-background-color: var(--semantics-categories-geel-filled-background-color); }
|
|
31103
|
+
:host([color="donkerbruin"]) { --_swatch-picker-item-background-color: var(--semantics-categories-donkerbruin-filled-background-color); }
|
|
31104
|
+
:host([color="bruin"]) { --_swatch-picker-item-background-color: var(--semantics-categories-bruin-filled-background-color); }
|
|
31105
|
+
:host([color="donkergroen"]) { --_swatch-picker-item-background-color: var(--semantics-categories-donkergroen-filled-background-color); }
|
|
31106
|
+
:host([color="groen"]) { --_swatch-picker-item-background-color: var(--semantics-categories-groen-filled-background-color); }
|
|
31107
|
+
:host([color="mosgroen"]) { --_swatch-picker-item-background-color: var(--semantics-categories-mosgroen-filled-background-color); }
|
|
31108
|
+
:host([color="mintgroen"]) { --_swatch-picker-item-background-color: var(--semantics-categories-mintgroen-filled-background-color); }
|
|
31109
|
+
|
|
31110
|
+
:host([hidden]) {
|
|
31111
|
+
display: none;
|
|
31112
|
+
}
|
|
31113
|
+
|
|
31114
|
+
:host([disabled]) {
|
|
31115
|
+
opacity: var(--primitives-opacity-disabled);
|
|
31116
|
+
pointer-events: none;
|
|
31117
|
+
}
|
|
31118
|
+
|
|
31119
|
+
|
|
31120
|
+
/* # Block */
|
|
31121
|
+
|
|
31122
|
+
.swatch-picker__item {
|
|
31123
|
+
box-sizing: border-box;
|
|
31124
|
+
display: block;
|
|
31125
|
+
position: relative;
|
|
31126
|
+
border-radius: 50%;
|
|
31127
|
+
background-color: var(--_swatch-picker-item-background-color);
|
|
31128
|
+
width: var(--_swatch-picker-item-size);
|
|
31129
|
+
height: var(--_swatch-picker-item-size);
|
|
31130
|
+
overflow: hidden;
|
|
31131
|
+
forced-color-adjust: none;
|
|
31132
|
+
}
|
|
31133
|
+
|
|
31134
|
+
.swatch-picker__item::after {
|
|
31135
|
+
content: '';
|
|
31136
|
+
position: absolute;
|
|
31137
|
+
inset: 0;
|
|
31138
|
+
border-radius: inherit;
|
|
31139
|
+
box-shadow: inset 0 0 0 var(--_swatch-picker-item-highlight-border-width) var(--_swatch-picker-item-highlight-border-color);
|
|
31140
|
+
pointer-events: none;
|
|
31141
|
+
}
|
|
31142
|
+
|
|
31143
|
+
:host(:focus-visible) .swatch-picker__item {
|
|
31144
|
+
outline: var(--semantics-focus-ring-outline);
|
|
31145
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
31146
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
31147
|
+
}
|
|
31148
|
+
|
|
31149
|
+
@media (forced-colors: active) {
|
|
31150
|
+
:host(:focus-visible) .swatch-picker__item {
|
|
31151
|
+
outline: 2px solid Highlight;
|
|
31152
|
+
outline-offset: 2px;
|
|
31153
|
+
}
|
|
31154
|
+
}
|
|
31155
|
+
|
|
31156
|
+
|
|
31157
|
+
/* # Image */
|
|
31158
|
+
|
|
31159
|
+
.swatch-picker__item-image {
|
|
31160
|
+
display: block;
|
|
31161
|
+
position: absolute;
|
|
31162
|
+
inset: 0;
|
|
31163
|
+
border-radius: inherit;
|
|
31164
|
+
width: 100%;
|
|
31165
|
+
height: 100%;
|
|
31166
|
+
object-fit: cover;
|
|
31167
|
+
}
|
|
31168
|
+
|
|
31169
|
+
|
|
31170
|
+
/* # Indicator */
|
|
31171
|
+
|
|
31172
|
+
.swatch-picker__item-indicator {
|
|
31173
|
+
display: flex;
|
|
31174
|
+
position: absolute;
|
|
31175
|
+
top: 50%;
|
|
31176
|
+
left: 50%;
|
|
31177
|
+
visibility: hidden;
|
|
31178
|
+
z-index: 1;
|
|
31179
|
+
border-radius: 50%;
|
|
31180
|
+
box-shadow: 0 0 0 var(--_swatch-picker-item-highlight-border-width) var(--_swatch-picker-item-highlight-border-color);
|
|
31181
|
+
background-color: var(--_swatch-picker-item-indicator-background-color);
|
|
31182
|
+
width: var(--_swatch-picker-item-indicator-size);
|
|
31183
|
+
height: var(--_swatch-picker-item-indicator-size);
|
|
31184
|
+
align-items: center;
|
|
31185
|
+
justify-content: center;
|
|
31186
|
+
color: var(--_swatch-picker-item-indicator-content-color);
|
|
31187
|
+
transform: translate(-50%, -50%);
|
|
31188
|
+
}
|
|
31189
|
+
|
|
31190
|
+
:host([selected]) .swatch-picker__item-indicator {
|
|
31191
|
+
visibility: visible;
|
|
31192
|
+
}
|
|
31193
|
+
|
|
31194
|
+
.swatch-picker__item-indicator-icon {
|
|
31195
|
+
display: flex;
|
|
31196
|
+
width: var(--_swatch-picker-item-indicator-icon-size);
|
|
31197
|
+
height: var(--_swatch-picker-item-indicator-icon-size);
|
|
31198
|
+
}
|
|
31199
|
+
`;
|
|
31200
|
+
// src/components/inputs/swatch-picker/swatch-picker.template.ts
|
|
31201
|
+
function swatchPickerTemplate(component) {
|
|
31202
|
+
return html`
|
|
31203
|
+
<input class="swatch-picker__validation-input"
|
|
31204
|
+
type="radio"
|
|
31205
|
+
name="nldd-validation"
|
|
31206
|
+
hidden
|
|
31207
|
+
?required=${component.required}
|
|
31208
|
+
?disabled=${component.disabled}
|
|
31209
|
+
.checked=${!!component.value}
|
|
31210
|
+
>
|
|
31211
|
+
<div class="swatch-picker">
|
|
31212
|
+
<slot @slotchange=${component._onSlotChange}></slot>
|
|
31213
|
+
</div>
|
|
31214
|
+
`;
|
|
31215
|
+
}
|
|
31216
|
+
function swatchPickerItemTemplate(component) {
|
|
31217
|
+
return html`
|
|
31218
|
+
<nldd-tooltip
|
|
31219
|
+
text=${component._name || nothing}
|
|
31220
|
+
placement="top"
|
|
31221
|
+
timing="instant"
|
|
31222
|
+
>
|
|
31223
|
+
<span class="swatch-picker__item">
|
|
31224
|
+
${component.image ? html`<img class="swatch-picker__item-image" src=${component.image} srcset=${component.imageSrcset || nothing} alt="">` : nothing}
|
|
31225
|
+
<span class="swatch-picker__item-indicator"
|
|
31226
|
+
aria-hidden="true"
|
|
31227
|
+
>
|
|
31228
|
+
<span class="swatch-picker__item-indicator-icon">
|
|
31229
|
+
<nldd-icon icon="check-mark-small"></nldd-icon>
|
|
31230
|
+
</span>
|
|
31231
|
+
</span>
|
|
31232
|
+
</span>
|
|
31233
|
+
</nldd-tooltip>
|
|
31234
|
+
`;
|
|
31235
|
+
}
|
|
31236
|
+
// src/components/inputs/swatch-picker/swatch-picker.ts
|
|
31237
|
+
/**
|
|
31238
|
+
* Nederlandse Digitale Dienst Swatch Picker Component (Lit + TypeScript)
|
|
31239
|
+
*
|
|
31240
|
+
* A row of swatches to choose one from: a color, or an image of a pattern or a
|
|
31241
|
+
* material. The row wraps onto the next line when the swatches do not fit.
|
|
31242
|
+
*
|
|
31243
|
+
* It is a radio group: Tab enters and leaves it in one stop, the arrow keys
|
|
31244
|
+
* choose, and the value goes with a form under `name`. The chosen swatch shows
|
|
31245
|
+
* a check mark. Put it in an `nldd-form-field`, which names the group.
|
|
31246
|
+
*
|
|
31247
|
+
* Every swatch needs a name, since a color or an image says nothing to a screen
|
|
31248
|
+
* reader. A swatch with a category `color` takes the name of that color from
|
|
31249
|
+
* the translations ("Rood"); one with a `custom-color` or an `image` has to say
|
|
31250
|
+
* it in `text`. The name shows as a tooltip.
|
|
31251
|
+
*
|
|
31252
|
+
* Exports both NLDDSwatchPicker and NLDDSwatchPickerItem.
|
|
31253
|
+
*
|
|
31254
|
+
* @element nldd-swatch-picker
|
|
31255
|
+
* @attr {string} size - Swatch size, on the control scale: 'xs' (24px) | 'sm' (32px) | 'md' (44px) (default: 'md')
|
|
31256
|
+
* @attr {string} accessible-label - Accessible name for the group, set as aria-label. In an nldd-form-field the field names it.
|
|
31257
|
+
* @attr {string} accessible-labeled-by - Id of an external label element, set as aria-labelledby on the group
|
|
31258
|
+
* @attr {boolean} invalid - Marks the group as invalid. Announced with aria-invalid; nothing is drawn for it.
|
|
31259
|
+
* @attr {boolean} disabled - Disabled state for all swatches
|
|
31260
|
+
* @attr {string} name - Name for form submission
|
|
31261
|
+
* @attr {string} value - Value of the chosen swatch
|
|
31262
|
+
* @attr {boolean} required - Something has to be chosen
|
|
31263
|
+
*
|
|
31264
|
+
* @fires change - When the choice changes; detail: { value: string }
|
|
31265
|
+
*
|
|
31266
|
+
* @slot - nldd-swatch-picker-item elements
|
|
31267
|
+
*
|
|
31268
|
+
* ---
|
|
31269
|
+
*
|
|
31270
|
+
* @element nldd-swatch-picker-item
|
|
31271
|
+
* @attr {string} color - Category color: 'lintblauw' | 'donkerblauw' | 'hemelblauw' | 'lichtblauw' | 'paars' | 'violet' | 'robijnrood' | 'roze' | 'rood' | 'oranje' | 'donkergeel' | 'geel' | 'donkerbruin' | 'bruin' | 'donkergroen' | 'groen' | 'mosgroen' | 'mintgroen'. Brings its name along, so `text` is optional.
|
|
31272
|
+
* @attr {string} custom-color - Any CSS color of your own (e.g. '#7a1f3d' or 'var(--brand-color)'), for a color outside the categories. Needs `text`.
|
|
31273
|
+
* @attr {string} image - URL of an image that fills the swatch, for a pattern or a material. Needs `text`.
|
|
31274
|
+
* @attr {string} image-srcset - Sources of the image at other pixel densities, with x descriptors (e.g. '/oak.jpg 1x, /oak@2x.jpg 2x'). The swatch has a fixed size, so there are no widths to choose from.
|
|
31275
|
+
* @attr {string} text - Name of the swatch, for screen readers and the tooltip. Overrides the name of a category `color`.
|
|
31276
|
+
* @attr {boolean} selected - Whether this swatch is chosen (set by the picker)
|
|
31277
|
+
* @attr {boolean} disabled - Disabled state
|
|
31278
|
+
* @attr {string} value - Value for this swatch
|
|
31279
|
+
* @attr {string} size - Swatch size: 'xs' | 'sm' | 'md' (set by the picker, default: 'md')
|
|
31280
|
+
* @attr {object} translations - Override translation keys (the names of the category colors); unset keys fall back to Dutch.
|
|
31281
|
+
*/
|
|
31282
|
+
var _NLDDSwatchPickerItem;
|
|
31283
|
+
var _NLDDSwatchPicker;
|
|
31284
|
+
/** How long the name stays after a tap, in ms. */
|
|
31285
|
+
var NAME_AFTER_TAP_MS = 1500;
|
|
31286
|
+
var NLDDSwatchPickerItem = (_NLDDSwatchPickerItem = class NLDDSwatchPickerItem extends withTranslations(LitElement, nlddSwatchPickerItemTranslations) {
|
|
31287
|
+
constructor(..._args) {
|
|
31288
|
+
super(..._args);
|
|
31289
|
+
this.color = "";
|
|
31290
|
+
this.customColor = "";
|
|
31291
|
+
this.image = "";
|
|
31292
|
+
this.imageSrcset = "";
|
|
31293
|
+
this.text = "";
|
|
31294
|
+
this.selected = false;
|
|
31295
|
+
this.disabled = false;
|
|
31296
|
+
this.value = "";
|
|
31297
|
+
this.size = "md";
|
|
31298
|
+
this._groupPosition = null;
|
|
31299
|
+
this._appliedLabel = null;
|
|
31300
|
+
this._nameTimer = 0;
|
|
31301
|
+
this._pointerType = "";
|
|
31302
|
+
this._onFocus = () => {
|
|
31303
|
+
this._tooltip?._handleFocusIn();
|
|
31304
|
+
};
|
|
31305
|
+
this._onBlur = () => {
|
|
31306
|
+
this._tooltip?._handleTriggerLeave();
|
|
31307
|
+
};
|
|
31308
|
+
this._onClick = () => {
|
|
31309
|
+
this._select();
|
|
31310
|
+
this._showName();
|
|
31311
|
+
};
|
|
31312
|
+
this._onPointerDown = (e) => {
|
|
31313
|
+
this._pointerType = e.pointerType;
|
|
31314
|
+
if (e.pointerType !== "touch") this._showName();
|
|
31315
|
+
};
|
|
31316
|
+
this._onPointerLeave = (e) => {
|
|
31317
|
+
if (e.pointerType !== "touch") this._hideName();
|
|
31318
|
+
};
|
|
31319
|
+
this._onScroll = () => {
|
|
31320
|
+
this._hideName();
|
|
31321
|
+
};
|
|
31322
|
+
this._onKeyDown = (e) => {
|
|
31323
|
+
if (this.disabled) return;
|
|
31324
|
+
if (e.key === " ") {
|
|
31325
|
+
e.preventDefault();
|
|
31326
|
+
this._select();
|
|
31327
|
+
}
|
|
31328
|
+
};
|
|
31329
|
+
}
|
|
31330
|
+
/** The name of the swatch: its own text, or that of its category color. */
|
|
31331
|
+
get _name() {
|
|
31332
|
+
if (this.text) return this.text;
|
|
31333
|
+
if (!this.color) return "";
|
|
31334
|
+
return this._t(`components.swatch-picker-item.${this.color}-text`);
|
|
31335
|
+
}
|
|
31336
|
+
connectedCallback() {
|
|
31337
|
+
super.connectedCallback();
|
|
31338
|
+
this.addEventListener("pointerdown", this._onPointerDown);
|
|
31339
|
+
this.addEventListener("pointerleave", this._onPointerLeave);
|
|
31340
|
+
this.addEventListener("click", this._onClick);
|
|
31341
|
+
this.addEventListener("keydown", this._onKeyDown);
|
|
31342
|
+
this.addEventListener("focus", this._onFocus);
|
|
31343
|
+
this.addEventListener("blur", this._onBlur);
|
|
31344
|
+
}
|
|
31345
|
+
disconnectedCallback() {
|
|
31346
|
+
super.disconnectedCallback();
|
|
31347
|
+
this.removeEventListener("pointerdown", this._onPointerDown);
|
|
31348
|
+
this.removeEventListener("pointerleave", this._onPointerLeave);
|
|
31349
|
+
this.removeEventListener("click", this._onClick);
|
|
31350
|
+
this.removeEventListener("keydown", this._onKeyDown);
|
|
31351
|
+
this.removeEventListener("focus", this._onFocus);
|
|
31352
|
+
this.removeEventListener("blur", this._onBlur);
|
|
31353
|
+
this._hideName();
|
|
31354
|
+
}
|
|
31355
|
+
updated(changedProperties) {
|
|
31356
|
+
if (changedProperties.has("customColor")) {
|
|
31357
|
+
if (this.customColor && CSS.supports("color", this.customColor)) this.style.setProperty("--_swatch-picker-item-custom-color", this.customColor);
|
|
31358
|
+
else this.style.removeProperty("--_swatch-picker-item-custom-color");
|
|
31359
|
+
}
|
|
31360
|
+
this._syncAria();
|
|
31361
|
+
}
|
|
31362
|
+
/**
|
|
31363
|
+
* The swatch is the radio itself. A native radio in a shadow root of its own
|
|
31364
|
+
* is a group of one: a screen reader counts it as "1 of 1" and Tab stops at
|
|
31365
|
+
* every option. The role on the element puts the group back in one tree,
|
|
31366
|
+
* under the radiogroup the picker carries.
|
|
31367
|
+
*/
|
|
31368
|
+
_syncAria() {
|
|
31369
|
+
this.setAttribute("role", "radio");
|
|
31370
|
+
this.setAttribute("aria-checked", String(this.selected));
|
|
31371
|
+
this._appliedLabel = setOwnedAttribute(this, "aria-label", this._name, this._appliedLabel);
|
|
31372
|
+
if (this.disabled) this.setAttribute("aria-disabled", "true");
|
|
31373
|
+
else this.removeAttribute("aria-disabled");
|
|
31374
|
+
const position = this._groupPosition;
|
|
31375
|
+
if (position) {
|
|
31376
|
+
this.setAttribute("aria-posinset", String(position.posInSet));
|
|
31377
|
+
this.setAttribute("aria-setsize", String(position.setSize));
|
|
31378
|
+
} else {
|
|
31379
|
+
this.removeAttribute("aria-posinset");
|
|
31380
|
+
this.removeAttribute("aria-setsize");
|
|
31381
|
+
}
|
|
31382
|
+
const tabbable = !this.disabled && position?.tabbable !== false;
|
|
31383
|
+
this.setAttribute("tabindex", tabbable ? "0" : "-1");
|
|
31384
|
+
}
|
|
31385
|
+
/** The tooltip, which shows itself when focus moves into it. The focus is on
|
|
31386
|
+
* this element, outside it, so it hears about focus from here. */
|
|
31387
|
+
get _tooltip() {
|
|
31388
|
+
return this.shadowRoot?.querySelector("nldd-tooltip") ?? null;
|
|
31389
|
+
}
|
|
31390
|
+
/** Chosen, the way a click, the space bar or an arrow key in the group does
|
|
31391
|
+
* it. A radio never unchecks itself, so a chosen swatch says nothing.
|
|
31392
|
+
*
|
|
31393
|
+
* @internal */
|
|
31394
|
+
_select() {
|
|
31395
|
+
if (this.disabled || this.selected) return;
|
|
31396
|
+
this.dispatchEvent(new CustomEvent("item-change", {
|
|
31397
|
+
detail: { value: this.value },
|
|
31398
|
+
bubbles: true,
|
|
31399
|
+
composed: true
|
|
31400
|
+
}));
|
|
31401
|
+
}
|
|
31402
|
+
/**
|
|
31403
|
+
* Keeps the name in view after a click or a tap: a click hides a tooltip,
|
|
31404
|
+
* and a tap never shows one, while the name is the only label a swatch has.
|
|
31405
|
+
* After a click it stays until the pointer leaves the swatch. After a tap it
|
|
31406
|
+
* stays a moment, clear of the finger.
|
|
31407
|
+
*/
|
|
31408
|
+
_showName() {
|
|
31409
|
+
const tooltip = this._tooltip;
|
|
31410
|
+
if (!tooltip || !this._name) return;
|
|
31411
|
+
this.closest("nldd-swatch-picker")?.querySelectorAll("nldd-swatch-picker-item").forEach((item) => {
|
|
31412
|
+
if (item !== this) item._hideName();
|
|
31413
|
+
});
|
|
31414
|
+
tooltip.open = true;
|
|
31415
|
+
clearTimeout(this._nameTimer);
|
|
31416
|
+
this._nameTimer = this._pointerType === "touch" ? window.setTimeout(() => this._hideName(), NAME_AFTER_TAP_MS) : 0;
|
|
31417
|
+
document.addEventListener("scroll", this._onScroll, {
|
|
31418
|
+
capture: true,
|
|
31419
|
+
passive: true
|
|
31420
|
+
});
|
|
31421
|
+
}
|
|
31422
|
+
_hideName() {
|
|
31423
|
+
document.removeEventListener("scroll", this._onScroll, { capture: true });
|
|
31424
|
+
clearTimeout(this._nameTimer);
|
|
31425
|
+
this._nameTimer = 0;
|
|
31426
|
+
const tooltip = this._tooltip;
|
|
31427
|
+
if (tooltip) tooltip.open = false;
|
|
31428
|
+
}
|
|
31429
|
+
focus(options) {
|
|
31430
|
+
if (deferFocus(this, options)) return;
|
|
31431
|
+
super.focus(options);
|
|
31432
|
+
}
|
|
31433
|
+
render() {
|
|
31434
|
+
return swatchPickerItemTemplate(this);
|
|
31435
|
+
}
|
|
31436
|
+
}, _NLDDSwatchPickerItem.styles = swatchPickerItemStyles, _NLDDSwatchPickerItem);
|
|
31437
|
+
__decorate([property({
|
|
31438
|
+
reflect: true,
|
|
31439
|
+
converter: reflectNonDefault("")
|
|
31440
|
+
})], NLDDSwatchPickerItem.prototype, "color", void 0);
|
|
31441
|
+
__decorate([property({
|
|
31442
|
+
reflect: true,
|
|
31443
|
+
attribute: "custom-color",
|
|
31444
|
+
converter: reflectNonDefault("")
|
|
31445
|
+
})], NLDDSwatchPickerItem.prototype, "customColor", void 0);
|
|
31446
|
+
__decorate([property({ type: String })], NLDDSwatchPickerItem.prototype, "image", void 0);
|
|
31447
|
+
__decorate([property({
|
|
31448
|
+
type: String,
|
|
31449
|
+
attribute: "image-srcset"
|
|
31450
|
+
})], NLDDSwatchPickerItem.prototype, "imageSrcset", void 0);
|
|
31451
|
+
__decorate([property({
|
|
31452
|
+
reflect: true,
|
|
31453
|
+
converter: reflectNonDefault("")
|
|
31454
|
+
})], NLDDSwatchPickerItem.prototype, "text", void 0);
|
|
31455
|
+
__decorate([property({
|
|
31456
|
+
type: Boolean,
|
|
31457
|
+
reflect: true
|
|
31458
|
+
})], NLDDSwatchPickerItem.prototype, "selected", void 0);
|
|
31459
|
+
__decorate([property({
|
|
31460
|
+
type: Boolean,
|
|
31461
|
+
reflect: true
|
|
31462
|
+
})], NLDDSwatchPickerItem.prototype, "disabled", void 0);
|
|
31463
|
+
__decorate([property({ type: String })], NLDDSwatchPickerItem.prototype, "value", void 0);
|
|
31464
|
+
__decorate([property({
|
|
31465
|
+
reflect: true,
|
|
31466
|
+
converter: reflectNonDefault("md")
|
|
31467
|
+
})], NLDDSwatchPickerItem.prototype, "size", void 0);
|
|
31468
|
+
__decorate([state()], NLDDSwatchPickerItem.prototype, "_groupPosition", void 0);
|
|
31469
|
+
NLDDSwatchPickerItem = __decorate([customElement("nldd-swatch-picker-item")], NLDDSwatchPickerItem);
|
|
31470
|
+
var NLDDSwatchPicker = (_NLDDSwatchPicker = class NLDDSwatchPicker extends FormAssociated(LitElement) {
|
|
31471
|
+
constructor(..._args2) {
|
|
31472
|
+
super(..._args2);
|
|
31473
|
+
this.size = "md";
|
|
31474
|
+
this.accessibleLabel = "";
|
|
31475
|
+
this.accessibleLabeledBy = "";
|
|
31476
|
+
this.invalid = false;
|
|
31477
|
+
this.disabled = false;
|
|
31478
|
+
this.name = "";
|
|
31479
|
+
this.value = "";
|
|
31480
|
+
this.required = false;
|
|
31481
|
+
this._initialValue = "";
|
|
31482
|
+
this._appliedLabel = null;
|
|
31483
|
+
this._handleItemChange = (e) => {
|
|
31484
|
+
e.stopPropagation();
|
|
31485
|
+
if (this.disabled || e.detail.value === this.value) return;
|
|
31486
|
+
this.value = e.detail.value;
|
|
31487
|
+
this._syncItems();
|
|
31488
|
+
this.commitFormValue();
|
|
31489
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
31490
|
+
detail: { value: this.value },
|
|
31491
|
+
bubbles: true,
|
|
31492
|
+
composed: true
|
|
31493
|
+
}));
|
|
31494
|
+
};
|
|
31495
|
+
this._handleKeydown = (e) => {
|
|
31496
|
+
if (this.disabled) return;
|
|
31497
|
+
if (e.key === "Enter") {
|
|
31498
|
+
submitOnEnter(this, e);
|
|
31499
|
+
return;
|
|
31500
|
+
}
|
|
31501
|
+
const items = this._getItems().filter((item) => !item.disabled);
|
|
31502
|
+
if (items.length === 0) return;
|
|
31503
|
+
const current = items.findIndex((item) => item.selected);
|
|
31504
|
+
let next;
|
|
31505
|
+
switch (e.key) {
|
|
31506
|
+
case "ArrowLeft":
|
|
31507
|
+
case "ArrowUp":
|
|
31508
|
+
next = current <= 0 ? items.length - 1 : current - 1;
|
|
31509
|
+
break;
|
|
31510
|
+
case "ArrowRight":
|
|
31511
|
+
case "ArrowDown":
|
|
31512
|
+
next = current >= items.length - 1 ? 0 : current + 1;
|
|
31513
|
+
break;
|
|
31514
|
+
case "Home":
|
|
31515
|
+
next = 0;
|
|
31516
|
+
break;
|
|
31517
|
+
case "End":
|
|
31518
|
+
next = items.length - 1;
|
|
31519
|
+
break;
|
|
31520
|
+
default: return;
|
|
31521
|
+
}
|
|
31522
|
+
e.preventDefault();
|
|
31523
|
+
if (next === current || !items[next]) return;
|
|
31524
|
+
items[next].focus();
|
|
31525
|
+
items[next]._select();
|
|
31526
|
+
};
|
|
31527
|
+
}
|
|
31528
|
+
connectedCallback() {
|
|
31529
|
+
super.connectedCallback();
|
|
31530
|
+
this.setAttribute("role", "radiogroup");
|
|
31531
|
+
this.addEventListener("item-change", this._handleItemChange);
|
|
31532
|
+
this.addEventListener("keydown", this._handleKeydown);
|
|
31533
|
+
}
|
|
31534
|
+
disconnectedCallback() {
|
|
31535
|
+
super.disconnectedCallback();
|
|
31536
|
+
this.removeEventListener("item-change", this._handleItemChange);
|
|
31537
|
+
this.removeEventListener("keydown", this._handleKeydown);
|
|
31538
|
+
}
|
|
31539
|
+
firstUpdated() {
|
|
31540
|
+
this._syncItems();
|
|
31541
|
+
this._initialValue = this.value;
|
|
31542
|
+
}
|
|
31543
|
+
formValue() {
|
|
31544
|
+
return this.value || null;
|
|
31545
|
+
}
|
|
31546
|
+
formResetCallback() {
|
|
31547
|
+
this.value = this._initialValue;
|
|
31548
|
+
}
|
|
31549
|
+
formStateRestoreCallback(state) {
|
|
31550
|
+
if (typeof state === "string") this.value = state;
|
|
31551
|
+
}
|
|
31552
|
+
/** The group has no focus of its own, so an invalid submit lands where Tab
|
|
31553
|
+
* would: on the chosen swatch, or the first one that is enabled. */
|
|
31554
|
+
validationAnchor() {
|
|
31555
|
+
const items = this._getItems().filter((item) => !item.disabled);
|
|
31556
|
+
return items.find((item) => item.selected) ?? items[0];
|
|
31557
|
+
}
|
|
31558
|
+
updated(changedProperties) {
|
|
31559
|
+
if (changedProperties.has("value") || changedProperties.has("size") || changedProperties.has("disabled") || changedProperties.has("required") || changedProperties.has("invalid")) this._syncItems();
|
|
31560
|
+
if (changedProperties.has("value")) this.commitFormValue();
|
|
31561
|
+
if (changedProperties.has("accessibleLabel")) this._appliedLabel = setOwnedAttribute(this, "aria-label", this.accessibleLabel, this._appliedLabel);
|
|
31562
|
+
if (changedProperties.has("accessibleLabeledBy")) {
|
|
31563
|
+
if (this.accessibleLabeledBy) this.setAttribute("aria-labelledby", this.accessibleLabeledBy);
|
|
31564
|
+
else this.removeAttribute("aria-labelledby");
|
|
31565
|
+
}
|
|
31566
|
+
}
|
|
31567
|
+
_getItems() {
|
|
31568
|
+
const slot = this.shadowRoot?.querySelector("slot");
|
|
31569
|
+
if (!slot) return [];
|
|
31570
|
+
return slot.assignedElements().filter((el) => el.localName === "nldd-swatch-picker-item");
|
|
31571
|
+
}
|
|
31572
|
+
_syncItems() {
|
|
31573
|
+
const items = this._getItems();
|
|
31574
|
+
this.toggleAttribute("aria-required", this.required);
|
|
31575
|
+
if (this.invalid) this.setAttribute("aria-invalid", "true");
|
|
31576
|
+
else this.removeAttribute("aria-invalid");
|
|
31577
|
+
for (const item of items) {
|
|
31578
|
+
if (this.disabled && !item.hasAttribute("disabled")) {
|
|
31579
|
+
item.setAttribute("group-disabled", "");
|
|
31580
|
+
item.disabled = true;
|
|
31581
|
+
} else if (!this.disabled && item.hasAttribute("group-disabled")) {
|
|
31582
|
+
item.removeAttribute("group-disabled");
|
|
31583
|
+
item.disabled = false;
|
|
31584
|
+
}
|
|
31585
|
+
item.size = this.size;
|
|
31586
|
+
item.selected = !!this.value && item.value === this.value;
|
|
31587
|
+
}
|
|
31588
|
+
const positions = radioPositions(items, (item) => item.selected, (item) => item.disabled);
|
|
31589
|
+
items.forEach((item, index) => {
|
|
31590
|
+
item._groupPosition = positions[index] ?? null;
|
|
31591
|
+
});
|
|
31592
|
+
}
|
|
31593
|
+
/** @internal */
|
|
31594
|
+
_onSlotChange() {
|
|
31595
|
+
this._syncItems();
|
|
31596
|
+
}
|
|
31597
|
+
/** Focus goes to the chosen swatch, or the first enabled one: where Tab lands. */
|
|
31598
|
+
focus(options) {
|
|
31599
|
+
if (deferFocus(this, options)) return;
|
|
31600
|
+
const items = this._getItems().filter((item) => !item.disabled);
|
|
31601
|
+
(items.find((item) => item.selected) ?? items[0])?.focus(options);
|
|
31602
|
+
}
|
|
31603
|
+
render() {
|
|
31604
|
+
return swatchPickerTemplate(this);
|
|
31605
|
+
}
|
|
31606
|
+
}, _NLDDSwatchPicker.styles = swatchPickerStyles, _NLDDSwatchPicker.isFormInput = true, _NLDDSwatchPicker);
|
|
31607
|
+
__decorate([property({
|
|
31608
|
+
reflect: true,
|
|
31609
|
+
converter: reflectNonDefault("md")
|
|
31610
|
+
})], NLDDSwatchPicker.prototype, "size", void 0);
|
|
31611
|
+
__decorate([property({
|
|
31612
|
+
type: String,
|
|
31613
|
+
attribute: "accessible-label"
|
|
31614
|
+
})], NLDDSwatchPicker.prototype, "accessibleLabel", void 0);
|
|
31615
|
+
__decorate([property({
|
|
31616
|
+
type: String,
|
|
31617
|
+
attribute: "accessible-labeled-by"
|
|
31618
|
+
})], NLDDSwatchPicker.prototype, "accessibleLabeledBy", void 0);
|
|
31619
|
+
__decorate([property({
|
|
31620
|
+
type: Boolean,
|
|
31621
|
+
reflect: true
|
|
31622
|
+
})], NLDDSwatchPicker.prototype, "invalid", void 0);
|
|
31623
|
+
__decorate([property({
|
|
31624
|
+
type: Boolean,
|
|
31625
|
+
reflect: true
|
|
31626
|
+
})], NLDDSwatchPicker.prototype, "disabled", void 0);
|
|
31627
|
+
__decorate([property({
|
|
31628
|
+
reflect: true,
|
|
31629
|
+
converter: reflectNonDefault("")
|
|
31630
|
+
})], NLDDSwatchPicker.prototype, "name", void 0);
|
|
31631
|
+
__decorate([property({
|
|
31632
|
+
type: String,
|
|
31633
|
+
reflect: true
|
|
31634
|
+
})], NLDDSwatchPicker.prototype, "value", void 0);
|
|
31635
|
+
__decorate([property({
|
|
31636
|
+
type: Boolean,
|
|
31637
|
+
reflect: true
|
|
31638
|
+
})], NLDDSwatchPicker.prototype, "required", void 0);
|
|
31639
|
+
NLDDSwatchPicker = __decorate([customElement("nldd-swatch-picker")], NLDDSwatchPicker);
|
|
30984
31640
|
// src/components/inputs/stepper/stepper.styles.ts
|
|
30985
31641
|
var stepperStyles = css`
|
|
30986
31642
|
:host {
|
|
@@ -31278,11 +31934,11 @@ var switchStyles = css`
|
|
|
31278
31934
|
--_switch-border-width: var(--primitives-border-width-regular);
|
|
31279
31935
|
--_switch-border-color: light-dark(var(--primitives-color-neutral-550), var(--primitives-color-neutral-650));
|
|
31280
31936
|
--_switch-background-color: var(--semantics-surfaces-base-background-color);
|
|
31281
|
-
--_switch-is-selected-background-color: var(--
|
|
31937
|
+
--_switch-is-selected-background-color: var(--semantics-controls-is-selected-indicator-color);
|
|
31282
31938
|
--_switch-thumb-border-width: var(--primitives-border-width-regular);
|
|
31283
31939
|
--_switch-thumb-border-color: light-dark(var(--primitives-color-neutral-550), var(--primitives-color-neutral-650));
|
|
31284
31940
|
--_switch-thumb-background-color: var(--semantics-surfaces-base-background-color);
|
|
31285
|
-
--_switch-is-selected-thumb-background-color: var(--
|
|
31941
|
+
--_switch-is-selected-thumb-background-color: var(--semantics-controls-is-selected-mark-color);
|
|
31286
31942
|
|
|
31287
31943
|
display: inline-block;
|
|
31288
31944
|
position: relative;
|
|
@@ -31437,11 +32093,6 @@ function switchTemplate(component) {
|
|
|
31437
32093
|
* Prefer nldd-switch-field for labeled usage — it combines the switch with a visible label.
|
|
31438
32094
|
* Direct use of nldd-switch requires an accessible-label attribute for screen reader accessibility.
|
|
31439
32095
|
*
|
|
31440
|
-
* On a selected row of nldd-list-item a checked control takes the colors of the
|
|
31441
|
-
* row: the row sets `--context-selected-indicator-color` and
|
|
31442
|
-
* `--context-selected-contrast-color`, because the accent can fall below 3:1 on
|
|
31443
|
-
* the gray of a selected row.
|
|
31444
|
-
*
|
|
31445
32096
|
* @element nldd-switch
|
|
31446
32097
|
* @attr {boolean} checked - Whether the switch is on/off
|
|
31447
32098
|
* @attr {boolean} disabled - Disabled state
|
|
@@ -43443,7 +44094,7 @@ var sliderStyles = css`
|
|
|
43443
44094
|
--_slider-track-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-150));
|
|
43444
44095
|
--_slider-track-border-color: light-dark(var(--primitives-color-neutral-100), var(--primitives-color-neutral-200));
|
|
43445
44096
|
--_slider-track-border-width: var(--primitives-border-width-thin);
|
|
43446
|
-
--_slider-fill-color: var(--
|
|
44097
|
+
--_slider-fill-color: var(--semantics-controls-is-selected-indicator-color);
|
|
43447
44098
|
--_slider-fill-highlight-border-color: var(--semantics-controls-is-selected-indicator-highlight-border-color);
|
|
43448
44099
|
--_slider-thumb-size: var(--primitives-space-28);
|
|
43449
44100
|
--_slider-thumb-hit-size: var(--_slider-control-height);
|
|
@@ -43464,7 +44115,7 @@ var sliderStyles = css`
|
|
|
43464
44115
|
--_slider-histogram-bar-corner-radius: var(--primitives-space-2);
|
|
43465
44116
|
--_slider-histogram-bar-height: 0;
|
|
43466
44117
|
--_slider-tooltip-offset: var(--primitives-space-8);
|
|
43467
|
-
--_slider-tooltip-touch-offset: var(--
|
|
44118
|
+
--_slider-tooltip-touch-offset: calc(var(--semantics-fingertip-size) / 2);
|
|
43468
44119
|
--_slider-tooltip-shift: 0px;
|
|
43469
44120
|
--_slider-tooltip-background-color: var(--semantics-tooltips-background-color);
|
|
43470
44121
|
--_slider-tooltip-content-color: var(--semantics-tooltips-content-color);
|
|
@@ -43631,6 +44282,15 @@ var sliderStyles = css`
|
|
|
43631
44282
|
z-index: 2;
|
|
43632
44283
|
}
|
|
43633
44284
|
|
|
44285
|
+
.slider__input:focus {
|
|
44286
|
+
z-index: 3;
|
|
44287
|
+
}
|
|
44288
|
+
|
|
44289
|
+
.slider__control.is-holding-start .slider__input--start,
|
|
44290
|
+
.slider__control.is-holding-end .slider__input--end {
|
|
44291
|
+
z-index: 4;
|
|
44292
|
+
}
|
|
44293
|
+
|
|
43634
44294
|
.slider__control.is-stacked .slider__input::-webkit-slider-thumb {
|
|
43635
44295
|
pointer-events: none;
|
|
43636
44296
|
}
|
|
@@ -43681,21 +44341,27 @@ var sliderStyles = css`
|
|
|
43681
44341
|
height: var(--_slider-thumb-hit-size);
|
|
43682
44342
|
}
|
|
43683
44343
|
|
|
44344
|
+
/* While a thumb is held, the native :hover and :active stay on the input a
|
|
44345
|
+
drag began on, also once it has passed the other thumb and drags that. */
|
|
43684
44346
|
@media (hover: hover) {
|
|
43685
|
-
.slider__input::-webkit-slider-thumb:hover {
|
|
44347
|
+
.slider__control:not(.is-holding) .slider__input::-webkit-slider-thumb:hover {
|
|
43686
44348
|
--_slider-thumb-border-color: var(--_slider-thumb-is-hovered-border-color);
|
|
43687
44349
|
}
|
|
43688
44350
|
|
|
43689
|
-
.slider__input::-moz-range-thumb:hover {
|
|
44351
|
+
.slider__control:not(.is-holding) .slider__input::-moz-range-thumb:hover {
|
|
43690
44352
|
--_slider-thumb-border-color: var(--_slider-thumb-is-hovered-border-color);
|
|
43691
44353
|
}
|
|
43692
44354
|
}
|
|
43693
44355
|
|
|
43694
|
-
.slider__input
|
|
44356
|
+
.slider__control.is-holding-value .slider__input--value::-webkit-slider-thumb,
|
|
44357
|
+
.slider__control.is-holding-start .slider__input--start::-webkit-slider-thumb,
|
|
44358
|
+
.slider__control.is-holding-end .slider__input--end::-webkit-slider-thumb {
|
|
43695
44359
|
--_slider-thumb-border-color: var(--_slider-thumb-is-active-border-color);
|
|
43696
44360
|
}
|
|
43697
44361
|
|
|
43698
|
-
.slider__input
|
|
44362
|
+
.slider__control.is-holding-value .slider__input--value::-moz-range-thumb,
|
|
44363
|
+
.slider__control.is-holding-start .slider__input--start::-moz-range-thumb,
|
|
44364
|
+
.slider__control.is-holding-end .slider__input--end::-moz-range-thumb {
|
|
43699
44365
|
--_slider-thumb-border-color: var(--_slider-thumb-is-active-border-color);
|
|
43700
44366
|
}
|
|
43701
44367
|
|
|
@@ -43867,6 +44533,10 @@ function sliderTemplate(component) {
|
|
|
43867
44533
|
"slider__control": true,
|
|
43868
44534
|
"has-histogram": component.histogram.length > 0,
|
|
43869
44535
|
"is-active": component._active,
|
|
44536
|
+
"is-holding": !!component._held,
|
|
44537
|
+
"is-holding-value": component._held === "value",
|
|
44538
|
+
"is-holding-start": component._held === "start",
|
|
44539
|
+
"is-holding-end": component._held === "end",
|
|
43870
44540
|
"is-start-on-top": startOnTop,
|
|
43871
44541
|
"is-stacked": range && start === end
|
|
43872
44542
|
})}
|
|
@@ -43919,8 +44589,11 @@ function sliderTemplate(component) {
|
|
|
43919
44589
|
* Page Down, Home and End), touch, the form and a screen reader work as they do
|
|
43920
44590
|
* for any slider. A range is two of them over each other, each with its own
|
|
43921
44591
|
* name for a screen reader ("Prijs, minimum"), and a press on the track moves
|
|
43922
|
-
* the nearer thumb there.
|
|
43923
|
-
*
|
|
44592
|
+
* the nearer thumb there. A thumb dragged or moved with an arrow key (also
|
|
44593
|
+
* with Shift) past the other one becomes that end of the range, and focus goes with it, so its name
|
|
44594
|
+
* still says which end it is. Home, End, Page Up and Page Down stop at the
|
|
44595
|
+
* other thumb, so they never turn the range around. Where the thumbs lie on
|
|
44596
|
+
* one value, the first move picks one, to the left the start one.
|
|
43924
44597
|
*
|
|
43925
44598
|
* The value shows in a tooltip above the thumb while the pointer is over the
|
|
43926
44599
|
* slider or its icons, while a thumb has keyboard focus and while it or an icon
|
|
@@ -44016,16 +44689,26 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44016
44689
|
this.translations = {};
|
|
44017
44690
|
this.formatValue = null;
|
|
44018
44691
|
this._active = false;
|
|
44692
|
+
this._held = null;
|
|
44019
44693
|
this._initial = {};
|
|
44020
44694
|
this._resizeObserver = null;
|
|
44021
44695
|
this._trackThumb = null;
|
|
44022
44696
|
this._stackedPress = null;
|
|
44697
|
+
this._dragInput = null;
|
|
44698
|
+
this._dragThumb = null;
|
|
44699
|
+
this._arrowKey = false;
|
|
44023
44700
|
this._handlePointerDown = (event) => {
|
|
44024
44701
|
if (this.disabled || event.button !== 0) return;
|
|
44025
44702
|
this._active = true;
|
|
44026
44703
|
window.addEventListener("pointerup", this._handlePointerUp, { once: true });
|
|
44027
44704
|
window.addEventListener("pointercancel", this._handlePointerUp, { once: true });
|
|
44028
44705
|
const target = event.target;
|
|
44706
|
+
this._arrowKey = false;
|
|
44707
|
+
if (target.matches(".slider__input")) this._held = target.matches(".slider__input--start") ? "start" : target.matches(".slider__input--end") ? "end" : "value";
|
|
44708
|
+
if (this.range && target.matches(".slider__input")) {
|
|
44709
|
+
this._dragInput = target;
|
|
44710
|
+
this._dragThumb = this._held;
|
|
44711
|
+
}
|
|
44029
44712
|
if (!this.range || !target.closest(".slider__control") || target.matches(".slider__input")) return;
|
|
44030
44713
|
window.addEventListener("pointermove", this._handleTrackMove);
|
|
44031
44714
|
event.preventDefault();
|
|
@@ -44049,7 +44732,8 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44049
44732
|
this._stackedPress = null;
|
|
44050
44733
|
}
|
|
44051
44734
|
if (!this._trackThumb) return;
|
|
44052
|
-
this._set(this._trackThumb, this._valueAt(event.clientX));
|
|
44735
|
+
const landed = this._set(this._trackThumb, this._valueAt(event.clientX), void 0, true);
|
|
44736
|
+
if (landed !== this._trackThumb && landed !== "value") this._grab(landed);
|
|
44053
44737
|
this._emit("input");
|
|
44054
44738
|
};
|
|
44055
44739
|
this._handlePointerUp = () => {
|
|
@@ -44182,7 +44866,17 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44182
44866
|
/** @internal */
|
|
44183
44867
|
_handleInput(event, thumb) {
|
|
44184
44868
|
event.stopPropagation();
|
|
44185
|
-
|
|
44869
|
+
const input = event.target;
|
|
44870
|
+
const dragged = input === this._dragInput && this._dragThumb;
|
|
44871
|
+
const moved = dragged || thumb;
|
|
44872
|
+
const landed = this._set(moved, parseFloat(input.value), input, !!dragged || this._arrowKey);
|
|
44873
|
+
if (landed !== moved && landed !== "value") {
|
|
44874
|
+
if (dragged) {
|
|
44875
|
+
this._dragThumb = landed;
|
|
44876
|
+
this._held = landed;
|
|
44877
|
+
}
|
|
44878
|
+
this._focusThumb(landed);
|
|
44879
|
+
}
|
|
44186
44880
|
this._emit("input");
|
|
44187
44881
|
}
|
|
44188
44882
|
/** @internal */
|
|
@@ -44200,6 +44894,13 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44200
44894
|
* takes one step for it.
|
|
44201
44895
|
* @internal */
|
|
44202
44896
|
_handleKeyDown(event, thumb) {
|
|
44897
|
+
const arrow = [
|
|
44898
|
+
"ArrowUp",
|
|
44899
|
+
"ArrowDown",
|
|
44900
|
+
"ArrowLeft",
|
|
44901
|
+
"ArrowRight"
|
|
44902
|
+
].includes(event.key);
|
|
44903
|
+
this._arrowKey = arrow && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
44203
44904
|
if (!event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
44204
44905
|
const rtl = getComputedStyle(this).direction === "rtl";
|
|
44205
44906
|
const direction = {
|
|
@@ -44210,16 +44911,18 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44210
44911
|
}[event.key];
|
|
44211
44912
|
if (!direction) return;
|
|
44212
44913
|
event.preventDefault();
|
|
44213
|
-
this._page(thumb, direction);
|
|
44914
|
+
this._page(thumb, direction, true);
|
|
44214
44915
|
}
|
|
44215
44916
|
/** Moves a thumb a tenth of the range, at least one step, the jump the
|
|
44216
44917
|
* native input takes on Page Up and Page Down. */
|
|
44217
|
-
_page(thumb, direction) {
|
|
44918
|
+
_page(thumb, direction, pass = false) {
|
|
44218
44919
|
const page = Math.max(this.step > 0 ? this.step : 1, (this.max - this.min) / 10);
|
|
44219
|
-
const current = () => thumb === "value" ? this._value :
|
|
44920
|
+
const current = () => thumb === "value" ? this._value : [this._start, this._end].join();
|
|
44220
44921
|
const before = current();
|
|
44221
44922
|
const input = this.shadowRoot?.querySelector(`.slider__input--${thumb}`) ?? void 0;
|
|
44222
|
-
this.
|
|
44923
|
+
const from = thumb === "value" ? this._value : thumb === "start" ? this._start : this._end;
|
|
44924
|
+
const landed = this._set(thumb, from + direction * page, input, pass);
|
|
44925
|
+
if (landed !== thumb && landed !== "value") this._focusThumb(landed);
|
|
44223
44926
|
if (current() === before) return;
|
|
44224
44927
|
this._emit("input");
|
|
44225
44928
|
this._emit("change");
|
|
@@ -44227,6 +44930,10 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44227
44930
|
/** Makes a thumb the one a press drags, and gives it focus. */
|
|
44228
44931
|
_grab(thumb) {
|
|
44229
44932
|
this._trackThumb = thumb;
|
|
44933
|
+
this._held = thumb;
|
|
44934
|
+
this._focusThumb(thumb);
|
|
44935
|
+
}
|
|
44936
|
+
_focusThumb(thumb) {
|
|
44230
44937
|
this.shadowRoot?.querySelector(`.slider__input--${thumb}`)?.focus();
|
|
44231
44938
|
}
|
|
44232
44939
|
/** Ends a press: its listeners on the window, and the thumb it drags. */
|
|
@@ -44236,6 +44943,9 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44236
44943
|
window.removeEventListener("pointercancel", this._handlePointerUp);
|
|
44237
44944
|
this._trackThumb = null;
|
|
44238
44945
|
this._stackedPress = null;
|
|
44946
|
+
this._dragInput = null;
|
|
44947
|
+
this._dragThumb = null;
|
|
44948
|
+
this._held = null;
|
|
44239
44949
|
}
|
|
44240
44950
|
/** Where the middle of the native thumb runs: from `start` over `length`
|
|
44241
44951
|
* pixels, in the direction of the text, and how wide it takes a press. */
|
|
@@ -44264,16 +44974,38 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
|
|
|
44264
44974
|
const fraction = this._fraction(this._start);
|
|
44265
44975
|
return Math.abs(x - (start + length * (rtl ? 1 - fraction : fraction))) <= hit / 2;
|
|
44266
44976
|
}
|
|
44267
|
-
/** Sets a thumb
|
|
44268
|
-
*
|
|
44269
|
-
|
|
44977
|
+
/** Sets a thumb and puts the native inputs back where the values landed.
|
|
44978
|
+
* With `pass`, a thumb moved past the other one becomes the other end of
|
|
44979
|
+
* the range, and the other thumb takes its place; without, it stops at the
|
|
44980
|
+
* other thumb. Returns the end the value landed on. */
|
|
44981
|
+
_set(thumb, raw, input, pass = false) {
|
|
44270
44982
|
const value = this._snap(raw);
|
|
44271
|
-
|
|
44272
|
-
if (thumb === "
|
|
44273
|
-
|
|
44274
|
-
|
|
44275
|
-
|
|
44983
|
+
let landed = thumb;
|
|
44984
|
+
if (thumb === "value") {
|
|
44985
|
+
this.value = value;
|
|
44986
|
+
if (input && parseFloat(input.value) !== value) input.value = String(value);
|
|
44987
|
+
} else {
|
|
44988
|
+
const start = this._start;
|
|
44989
|
+
const end = this._end;
|
|
44990
|
+
if (thumb === "start" && value > end && pass) [this.startValue, this.endValue, landed] = [
|
|
44991
|
+
end,
|
|
44992
|
+
value,
|
|
44993
|
+
"end"
|
|
44994
|
+
];
|
|
44995
|
+
else if (thumb === "end" && value < start && pass) [this.startValue, this.endValue, landed] = [
|
|
44996
|
+
value,
|
|
44997
|
+
start,
|
|
44998
|
+
"start"
|
|
44999
|
+
];
|
|
45000
|
+
else if (thumb === "start") this.startValue = Math.min(value, end);
|
|
45001
|
+
else this.endValue = Math.max(value, start);
|
|
45002
|
+
for (const el of this._inputs ?? []) {
|
|
45003
|
+
const settled = el.classList.contains("slider__input--start") ? this._start : this._end;
|
|
45004
|
+
if (parseFloat(el.value) !== settled) el.value = String(settled);
|
|
45005
|
+
}
|
|
45006
|
+
}
|
|
44276
45007
|
this.commitFormValue();
|
|
45008
|
+
return landed;
|
|
44277
45009
|
}
|
|
44278
45010
|
_emit(type) {
|
|
44279
45011
|
const detail = this.range ? {
|
|
@@ -44346,6 +45078,7 @@ __decorate([property({ type: Number })], NLDDSlider.prototype, "step", void 0);
|
|
|
44346
45078
|
__decorate([property({ type: Object })], NLDDSlider.prototype, "translations", void 0);
|
|
44347
45079
|
__decorate([property({ attribute: false })], NLDDSlider.prototype, "formatValue", void 0);
|
|
44348
45080
|
__decorate([state()], NLDDSlider.prototype, "_active", void 0);
|
|
45081
|
+
__decorate([state()], NLDDSlider.prototype, "_held", void 0);
|
|
44349
45082
|
__decorate([queryAll(".slider__input")], NLDDSlider.prototype, "_inputs", void 0);
|
|
44350
45083
|
NLDDSlider = __decorate([customElement("nldd-slider")], NLDDSlider);
|
|
44351
45084
|
// src/components/layout/shell/shell.styles.ts
|
|
@@ -46892,7 +47625,7 @@ var heroStyles = css`
|
|
|
46892
47625
|
|
|
46893
47626
|
@container (max-width: ${smMax$12}) {
|
|
46894
47627
|
padding-inline: var(--semantics-page-sections-sm-margin-inline);
|
|
46895
|
-
padding-top: var(--_hero-sm-padding-top, var(--_hero-padding-top, var(--semantics-page-sections-sm-margin-block)));
|
|
47628
|
+
padding-top: var(--_hero-sm-padding-top, var(--_hero-padding-top, calc(var(--semantics-page-sections-sm-margin-block) / 2)));
|
|
46896
47629
|
padding-bottom: var(--_hero-sm-padding-bottom, var(--_hero-padding-bottom, var(--semantics-page-sections-sm-margin-block)));
|
|
46897
47630
|
}
|
|
46898
47631
|
|
|
@@ -51258,6 +51991,12 @@ var pageFooterStyles = css`
|
|
|
51258
51991
|
padding-top: calc(var(--primitives-space-16) + var(--_page-footer-ribbon-height));
|
|
51259
51992
|
}
|
|
51260
51993
|
|
|
51994
|
+
:host([single-slot]:not([no-ribbon])) .page-footer__body > div:not([hidden]) {
|
|
51995
|
+
@container (max-width: ${smMax$3}) {
|
|
51996
|
+
padding-block: var(--primitives-space-32);
|
|
51997
|
+
}
|
|
51998
|
+
}
|
|
51999
|
+
|
|
51261
52000
|
.page-footer__breadcrumbs[hidden],
|
|
51262
52001
|
.page-footer__main[hidden],
|
|
51263
52002
|
.page-footer__legal-bar[hidden],
|
|
@@ -51291,7 +52030,7 @@ var pageFooterLegalBarStyles = css`
|
|
|
51291
52030
|
.page-footer__legal-bar {
|
|
51292
52031
|
display: flex;
|
|
51293
52032
|
flex-wrap: wrap;
|
|
51294
|
-
row-gap: var(--primitives-space-
|
|
52033
|
+
row-gap: var(--primitives-space-8);
|
|
51295
52034
|
column-gap: var(--primitives-space-16);
|
|
51296
52035
|
align-items: flex-start;
|
|
51297
52036
|
justify-content: space-between;
|
|
@@ -51300,14 +52039,16 @@ var pageFooterLegalBarStyles = css`
|
|
|
51300
52039
|
.page-footer__legal-bar-start {
|
|
51301
52040
|
display: flex;
|
|
51302
52041
|
flex-wrap: wrap;
|
|
51303
|
-
gap: var(--primitives-space-
|
|
52042
|
+
row-gap: var(--primitives-space-8);
|
|
52043
|
+
column-gap: var(--primitives-space-12);
|
|
51304
52044
|
order: 0;
|
|
51305
52045
|
}
|
|
51306
52046
|
|
|
51307
52047
|
.page-footer__legal-bar-end {
|
|
51308
52048
|
display: flex;
|
|
51309
52049
|
flex-wrap: wrap;
|
|
51310
|
-
gap: var(--primitives-space-
|
|
52050
|
+
row-gap: var(--primitives-space-8);
|
|
52051
|
+
column-gap: var(--primitives-space-12);
|
|
51311
52052
|
order: 1;
|
|
51312
52053
|
}
|
|
51313
52054
|
|
|
@@ -52132,6 +52873,9 @@ var TOUCH_HOLD_MS = 300;
|
|
|
52132
52873
|
/** How close to an edge the pointer scrolls the board or a column, and how fast. */
|
|
52133
52874
|
var SCROLL_EDGE = 48;
|
|
52134
52875
|
var SCROLL_SPEED = 12;
|
|
52876
|
+
/** How long the pointer rests on a column cut off at a side before the board
|
|
52877
|
+
* brings the whole column into view. */
|
|
52878
|
+
var COLUMN_REVEAL_DELAY_MS = 300;
|
|
52135
52879
|
/** How long the note at an item a readonly board did not move stays. */
|
|
52136
52880
|
var DENIED_MS = 1500;
|
|
52137
52881
|
/** How long the pointer stays outside the board before the copy says it goes back. */
|
|
@@ -52206,6 +52950,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52206
52950
|
return;
|
|
52207
52951
|
}
|
|
52208
52952
|
this._move(item, from, fromIndex, to, Math.min(fromIndex, to.items.length));
|
|
52953
|
+
requestAnimationFrame(() => this._revealColumn(to));
|
|
52209
52954
|
};
|
|
52210
52955
|
this._onPointerDown = (event) => {
|
|
52211
52956
|
if (this._press || this._drag || !event.isPrimary || event.button !== 0) return;
|
|
@@ -52281,6 +53026,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52281
53026
|
left: dx,
|
|
52282
53027
|
behavior: "instant"
|
|
52283
53028
|
});
|
|
53029
|
+
this._followColumnReveal(dx !== 0);
|
|
52284
53030
|
const main = drag.target?._main;
|
|
52285
53031
|
if (main) {
|
|
52286
53032
|
const rect = main.getBoundingClientRect();
|
|
@@ -52490,7 +53236,9 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52490
53236
|
index: 0,
|
|
52491
53237
|
frame: requestAnimationFrame(this._scrollLoop),
|
|
52492
53238
|
note: null,
|
|
52493
|
-
noteTimer: 0
|
|
53239
|
+
noteTimer: 0,
|
|
53240
|
+
columnToReveal: null,
|
|
53241
|
+
columnRevealTimer: 0
|
|
52494
53242
|
};
|
|
52495
53243
|
this._follow();
|
|
52496
53244
|
}
|
|
@@ -52562,6 +53310,50 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52562
53310
|
const y = drag.y - drag.offsetY;
|
|
52563
53311
|
drag.note.style.transform = `translate(${x}px, ${y}px) translate(-50%, calc(-100% - var(--primitives-space-8)))`;
|
|
52564
53312
|
}
|
|
53313
|
+
/** At an edge the board scrolls on; away from it, the column under the
|
|
53314
|
+
* pointer comes fully into view once the pointer rests on it a moment. */
|
|
53315
|
+
_followColumnReveal(atEdge) {
|
|
53316
|
+
const drag = this._drag;
|
|
53317
|
+
if (!drag) return;
|
|
53318
|
+
const column = atEdge ? null : drag.target;
|
|
53319
|
+
if (column === drag.columnToReveal) return;
|
|
53320
|
+
clearTimeout(drag.columnRevealTimer);
|
|
53321
|
+
drag.columnRevealTimer = 0;
|
|
53322
|
+
drag.columnToReveal = column;
|
|
53323
|
+
if (!column || this._columnRevealLeft(column) === void 0) return;
|
|
53324
|
+
drag.columnRevealTimer = window.setTimeout(() => {
|
|
53325
|
+
if (this._drag === drag && drag.columnToReveal === column) this._revealColumn(column);
|
|
53326
|
+
}, COLUMN_REVEAL_DELAY_MS);
|
|
53327
|
+
}
|
|
53328
|
+
/** The smallest scroll that shows all of a column clear of the fade, or
|
|
53329
|
+
* nothing when it is in view already; a column wider than the board shows
|
|
53330
|
+
* its start. The smallest, so the column stays under the pointer. */
|
|
53331
|
+
_columnRevealLeft(column) {
|
|
53332
|
+
const el = this._scroller;
|
|
53333
|
+
const styles = getComputedStyle(el);
|
|
53334
|
+
const insetStart = parseFloat(styles.getPropertyValue("--_task-board-fade-size")) || 0;
|
|
53335
|
+
const insetEnd = insetStart;
|
|
53336
|
+
const current = el.scrollLeft;
|
|
53337
|
+
const rect = column.getBoundingClientRect();
|
|
53338
|
+
const offset = el.getBoundingClientRect().left - current;
|
|
53339
|
+
const start = rect.left - offset - insetStart;
|
|
53340
|
+
const end = rect.right - offset + insetEnd - el.clientWidth;
|
|
53341
|
+
let left;
|
|
53342
|
+
if (start < current - 1 || end > start) left = start;
|
|
53343
|
+
else if (end > current + 1) left = end;
|
|
53344
|
+
else return void 0;
|
|
53345
|
+
left = Math.round(Math.min(el.scrollWidth - el.clientWidth, Math.max(0, left)));
|
|
53346
|
+
return Math.abs(left - current) > 1 ? left : void 0;
|
|
53347
|
+
}
|
|
53348
|
+
_revealColumn(column) {
|
|
53349
|
+
const left = this._columnRevealLeft(column);
|
|
53350
|
+
if (left === void 0) return;
|
|
53351
|
+
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
53352
|
+
this._scroller.scrollTo({
|
|
53353
|
+
left,
|
|
53354
|
+
behavior: reduce ? "instant" : "smooth"
|
|
53355
|
+
});
|
|
53356
|
+
}
|
|
52565
53357
|
_drop() {
|
|
52566
53358
|
const drag = this._drag;
|
|
52567
53359
|
if (!drag) return;
|
|
@@ -52587,6 +53379,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52587
53379
|
if (!drag) return;
|
|
52588
53380
|
cancelAnimationFrame(drag.frame);
|
|
52589
53381
|
clearTimeout(drag.noteTimer);
|
|
53382
|
+
clearTimeout(drag.columnRevealTimer);
|
|
52590
53383
|
drag.note?.remove();
|
|
52591
53384
|
drag.ghost.remove();
|
|
52592
53385
|
drag.item.removeAttribute("data-task-board-dragging");
|
|
@@ -52874,7 +53667,7 @@ var listItemSegmentStyles = css`
|
|
|
52874
53667
|
}
|
|
52875
53668
|
`;
|
|
52876
53669
|
// src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts
|
|
52877
|
-
function template$
|
|
53670
|
+
function template$10(control, href, target, rel, download, checked, expanded, current, disabled, accessibleLabel, actionTabindex, popupType, popoverTargetElement, popoverTargetAction, linkHint = "") {
|
|
52878
53671
|
const content = html`<slot></slot>`;
|
|
52879
53672
|
const ariaExpanded = expanded === void 0 ? popupType ? "false" : nothing : String(expanded);
|
|
52880
53673
|
const ariaCurrent = current ?? nothing;
|
|
@@ -52929,7 +53722,10 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
|
|
|
52929
53722
|
e.stopPropagation();
|
|
52930
53723
|
return;
|
|
52931
53724
|
}
|
|
52932
|
-
if (this._control instanceof HTMLButtonElement)
|
|
53725
|
+
if (this._control instanceof HTMLButtonElement) {
|
|
53726
|
+
this._control.popoverTargetElement = popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
|
|
53727
|
+
anchorPopoverTarget(this, this._control.popoverTargetElement);
|
|
53728
|
+
}
|
|
52933
53729
|
this._control?.focus();
|
|
52934
53730
|
if (this._controlType !== "checkbox") return;
|
|
52935
53731
|
if (!e.composedPath().includes(this._control)) return;
|
|
@@ -52973,6 +53769,7 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
|
|
|
52973
53769
|
}
|
|
52974
53770
|
disconnectedCallback() {
|
|
52975
53771
|
super.disconnectedCallback();
|
|
53772
|
+
anchorPopoverTarget(this, null);
|
|
52976
53773
|
this.removeEventListener("focusin", this._handleFocusIn);
|
|
52977
53774
|
this.removeEventListener("focusout", this._handleFocusOut);
|
|
52978
53775
|
this.removeEventListener("click", this._handleClick);
|
|
@@ -53007,13 +53804,14 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
|
|
|
53007
53804
|
* row's, for a disclosure segment) that CSS cannot see. A host class is the
|
|
53008
53805
|
* hook — the same mechanism nldd-list already uses for .is-boxed / .is-first. */
|
|
53009
53806
|
updated() {
|
|
53807
|
+
anchorPopoverTarget(this, popoverTargetOf(this, this.popovertarget, this.popoverTargetElement));
|
|
53010
53808
|
const expanded = this.disclosure ? this._rowExpanded : this.expanded;
|
|
53011
53809
|
this.classList.toggle("is-expanded", expanded === true);
|
|
53012
53810
|
}
|
|
53013
53811
|
render() {
|
|
53014
53812
|
const hintKey = this._controlType === "link" ? downloadLinkHintKey(this.href, this.target, this.download) : null;
|
|
53015
53813
|
if (this._controlType === "link") markDownloadTarget(this, this.download, this.target);
|
|
53016
|
-
return template$
|
|
53814
|
+
return template$10(this._controlType, this.href, this.target, this.rel, this.download, this.checked, this.disclosure ? this._rowExpanded : this.expanded, this.current ? this.currentType : void 0, this.disabled, this.accessibleLabel, this._tabbable === void 0 ? void 0 : this._tabbable ? "0" : "-1", this.popupType, popoverTargetOf(this, this.popovertarget, this.popoverTargetElement), this.popoverTargetAction, hintKey ? this._t(`components.list-item-segment.${hintKey}`) : "");
|
|
53017
53815
|
}
|
|
53018
53816
|
};
|
|
53019
53817
|
var NLDDListItemSegment = (_NLDDListItemSegment.styles = [listItemSegmentStyles], _NLDDListItemSegment);
|
|
@@ -53751,7 +54549,7 @@ function renderTitle(component) {
|
|
|
53751
54549
|
?hidden=${isHidden}
|
|
53752
54550
|
>${fallback}<slot @slotchange=${component._onSlotChange}></slot></p>`;
|
|
53753
54551
|
}
|
|
53754
|
-
var template$
|
|
54552
|
+
var template$9 = function() {
|
|
53755
54553
|
return html`
|
|
53756
54554
|
<p
|
|
53757
54555
|
class="title-cell__overline"
|
|
@@ -53883,7 +54681,7 @@ var _NLDDTitleCell = class NLDDTitleCell extends RowHeaderMixin(VisibilityMixin(
|
|
|
53883
54681
|
else this.style.removeProperty("--_title-cell-min-height");
|
|
53884
54682
|
}
|
|
53885
54683
|
render() {
|
|
53886
|
-
return template$
|
|
54684
|
+
return template$9.call(this);
|
|
53887
54685
|
}
|
|
53888
54686
|
};
|
|
53889
54687
|
var NLDDTitleCell = (_NLDDTitleCell.styles = [titleCellStyles], _NLDDTitleCell);
|
|
@@ -54073,7 +54871,7 @@ var descriptionCellStyles = css`
|
|
|
54073
54871
|
}
|
|
54074
54872
|
`;
|
|
54075
54873
|
// src/components/lists-and-tables/cells/description-cell/description-cell.template.ts
|
|
54076
|
-
var template$
|
|
54874
|
+
var template$8 = () => html`
|
|
54077
54875
|
<slot name="title"></slot>
|
|
54078
54876
|
<slot name="description"></slot>
|
|
54079
54877
|
`;
|
|
@@ -54124,7 +54922,7 @@ var _NLDDDescriptionCell = class NLDDDescriptionCell extends RowHeaderMixin(Visi
|
|
|
54124
54922
|
else this.style.removeProperty("--_description-cell-min-height");
|
|
54125
54923
|
}
|
|
54126
54924
|
render() {
|
|
54127
|
-
return template$
|
|
54925
|
+
return template$8();
|
|
54128
54926
|
}
|
|
54129
54927
|
};
|
|
54130
54928
|
var NLDDDescriptionCell = (_NLDDDescriptionCell.styles = [descriptionCellStyles], _NLDDDescriptionCell);
|
|
@@ -54328,7 +55126,7 @@ var gripSm = svg`
|
|
|
54328
55126
|
/>
|
|
54329
55127
|
</svg>
|
|
54330
55128
|
`;
|
|
54331
|
-
function template$
|
|
55129
|
+
function template$7(size, label) {
|
|
54332
55130
|
return html`
|
|
54333
55131
|
<button class="drag-handle-cell__control"
|
|
54334
55132
|
type="button"
|
|
@@ -54376,7 +55174,7 @@ var _NLDDDragHandleCell = class NLDDDragHandleCell extends LitElement {
|
|
|
54376
55174
|
}
|
|
54377
55175
|
render() {
|
|
54378
55176
|
const label = this._t("components.drag-handle-cell.accessible-label");
|
|
54379
|
-
return template$
|
|
55177
|
+
return template$7(this.size, label);
|
|
54380
55178
|
}
|
|
54381
55179
|
};
|
|
54382
55180
|
var NLDDDragHandleCell = (_NLDDDragHandleCell.styles = dragHandleCellStyles, _NLDDDragHandleCell);
|
|
@@ -54988,7 +55786,7 @@ var menuBarStyles = css`
|
|
|
54988
55786
|
}
|
|
54989
55787
|
`;
|
|
54990
55788
|
// src/components/navigation/menu-bar/menu-bar.template.ts
|
|
54991
|
-
function template$
|
|
55789
|
+
function template$6(component) {
|
|
54992
55790
|
return html`
|
|
54993
55791
|
<nav class="menu-bar"
|
|
54994
55792
|
aria-label=${component.accessibleLabel || nothing}
|
|
@@ -55224,7 +56022,7 @@ var menuBarItemStyles = css`
|
|
|
55224
56022
|
}
|
|
55225
56023
|
`;
|
|
55226
56024
|
// src/components/navigation/menu-bar-item/menu-bar-item.template.ts
|
|
55227
|
-
function template$
|
|
56025
|
+
function template$5(component) {
|
|
55228
56026
|
const safeHref = sanitizeUrl(component.href);
|
|
55229
56027
|
const isLink = Boolean(safeHref);
|
|
55230
56028
|
const hasIcon = Boolean(component.icon) || component._hasSlottedIcon;
|
|
@@ -55454,7 +56252,7 @@ var _NLDDMenuBarItem = class NLDDMenuBarItem extends LitElement {
|
|
|
55454
56252
|
else this._menu.showPopover();
|
|
55455
56253
|
}
|
|
55456
56254
|
render() {
|
|
55457
|
-
return template$
|
|
56255
|
+
return template$5(this);
|
|
55458
56256
|
}
|
|
55459
56257
|
};
|
|
55460
56258
|
var NLDDMenuBarItem = (_NLDDMenuBarItem.styles = menuBarItemStyles, _NLDDMenuBarItem);
|
|
@@ -55758,7 +56556,7 @@ var _NLDDMenuBar = class NLDDMenuBar extends withTranslations(LitElement, nlddMe
|
|
|
55758
56556
|
}
|
|
55759
56557
|
}
|
|
55760
56558
|
render() {
|
|
55761
|
-
return template$
|
|
56559
|
+
return template$6(this);
|
|
55762
56560
|
}
|
|
55763
56561
|
};
|
|
55764
56562
|
var NLDDMenuBar = (_NLDDMenuBar.styles = menuBarStyles, _NLDDMenuBar);
|
|
@@ -55935,7 +56733,7 @@ var linkStyles = css`
|
|
|
55935
56733
|
}
|
|
55936
56734
|
`;
|
|
55937
56735
|
// src/components/navigation/link/link.template.ts
|
|
55938
|
-
function template$
|
|
56736
|
+
function template$4(helpers) {
|
|
55939
56737
|
const resolvedRel = linkRel(this.rel, this.target);
|
|
55940
56738
|
const hintKey = this.disabled ? null : downloadLinkHintKey(this.href, this.target, this.download);
|
|
55941
56739
|
if (this.href) markDownloadTarget(this, this.download, this.target);
|
|
@@ -56026,7 +56824,7 @@ var _NLDDLink = class NLDDLink extends withTranslations(LitElement, nlddLinkTran
|
|
|
56026
56824
|
}
|
|
56027
56825
|
}
|
|
56028
56826
|
render() {
|
|
56029
|
-
return template$
|
|
56827
|
+
return template$4.call(this, {
|
|
56030
56828
|
handleClick: this._handleClick.bind(this),
|
|
56031
56829
|
handleSlotChange: this._handleSlotChange.bind(this)
|
|
56032
56830
|
});
|
|
@@ -56072,6 +56870,145 @@ __decorate([property({
|
|
|
56072
56870
|
__decorate([state()], NLDDLink.prototype, "_hasStartSlot", void 0);
|
|
56073
56871
|
__decorate([state()], NLDDLink.prototype, "_hasEndSlot", void 0);
|
|
56074
56872
|
NLDDLink = __decorate([customElement("nldd-link")], NLDDLink);
|
|
56873
|
+
// src/components/navigation/link-group/link-group.styles.ts
|
|
56874
|
+
var linkGroupStyles = css`
|
|
56875
|
+
|
|
56876
|
+
|
|
56877
|
+
/* # Host */
|
|
56878
|
+
|
|
56879
|
+
:host {
|
|
56880
|
+
--_link-group-flex-direction: row;
|
|
56881
|
+
--_link-group-flex-wrap: wrap;
|
|
56882
|
+
--_link-group-row-gap: var(--primitives-space-12);
|
|
56883
|
+
--_link-group-column-gap: var(--primitives-space-16);
|
|
56884
|
+
--_link-group-align-items: baseline;
|
|
56885
|
+
--_link-group-justify-content: flex-start;
|
|
56886
|
+
|
|
56887
|
+
box-sizing: border-box;
|
|
56888
|
+
display: block;
|
|
56889
|
+
}
|
|
56890
|
+
|
|
56891
|
+
:host([size="xs"]),
|
|
56892
|
+
:host([size="sm"]) {
|
|
56893
|
+
--_link-group-row-gap: var(--primitives-space-8);
|
|
56894
|
+
--_link-group-column-gap: var(--primitives-space-12);
|
|
56895
|
+
}
|
|
56896
|
+
|
|
56897
|
+
:host([orientation="vertical"]) {
|
|
56898
|
+
--_link-group-flex-direction: column;
|
|
56899
|
+
--_link-group-flex-wrap: nowrap;
|
|
56900
|
+
--_link-group-align-items: flex-start;
|
|
56901
|
+
}
|
|
56902
|
+
|
|
56903
|
+
:host([horizontal-alignment="center"]) {
|
|
56904
|
+
--_link-group-justify-content: center;
|
|
56905
|
+
}
|
|
56906
|
+
|
|
56907
|
+
:host([horizontal-alignment="center"][orientation="vertical"]) {
|
|
56908
|
+
--_link-group-align-items: center;
|
|
56909
|
+
}
|
|
56910
|
+
|
|
56911
|
+
:host([hidden]) {
|
|
56912
|
+
display: none;
|
|
56913
|
+
}
|
|
56914
|
+
|
|
56915
|
+
|
|
56916
|
+
/* # Block */
|
|
56917
|
+
|
|
56918
|
+
.link-group__items {
|
|
56919
|
+
display: flex;
|
|
56920
|
+
flex-direction: var(--_link-group-flex-direction);
|
|
56921
|
+
flex-wrap: var(--_link-group-flex-wrap);
|
|
56922
|
+
row-gap: var(--_link-group-row-gap);
|
|
56923
|
+
column-gap: var(--_link-group-column-gap);
|
|
56924
|
+
align-items: var(--_link-group-align-items);
|
|
56925
|
+
justify-content: var(--_link-group-justify-content);
|
|
56926
|
+
}
|
|
56927
|
+
|
|
56928
|
+
:host([horizontal-alignment="center"]) .link-group__items {
|
|
56929
|
+
text-align: center;
|
|
56930
|
+
}
|
|
56931
|
+
`;
|
|
56932
|
+
// src/components/navigation/link-group/link-group.template.ts
|
|
56933
|
+
function template$3(component) {
|
|
56934
|
+
return html`
|
|
56935
|
+
<nav class="link-group"
|
|
56936
|
+
aria-label=${component.accessibleLabel || nothing}
|
|
56937
|
+
>
|
|
56938
|
+
<div class="link-group__items"
|
|
56939
|
+
role="list"
|
|
56940
|
+
>
|
|
56941
|
+
<slot @slotchange=${component._handleSlotChange}></slot>
|
|
56942
|
+
</div>
|
|
56943
|
+
</nav>
|
|
56944
|
+
`;
|
|
56945
|
+
}
|
|
56946
|
+
// src/components/navigation/link-group/link-group.ts
|
|
56947
|
+
/**
|
|
56948
|
+
* Nederlandse Digitale Dienst Link Group Component (Lit + TypeScript)
|
|
56949
|
+
*
|
|
56950
|
+
* A set of related `nldd-link` elements, such as the links under the name of a
|
|
56951
|
+
* service in a footer or the links to the other parts of a site. The links sit
|
|
56952
|
+
* in a row that wraps onto the next line when they do not fit, or stacked with
|
|
56953
|
+
* `orientation="vertical"`. With `horizontal-alignment="center"` the whole set
|
|
56954
|
+
* is centered, line by line, so a short list reads as one cloud in the middle.
|
|
56955
|
+
*
|
|
56956
|
+
* The group is a `nav` landmark with the links as a list, so a screen reader
|
|
56957
|
+
* says how many there are. Give it an `accessible-label` as soon as a page has
|
|
56958
|
+
* more than one `nav`, so each landmark can be told apart.
|
|
56959
|
+
*
|
|
56960
|
+
* The group sets its `size` on every link in it: links in one group are the
|
|
56961
|
+
* same size.
|
|
56962
|
+
*
|
|
56963
|
+
* @element nldd-link-group
|
|
56964
|
+
* @attr {string} size - Text size, set on every link in it: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
|
|
56965
|
+
* @attr {string} orientation - Layout direction: 'horizontal' (a row that wraps) | 'vertical' (default: 'horizontal')
|
|
56966
|
+
* @attr {string} horizontal-alignment - Alignment of the links: 'left' | 'center' (default: 'left')
|
|
56967
|
+
* @attr {string} accessible-label - Accessible name of the nav landmark
|
|
56968
|
+
*
|
|
56969
|
+
* @slot - nldd-link elements
|
|
56970
|
+
*/
|
|
56971
|
+
var _NLDDLinkGroup = class NLDDLinkGroup extends LitElement {
|
|
56972
|
+
constructor(..._args) {
|
|
56973
|
+
super(..._args);
|
|
56974
|
+
this.size = "md";
|
|
56975
|
+
this.orientation = "horizontal";
|
|
56976
|
+
this.horizontalAlignment = "left";
|
|
56977
|
+
this.accessibleLabel = "";
|
|
56978
|
+
}
|
|
56979
|
+
/** @internal */
|
|
56980
|
+
_handleSlotChange() {
|
|
56981
|
+
const assigned = this._slot.assignedElements({ flatten: true });
|
|
56982
|
+
markListItems(assigned);
|
|
56983
|
+
for (const el of assigned) el.setAttribute("size", this.size);
|
|
56984
|
+
}
|
|
56985
|
+
updated(changedProperties) {
|
|
56986
|
+
if (changedProperties.has("size") && this._slot) this._handleSlotChange();
|
|
56987
|
+
}
|
|
56988
|
+
render() {
|
|
56989
|
+
return template$3(this);
|
|
56990
|
+
}
|
|
56991
|
+
};
|
|
56992
|
+
var NLDDLinkGroup = (_NLDDLinkGroup.styles = linkGroupStyles, _NLDDLinkGroup);
|
|
56993
|
+
__decorate([property({
|
|
56994
|
+
reflect: true,
|
|
56995
|
+
converter: reflectNonDefault("md")
|
|
56996
|
+
})], NLDDLinkGroup.prototype, "size", void 0);
|
|
56997
|
+
__decorate([property({
|
|
56998
|
+
reflect: true,
|
|
56999
|
+
converter: reflectNonDefault("horizontal")
|
|
57000
|
+
})], NLDDLinkGroup.prototype, "orientation", void 0);
|
|
57001
|
+
__decorate([property({
|
|
57002
|
+
attribute: "horizontal-alignment",
|
|
57003
|
+
reflect: true,
|
|
57004
|
+
converter: reflectNonDefault("left")
|
|
57005
|
+
})], NLDDLinkGroup.prototype, "horizontalAlignment", void 0);
|
|
57006
|
+
__decorate([property({
|
|
57007
|
+
type: String,
|
|
57008
|
+
attribute: "accessible-label"
|
|
57009
|
+
})], NLDDLinkGroup.prototype, "accessibleLabel", void 0);
|
|
57010
|
+
__decorate([query("slot")], NLDDLinkGroup.prototype, "_slot", void 0);
|
|
57011
|
+
NLDDLinkGroup = __decorate([customElement("nldd-link-group")], NLDDLinkGroup);
|
|
56075
57012
|
// src/components/navigation/skip-link/skip-link.styles.ts
|
|
56076
57013
|
var skipLinkStyles = css`
|
|
56077
57014
|
:host {
|
|
@@ -56482,6 +57419,9 @@ var topNavigationBarStyles = css`
|
|
|
56482
57419
|
display: grid;
|
|
56483
57420
|
grid-column: 2 / 4;
|
|
56484
57421
|
grid-template-columns: subgrid;
|
|
57422
|
+
/* Safari keeps the height of a columns-only subgrid when its width
|
|
57423
|
+
changes; taking the row from the bar too makes it measure again. */
|
|
57424
|
+
grid-template-rows: subgrid;
|
|
56485
57425
|
align-items: center;
|
|
56486
57426
|
}
|
|
56487
57427
|
|
|
@@ -56536,11 +57476,9 @@ var topNavigationBarStyles = css`
|
|
|
56536
57476
|
|
|
56537
57477
|
/* The distance the text keeps from the top edge once it outgrows the
|
|
56538
57478
|
ribbon. Only at the top: space under it would raise the bar for
|
|
56539
|
-
nothing.
|
|
56540
|
-
on the middle of the ribbon rather than 8px below it. */
|
|
57479
|
+
nothing. */
|
|
56541
57480
|
@container (max-width: ${smMax$2}) {
|
|
56542
57481
|
align-self: start;
|
|
56543
|
-
min-height: calc(var(--_top-navigation-bar-logo-height) - var(--primitives-space-16));
|
|
56544
57482
|
padding-block-start: var(--primitives-space-16);
|
|
56545
57483
|
}
|
|
56546
57484
|
}
|
|
@@ -56568,14 +57506,14 @@ var topNavigationBarStyles = css`
|
|
|
56568
57506
|
ellipsis cannot be read at all. */
|
|
56569
57507
|
overflow-wrap: anywhere;
|
|
56570
57508
|
|
|
56571
|
-
/*
|
|
57509
|
+
/* On the bottom of the ribbon, and what does not fit grows downward: an
|
|
56572
57510
|
auto margin takes positive free space and never negative, so the text
|
|
56573
57511
|
cannot ride up past the top. Growing is the flex item's job here, and
|
|
56574
|
-
an item that grows leaves nothing for the
|
|
57512
|
+
an item that grows leaves nothing for the margin to push with. */
|
|
56575
57513
|
@container (max-width: ${smMax$2}) {
|
|
56576
57514
|
flex-grow: 0;
|
|
56577
57515
|
flex-basis: auto;
|
|
56578
|
-
margin-block: auto;
|
|
57516
|
+
margin-block-start: auto;
|
|
56579
57517
|
}
|
|
56580
57518
|
}
|
|
56581
57519
|
|
|
@@ -57062,7 +58000,7 @@ async function loadDependencies() {
|
|
|
57062
58000
|
Promise.resolve().then(() => list_item_exports),
|
|
57063
58001
|
Promise.resolve().then(() => text_cell_exports),
|
|
57064
58002
|
Promise.resolve().then(() => icon_cell_exports),
|
|
57065
|
-
import("./icon-
|
|
58003
|
+
import("./icon-BQjRjtKH.js").then((n) => n.n)
|
|
57066
58004
|
]);
|
|
57067
58005
|
}
|
|
57068
58006
|
/** The rows of a level, read from its container: the global menu bar's items
|
|
@@ -65445,4 +66383,4 @@ __decorate([property({
|
|
|
65445
66383
|
attribute: "no-arrow"
|
|
65446
66384
|
})], NLDDJustInTimeEducation.prototype, "noArrow", void 0);
|
|
65447
66385
|
NLDDJustInTimeEducation = _NLDDJustInTimeEducation = __decorate([customElement("nldd-just-in-time-education")], NLDDJustInTimeEducation);
|
|
65448
|
-
export { NLDDActivityIndicator, NLDDAvatar, NLDDAvatarGroup, NLDDBadge, NLDDBanner, NLDDBarSplitView, NLDDBlockquote, NLDDBox, NLDDBreadcrumbs, NLDDBreadcrumbsItem, NLDDButton, NLDDButtonBar, NLDDButtonGroup, NLDDCard, NLDDCell, NLDDCheckbox, NLDDCheckboxField, NLDDCodeEditor, NLDDCodeViewer, NLDDCollection, NLDDComboBox, NLDDContainer, NLDDDateField, NLDDDatePicker, NLDDDescriptionCell, NLDDDivider, NLDDDocumentTabBar, NLDDDragHandleCell, NLDDDropdown, NLDDFileField, NLDDForm, NLDDFormActions, NLDDFormField, NLDDFormSection, NLDDFullBleedSection, NLDDHero, NLDDIcon, NLDDIconButton, NLDDIconCell, NLDDIdentity, NLDDImage, NLDDInlineDialog, NLDDJustInTimeEducation, NLDDKeyboardShortcut, NLDDLink, NLDDList, NLDDListItem, NLDDListItemSegment, NLDDMenu, NLDDMenuBar, NLDDMenuBarItem, NLDDModalDialog, NLDDMultiLineTextField, NLDDNavigationSplitView, NLDDNotification, NLDDNumberField, NLDDOneHalfOneHalfSection, NLDDOneThirdTwoThirdsSection, NLDDPage, NLDDPageFooter, NLDDPageFooterLegalBar, NLDDPageFooterLegalBarItem, NLDDPagination, NLDDPasswordField, NLDDPopover, NLDDProgressBar, NLDDProgressBarSegmentIndicator, NLDDProgressCircle, NLDDProgressCircleSegmentIndicator, NLDDRadioButton, NLDDRadioButtonField, NLDDRadioButtonGroup, NLDDRichText, NLDDSearchField, NLDDSegmentedControl, NLDDSheet, NLDDShell, NLDDSideBySideSplitView, NLDDSidebarSection, NLDDSimpleSection, NLDDSkipLink, NLDDSlider, NLDDSpacer, NLDDSpacerCell, NLDDSplitButton, NLDDSplitViewDivider, NLDDSplitViewPane, NLDDStackedSplitView, NLDDStatusBar, NLDDStepBar, NLDDStepBarItem, NLDDStepCell, NLDDStepper, NLDDSwitch, NLDDSwitchField, NLDDTabBar, NLDDTable, NLDDTableRow, NLDDTag, NLDDTaskBoard, NLDDTaskBoardColumn, NLDDText, NLDDTextCell, NLDDTextEditor, NLDDTextField, NLDDTimeField, NLDDTimePicker, NLDDTitle, NLDDTitleCell, NLDDToggleButton, NLDDToggleButtonGroup, NLDDToken, NLDDTokenField, NLDDToolbar, NLDDTooltip, NLDDTopNavigationBar, NLDDTopTitleBar, NLDDTwoThirdsOneThirdSection, NLDDValidationList, NLDDVisuallyHidden, NLDDWindow, setTranslations };
|
|
66386
|
+
export { NLDDActivityIndicator, NLDDAvatar, NLDDAvatarGroup, NLDDBadge, NLDDBanner, NLDDBarSplitView, NLDDBlockquote, NLDDBox, NLDDBreadcrumbs, NLDDBreadcrumbsItem, NLDDButton, NLDDButtonBar, NLDDButtonGroup, NLDDCard, NLDDCell, NLDDCheckbox, NLDDCheckboxField, NLDDCodeEditor, NLDDCodeViewer, NLDDCollection, NLDDComboBox, NLDDContainer, NLDDDateField, NLDDDatePicker, NLDDDescriptionCell, NLDDDivider, NLDDDocumentTabBar, NLDDDragHandleCell, NLDDDropdown, NLDDFileField, NLDDForm, NLDDFormActions, NLDDFormField, NLDDFormSection, NLDDFullBleedSection, NLDDHero, NLDDIcon, NLDDIconButton, NLDDIconCell, NLDDIdentity, NLDDImage, NLDDInlineDialog, NLDDJustInTimeEducation, NLDDKeyboardShortcut, NLDDLink, NLDDLinkGroup, NLDDList, NLDDListItem, NLDDListItemSegment, NLDDMenu, NLDDMenuBar, NLDDMenuBarItem, NLDDModalDialog, NLDDMultiLineTextField, NLDDNavigationSplitView, NLDDNotification, NLDDNumberField, NLDDOneHalfOneHalfSection, NLDDOneThirdTwoThirdsSection, NLDDPage, NLDDPageFooter, NLDDPageFooterLegalBar, NLDDPageFooterLegalBarItem, NLDDPagination, NLDDPasswordField, NLDDPopover, NLDDProgressBar, NLDDProgressBarSegmentIndicator, NLDDProgressCircle, NLDDProgressCircleSegmentIndicator, NLDDRadioButton, NLDDRadioButtonField, NLDDRadioButtonGroup, NLDDRichText, NLDDSearchField, NLDDSegmentedControl, NLDDSheet, NLDDShell, NLDDSideBySideSplitView, NLDDSidebarSection, NLDDSimpleSection, NLDDSkipLink, NLDDSlider, NLDDSpacer, NLDDSpacerCell, NLDDSplitButton, NLDDSplitViewDivider, NLDDSplitViewPane, NLDDStackedSplitView, NLDDStatusBar, NLDDStepBar, NLDDStepBarItem, NLDDStepCell, NLDDStepper, NLDDSwatchPicker, NLDDSwatchPickerItem, NLDDSwitch, NLDDSwitchField, NLDDTabBar, NLDDTable, NLDDTableRow, NLDDTag, NLDDTaskBoard, NLDDTaskBoardColumn, NLDDText, NLDDTextCell, NLDDTextEditor, NLDDTextField, NLDDTimeField, NLDDTimePicker, NLDDTitle, NLDDTitleCell, NLDDToggleButton, NLDDToggleButtonGroup, NLDDToken, NLDDTokenField, NLDDToolbar, NLDDTooltip, NLDDTopNavigationBar, NLDDTopTitleBar, NLDDTwoThirdsOneThirdSection, NLDDValidationList, NLDDVisuallyHidden, NLDDWindow, setTranslations };
|