@nldd/design-system 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1376 -415
- package/dist/components/components.js +1438 -356
- package/dist/components/content/blockquote/blockquote.d.ts +11 -1
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +39 -0
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.styles.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.styles.js +42 -1
- package/dist/components/content/blockquote/blockquote.styles.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +7 -0
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.js +393 -393
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/icon/icon.template.js +1 -1
- package/dist/components/content/text/text.d.ts +21 -3
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +41 -1
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/text/text.styles.d.ts +2 -1
- package/dist/components/content/text/text.styles.d.ts.map +1 -1
- package/dist/components/content/text/text.styles.js +88 -2
- package/dist/components/content/text/text.styles.js.map +1 -1
- package/dist/components/content/title/title.d.ts +1 -3
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +5 -79
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/{decorate-CtaxGuuh.js → decorate-D2HtKmpx.js} +1 -1
- package/dist/components/{defer-focus-CC5RVvh6.js → defer-focus-JRj1EYUV.js} +2 -2
- package/dist/components/{dev-checks-a7fZ6hgC.js → dev-checks-BPjCXw_r.js} +109 -12
- package/dist/components/icon-DU_IMj2t.js +968 -0
- package/dist/components/{icon-button-DJPpMxWn.js → icon-button-BgeikVnm.js} +3 -3
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +172 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js +447 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.d.ts +2 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.d.ts.map +1 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js +188 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js.map +1 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.d.ts +4 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.d.ts.map +1 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js +64 -0
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js.map +1 -0
- package/dist/components/inputs/search-field/search-field.d.ts +4 -2
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +5 -4
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.js +4 -3
- package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +14 -0
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +51 -1
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.js +21 -1
- package/dist/components/inputs/text-field/text-field.styles.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.template.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.template.js +5 -0
- package/dist/components/inputs/text-field/text-field.template.js.map +1 -1
- package/dist/components/{just-in-time-education.i18n-S05IOgqk.js → just-in-time-education.i18n-eCghRteQ.js} +10 -10
- package/dist/components/layout/{task-board/task-board-column.d.ts → column-board/column-board-column.d.ts} +5 -5
- package/dist/components/layout/column-board/column-board-column.d.ts.map +1 -0
- package/dist/components/layout/{task-board/task-board-column.js → column-board/column-board-column.js} +34 -34
- package/dist/components/layout/column-board/column-board-column.js.map +1 -0
- package/dist/components/layout/column-board/column-board-column.template.d.ts +3 -0
- package/dist/components/layout/column-board/column-board-column.template.d.ts.map +1 -0
- package/dist/components/layout/{task-board/task-board-column.template.js → column-board/column-board-column.template.js} +10 -10
- package/dist/components/layout/column-board/column-board-column.template.js.map +1 -0
- package/dist/components/layout/{task-board/task-board.d.ts → column-board/column-board.d.ts} +21 -21
- package/dist/components/layout/column-board/column-board.d.ts.map +1 -0
- package/dist/components/layout/column-board/column-board.i18n.d.ts +11 -0
- package/dist/components/layout/column-board/column-board.i18n.d.ts.map +1 -0
- package/dist/components/layout/column-board/column-board.i18n.js +10 -0
- package/dist/components/layout/column-board/column-board.i18n.js.map +1 -0
- package/dist/components/layout/{task-board/task-board.js → column-board/column-board.js} +43 -43
- package/dist/components/layout/column-board/column-board.js.map +1 -0
- package/dist/components/layout/column-board/column-board.styles.d.ts +3 -0
- package/dist/components/layout/column-board/column-board.styles.d.ts.map +1 -0
- package/dist/components/layout/column-board/column-board.styles.js +260 -0
- package/dist/components/layout/column-board/column-board.styles.js.map +1 -0
- package/dist/components/layout/column-board/column-board.template.d.ts +3 -0
- package/dist/components/layout/column-board/column-board.template.d.ts.map +1 -0
- package/dist/components/layout/{task-board/task-board.template.js → column-board/column-board.template.js} +5 -5
- package/dist/components/layout/column-board/column-board.template.js.map +1 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +5 -2
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +15 -3
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- 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 +5 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/{nl.generated-CUo20aPV.js → nl.generated-B0pvf8VH.js} +2 -2
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +12 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +32 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.js +59 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.js +4 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +15 -8
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +30 -12
- package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.d.ts +7 -2
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.js +31 -19
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.js.map +1 -1
- package/dist/components/{visibility-mixin-CwMutpAK.js → visibility-mixin-Dti3xE8R.js} +1 -1
- package/dist/nldd.min.js +2256 -1815
- package/dist/translations/en-US.js +7 -7
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.js +7 -7
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +7 -7
- package/dist/translations/nl.generated.js +2 -2
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.js +7 -7
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.js +7 -7
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +129 -50
- package/dist/utilities/custom-font-size.d.ts +19 -0
- package/dist/utilities/custom-font-size.d.ts.map +1 -0
- package/dist/utilities/custom-font-size.js +90 -0
- package/dist/utilities/custom-font-size.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +7 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +23 -0
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +94 -14
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/file-drag-and-drop.js +1 -1
- package/dist/utilities/file-drag-and-drop.js.map +1 -1
- package/dist/utilities/status-bar-change.d.ts +7 -0
- package/dist/utilities/status-bar-change.d.ts.map +1 -0
- package/dist/utilities/status-bar-change.js +7 -0
- package/dist/utilities/status-bar-change.js.map +1 -0
- package/lint/data.generated.json +1 -1
- package/package.json +9 -5
- package/dist/components/icon-Bkdlj87q.js +0 -968
- package/dist/components/layout/task-board/task-board-column.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board-column.js.map +0 -1
- package/dist/components/layout/task-board/task-board-column.template.d.ts +0 -3
- package/dist/components/layout/task-board/task-board-column.template.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board-column.template.js.map +0 -1
- package/dist/components/layout/task-board/task-board.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board.i18n.d.ts +0 -11
- package/dist/components/layout/task-board/task-board.i18n.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board.i18n.js +0 -10
- package/dist/components/layout/task-board/task-board.i18n.js.map +0 -1
- package/dist/components/layout/task-board/task-board.js.map +0 -1
- package/dist/components/layout/task-board/task-board.styles.d.ts +0 -3
- package/dist/components/layout/task-board/task-board.styles.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board.styles.js +0 -260
- package/dist/components/layout/task-board/task-board.styles.js.map +0 -1
- package/dist/components/layout/task-board/task-board.template.d.ts +0 -3
- package/dist/components/layout/task-board/task-board.template.d.ts.map +0 -1
- package/dist/components/layout/task-board/task-board.template.js.map +0 -1
|
@@ -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-D2HtKmpx.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-JRj1EYUV.js";
|
|
5
5
|
import { n as internalsOf, r as setState$1 } from "./element-state-BnarBv0M.js";
|
|
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-
|
|
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-BgeikVnm.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-DU_IMj2t.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 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
|
|
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 nlddColumnBoardTranslations, z as nlddDatePickerTranslations } from "./just-in-time-education.i18n-eCghRteQ.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-Dti3xE8R.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";
|
|
@@ -7115,8 +7115,105 @@ __decorate([property({ type: String })], NLDDAvatar.prototype, "target", void 0)
|
|
|
7115
7115
|
__decorate([property({ type: String })], NLDDAvatar.prototype, "rel", void 0);
|
|
7116
7116
|
__decorate([state()], NLDDAvatar.prototype, "_imageFailed", void 0);
|
|
7117
7117
|
NLDDAvatar = __decorate([customElement("nldd-avatar")], NLDDAvatar);
|
|
7118
|
+
// src/utilities/custom-font-size.ts
|
|
7119
|
+
/**
|
|
7120
|
+
* A font size of your own per breakpoint, for a component that otherwise takes
|
|
7121
|
+
* its size from the scale (`sm-custom-size`, `md-custom-size`, `lg-custom-size`).
|
|
7122
|
+
* The component writes each valid value into `--_{prefix}-{breakpoint}-custom-size`
|
|
7123
|
+
* and marks the host with `data-{breakpoint}-custom-size`; its styles put the
|
|
7124
|
+
* value inside a max() with its own size, so it never shows smaller.
|
|
7125
|
+
*/
|
|
7126
|
+
var BREAKPOINTS = [
|
|
7127
|
+
"sm",
|
|
7128
|
+
"md",
|
|
7129
|
+
"lg"
|
|
7130
|
+
];
|
|
7131
|
+
/** The font size of display size 1 per breakpoint: the floor of a custom size on nldd-title and nldd-text. */
|
|
7132
|
+
var DISPLAY_1_FONT_SIZE = {
|
|
7133
|
+
sm: "var(--primitives-font-size-700)",
|
|
7134
|
+
md: "var(--primitives-font-size-800)",
|
|
7135
|
+
lg: "var(--primitives-font-size-1000)"
|
|
7136
|
+
};
|
|
7137
|
+
/** Font-size values that are not a length: the CSS-wide keywords and the
|
|
7138
|
+
* absolute and relative size keywords. */
|
|
7139
|
+
var NOT_A_LENGTH = /* @__PURE__ */ new Set([
|
|
7140
|
+
"inherit",
|
|
7141
|
+
"initial",
|
|
7142
|
+
"unset",
|
|
7143
|
+
"revert",
|
|
7144
|
+
"revert-layer",
|
|
7145
|
+
"xx-small",
|
|
7146
|
+
"x-small",
|
|
7147
|
+
"small",
|
|
7148
|
+
"medium",
|
|
7149
|
+
"large",
|
|
7150
|
+
"x-large",
|
|
7151
|
+
"xx-large",
|
|
7152
|
+
"xxx-large",
|
|
7153
|
+
"larger",
|
|
7154
|
+
"smaller",
|
|
7155
|
+
"math"
|
|
7156
|
+
]);
|
|
7157
|
+
/** A length font-size takes. A keyword cannot go inside the max() that keeps the floor, so it would void the whole font. */
|
|
7158
|
+
function isFontSize(value) {
|
|
7159
|
+
return !NOT_A_LENGTH.has(value.toLowerCase()) && CSS.supports("font-size", value);
|
|
7160
|
+
}
|
|
7161
|
+
/**
|
|
7162
|
+
* Writes the valid custom sizes onto the host and returns them. A breakpoint
|
|
7163
|
+
* without a valid value keeps the size from the scale. Sets the
|
|
7164
|
+
* `invalid-custom-size` state when a value is given that is not a length.
|
|
7165
|
+
* Call it from willUpdate(), so the first paint already has the size.
|
|
7166
|
+
*/
|
|
7167
|
+
function applyCustomFontSizes(host, prefix, own) {
|
|
7168
|
+
const sizes = {};
|
|
7169
|
+
if (typeof CSS === "undefined") return sizes;
|
|
7170
|
+
let invalid = false;
|
|
7171
|
+
for (const breakpoint of BREAKPOINTS) {
|
|
7172
|
+
const value = (own[breakpoint] || "").trim();
|
|
7173
|
+
const valid = value !== "" && isFontSize(value);
|
|
7174
|
+
if (valid) {
|
|
7175
|
+
sizes[breakpoint] = value;
|
|
7176
|
+
host.style.setProperty(`--_${prefix}-${breakpoint}-custom-size`, value);
|
|
7177
|
+
} else host.style.removeProperty(`--_${prefix}-${breakpoint}-custom-size`);
|
|
7178
|
+
host.toggleAttribute(`data-${breakpoint}-custom-size`, valid);
|
|
7179
|
+
if (value !== "" && !valid) invalid = true;
|
|
7180
|
+
}
|
|
7181
|
+
setState$1(host, "invalid-custom-size", invalid);
|
|
7182
|
+
return sizes;
|
|
7183
|
+
}
|
|
7184
|
+
/**
|
|
7185
|
+
* DEV-only: sets the `custom-size-below-floor` state when a fixed custom size
|
|
7186
|
+
* is smaller than the floor at its breakpoint, which then shows instead.
|
|
7187
|
+
*/
|
|
7188
|
+
function checkCustomFontSizeFloor(host, sizes, floors) {
|
|
7189
|
+
if (!host.shadowRoot || Object.keys(sizes).length === 0) {
|
|
7190
|
+
setState$1(host, "custom-size-below-floor", false);
|
|
7191
|
+
return;
|
|
7192
|
+
}
|
|
7193
|
+
const probe = document.createElement("span");
|
|
7194
|
+
probe.style.position = "absolute";
|
|
7195
|
+
probe.style.visibility = "hidden";
|
|
7196
|
+
host.shadowRoot.append(probe);
|
|
7197
|
+
const px = (value) => {
|
|
7198
|
+
probe.style.fontSize = value;
|
|
7199
|
+
return parseFloat(getComputedStyle(probe).fontSize);
|
|
7200
|
+
};
|
|
7201
|
+
let below = false;
|
|
7202
|
+
try {
|
|
7203
|
+
for (const [breakpoint, value] of Object.entries(sizes)) {
|
|
7204
|
+
if (/%|\d(?:v[whib]|vmin|vmax|cq[whib]|cqmin|cqmax|em|ex|ch|cap|ic|lh)\b/.test(value)) continue;
|
|
7205
|
+
if (px(value) < px(floors[breakpoint]) - .5) below = true;
|
|
7206
|
+
}
|
|
7207
|
+
} finally {
|
|
7208
|
+
probe.remove();
|
|
7209
|
+
}
|
|
7210
|
+
setState$1(host, "custom-size-below-floor", below);
|
|
7211
|
+
}
|
|
7118
7212
|
// src/components/content/blockquote/blockquote.styles.ts
|
|
7119
|
-
var smMax$
|
|
7213
|
+
var smMax$21 = unsafeCSS(queryBreakpoints.smMax);
|
|
7214
|
+
var mdMin$25 = unsafeCSS(queryBreakpoints.mdMin);
|
|
7215
|
+
var mdMax$16 = unsafeCSS(queryBreakpoints.mdMax);
|
|
7216
|
+
var lgMin$17 = unsafeCSS(queryBreakpoints.lgMin);
|
|
7120
7217
|
var blockquoteStyles = css`
|
|
7121
7218
|
:host {
|
|
7122
7219
|
box-sizing: border-box;
|
|
@@ -7129,14 +7226,20 @@ var blockquoteStyles = css`
|
|
|
7129
7226
|
--_blockquote-spacing: var(--semantics-blockquotes-md-spacing);
|
|
7130
7227
|
--_blockquote-quote-font: var(--semantics-blockquotes-md-quote-font);
|
|
7131
7228
|
--_blockquote-attribution-font: var(--semantics-blockquotes-md-attribution-font);
|
|
7132
|
-
|
|
7133
|
-
|
|
7229
|
+
--_blockquote-sm-custom-size: initial;
|
|
7230
|
+
--_blockquote-md-custom-size: initial;
|
|
7231
|
+
--_blockquote-lg-custom-size: initial;
|
|
7232
|
+
--_blockquote-sm-custom-font: italic var(--primitives-font-weight-body-regular) max(var(--_blockquote-sm-custom-size), var(--primitives-font-size-200)) / var(--primitives-line-height-snug) var(--primitives-font-family-body);
|
|
7233
|
+
--_blockquote-md-custom-font: italic var(--primitives-font-weight-body-regular) max(var(--_blockquote-md-custom-size), var(--primitives-font-size-300)) / var(--primitives-line-height-snug) var(--primitives-font-family-body);
|
|
7234
|
+
--_blockquote-lg-custom-font: italic var(--primitives-font-weight-body-regular) max(var(--_blockquote-lg-custom-size), var(--primitives-font-size-300)) / var(--primitives-line-height-snug) var(--primitives-font-family-body);
|
|
7235
|
+
|
|
7236
|
+
@media (max-width: ${smMax$21}) {
|
|
7134
7237
|
--_blockquote-spacing: var(--semantics-blockquotes-sm-spacing);
|
|
7135
7238
|
--_blockquote-quote-font: var(--semantics-blockquotes-sm-quote-font);
|
|
7136
7239
|
--_blockquote-attribution-font: var(--semantics-blockquotes-sm-attribution-font);
|
|
7137
7240
|
}
|
|
7138
7241
|
|
|
7139
|
-
@container layout-container (max-width: ${smMax$
|
|
7242
|
+
@container layout-container (max-width: ${smMax$21}) {
|
|
7140
7243
|
--_blockquote-spacing: var(--semantics-blockquotes-sm-spacing);
|
|
7141
7244
|
--_blockquote-quote-font: var(--semantics-blockquotes-sm-quote-font);
|
|
7142
7245
|
--_blockquote-attribution-font: var(--semantics-blockquotes-sm-attribution-font);
|
|
@@ -7151,6 +7254,38 @@ var blockquoteStyles = css`
|
|
|
7151
7254
|
display: none;
|
|
7152
7255
|
}
|
|
7153
7256
|
|
|
7257
|
+
/* ## Custom size */
|
|
7258
|
+
|
|
7259
|
+
:host([data-sm-custom-size]) {
|
|
7260
|
+
@media (max-width: ${smMax$21}) {
|
|
7261
|
+
--_blockquote-quote-font: var(--_blockquote-sm-custom-font);
|
|
7262
|
+
}
|
|
7263
|
+
|
|
7264
|
+
@container layout-container (max-width: ${smMax$21}) {
|
|
7265
|
+
--_blockquote-quote-font: var(--_blockquote-sm-custom-font);
|
|
7266
|
+
}
|
|
7267
|
+
}
|
|
7268
|
+
|
|
7269
|
+
:host([data-md-custom-size]) {
|
|
7270
|
+
@media (min-width: ${mdMin$25}) and (max-width: ${mdMax$16}) {
|
|
7271
|
+
--_blockquote-quote-font: var(--_blockquote-md-custom-font);
|
|
7272
|
+
}
|
|
7273
|
+
|
|
7274
|
+
@container layout-container (min-width: ${mdMin$25}) and (max-width: ${mdMax$16}) {
|
|
7275
|
+
--_blockquote-quote-font: var(--_blockquote-md-custom-font);
|
|
7276
|
+
}
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
:host([data-lg-custom-size]) {
|
|
7280
|
+
@media (min-width: ${lgMin$17}) {
|
|
7281
|
+
--_blockquote-quote-font: var(--_blockquote-lg-custom-font);
|
|
7282
|
+
}
|
|
7283
|
+
|
|
7284
|
+
@container layout-container (min-width: ${lgMin$17}) {
|
|
7285
|
+
--_blockquote-quote-font: var(--_blockquote-lg-custom-font);
|
|
7286
|
+
}
|
|
7287
|
+
}
|
|
7288
|
+
|
|
7154
7289
|
|
|
7155
7290
|
/* # Block */
|
|
7156
7291
|
|
|
@@ -7172,7 +7307,7 @@ var blockquoteStyles = css`
|
|
|
7172
7307
|
.blockquote__quote {
|
|
7173
7308
|
display: flex;
|
|
7174
7309
|
flex-direction: column;
|
|
7175
|
-
gap: calc(
|
|
7310
|
+
gap: calc(1lh / 2);
|
|
7176
7311
|
font: var(--_blockquote-quote-font);
|
|
7177
7312
|
}
|
|
7178
7313
|
|
|
@@ -7228,14 +7363,27 @@ function template$17(component) {
|
|
|
7228
7363
|
*
|
|
7229
7364
|
* @element nldd-blockquote
|
|
7230
7365
|
* @attr {string} cite - URL of the source (forwarded to the <blockquote> element)
|
|
7366
|
+
* @attr {string} sm-custom-size - A size of your own for the quote at sm, any CSS length (e.g. '32px', '2rem', 'clamp(1.5rem, 4vw, 3rem)'), for a quote that stands out on its own, such as on a landing page. A quote in running text keeps its own size. Set per breakpoint on purpose: a breakpoint without one keeps the quote's own size, so a quote made large for a wide screen never breaks a narrow one. Never smaller than the quote's own size at the same breakpoint: a smaller value shows at that size, and a fixed length that is smaller says so in development (a relative value, such as vw, em or a percentage, is not checked there; the floor still holds). Only the quote grows, with its line height and the space between paragraphs; the attribution and the border stay as they are. An invalid value falls back to the quote's own size
|
|
7367
|
+
* @attr {string} md-custom-size - The same, at md
|
|
7368
|
+
* @attr {string} lg-custom-size - The same, at lg
|
|
7231
7369
|
*
|
|
7232
7370
|
* @slot - The paragraph or paragraphs of the quote; prefer <p> elements
|
|
7233
7371
|
* @slot attribution - Optional source attribution (author, title, and so on). An nldd-identity is allowed here; the em dash ("— ") is then left out.
|
|
7234
7372
|
*/
|
|
7235
|
-
var _NLDDBlockquote
|
|
7373
|
+
var _NLDDBlockquote;
|
|
7374
|
+
/** The quote's own font size per breakpoint: the floor of a custom size. */
|
|
7375
|
+
var QUOTE_FONT_SIZE = {
|
|
7376
|
+
sm: "var(--primitives-font-size-200)",
|
|
7377
|
+
md: "var(--primitives-font-size-300)",
|
|
7378
|
+
lg: "var(--primitives-font-size-300)"
|
|
7379
|
+
};
|
|
7380
|
+
var NLDDBlockquote = (_NLDDBlockquote = class NLDDBlockquote extends LitElement {
|
|
7236
7381
|
constructor(..._args) {
|
|
7237
7382
|
super(..._args);
|
|
7238
7383
|
this.cite = void 0;
|
|
7384
|
+
this.smCustomSize = "";
|
|
7385
|
+
this.mdCustomSize = "";
|
|
7386
|
+
this.lgCustomSize = "";
|
|
7239
7387
|
this._hasAttribution = false;
|
|
7240
7388
|
this._hasIdentityAttribution = false;
|
|
7241
7389
|
this._handleAttributionSlotChange = (e) => {
|
|
@@ -7246,18 +7394,47 @@ var _NLDDBlockquote = class NLDDBlockquote extends LitElement {
|
|
|
7246
7394
|
});
|
|
7247
7395
|
this._hasIdentityAttribution = slot.assignedElements({ flatten: true }).some((el) => el.tagName === "NLDD-IDENTITY");
|
|
7248
7396
|
};
|
|
7397
|
+
this._customSizes = {};
|
|
7398
|
+
}
|
|
7399
|
+
willUpdate(changed) {
|
|
7400
|
+
super.willUpdate(changed);
|
|
7401
|
+
if (!changed.has("smCustomSize") && !changed.has("mdCustomSize") && !changed.has("lgCustomSize")) return;
|
|
7402
|
+
this._customSizes = applyCustomFontSizes(this, "blockquote", {
|
|
7403
|
+
sm: this.smCustomSize,
|
|
7404
|
+
md: this.mdCustomSize,
|
|
7405
|
+
lg: this.lgCustomSize
|
|
7406
|
+
});
|
|
7407
|
+
}
|
|
7408
|
+
updated(changed) {
|
|
7409
|
+
super.updated(changed);
|
|
7410
|
+
if (!import.meta.env?.DEV) return;
|
|
7411
|
+
if (changed.has("smCustomSize") || changed.has("mdCustomSize") || changed.has("lgCustomSize")) checkCustomFontSizeFloor(this, this._customSizes, QUOTE_FONT_SIZE);
|
|
7249
7412
|
}
|
|
7250
7413
|
render() {
|
|
7251
7414
|
return template$17(this);
|
|
7252
7415
|
}
|
|
7253
|
-
};
|
|
7254
|
-
var NLDDBlockquote = (_NLDDBlockquote.styles = blockquoteStyles, _NLDDBlockquote);
|
|
7416
|
+
}, _NLDDBlockquote.styles = blockquoteStyles, _NLDDBlockquote);
|
|
7255
7417
|
__decorate([property({ type: String })], NLDDBlockquote.prototype, "cite", void 0);
|
|
7418
|
+
__decorate([property({
|
|
7419
|
+
reflect: true,
|
|
7420
|
+
attribute: "sm-custom-size",
|
|
7421
|
+
converter: reflectNonDefault("")
|
|
7422
|
+
})], NLDDBlockquote.prototype, "smCustomSize", void 0);
|
|
7423
|
+
__decorate([property({
|
|
7424
|
+
reflect: true,
|
|
7425
|
+
attribute: "md-custom-size",
|
|
7426
|
+
converter: reflectNonDefault("")
|
|
7427
|
+
})], NLDDBlockquote.prototype, "mdCustomSize", void 0);
|
|
7428
|
+
__decorate([property({
|
|
7429
|
+
reflect: true,
|
|
7430
|
+
attribute: "lg-custom-size",
|
|
7431
|
+
converter: reflectNonDefault("")
|
|
7432
|
+
})], NLDDBlockquote.prototype, "lgCustomSize", void 0);
|
|
7256
7433
|
__decorate([state()], NLDDBlockquote.prototype, "_hasAttribution", void 0);
|
|
7257
7434
|
__decorate([state()], NLDDBlockquote.prototype, "_hasIdentityAttribution", void 0);
|
|
7258
7435
|
NLDDBlockquote = __decorate([customElement("nldd-blockquote")], NLDDBlockquote);
|
|
7259
7436
|
// src/components/content/avatar-group/avatar-group.styles.ts
|
|
7260
|
-
var mdMin$
|
|
7437
|
+
var mdMin$24 = unsafeCSS(queryBreakpoints.mdMin);
|
|
7261
7438
|
var avatarGroupStyles = css`
|
|
7262
7439
|
:host {
|
|
7263
7440
|
box-sizing: border-box;
|
|
@@ -7388,7 +7565,7 @@ var avatarGroupStyles = css`
|
|
|
7388
7565
|
|
|
7389
7566
|
|
|
7390
7567
|
/* Anchored on md and up, the list needs no bar to close it. */
|
|
7391
|
-
@media (min-width: ${mdMin$
|
|
7568
|
+
@media (min-width: ${mdMin$24}) {
|
|
7392
7569
|
.avatar-group__overflow-title-bar {
|
|
7393
7570
|
display: none;
|
|
7394
7571
|
}
|
|
@@ -7493,8 +7670,8 @@ function avatarGroupTemplate(component) {
|
|
|
7493
7670
|
`;
|
|
7494
7671
|
}
|
|
7495
7672
|
// src/components/layout/popover/popover.styles.ts
|
|
7496
|
-
var smMax$
|
|
7497
|
-
var mdMin$
|
|
7673
|
+
var smMax$20 = unsafeCSS(queryBreakpoints.smMax);
|
|
7674
|
+
var mdMin$23 = unsafeCSS(queryBreakpoints.mdMin);
|
|
7498
7675
|
var popoverStyles = css`
|
|
7499
7676
|
:host {
|
|
7500
7677
|
box-sizing: border-box;
|
|
@@ -7522,7 +7699,7 @@ var popoverStyles = css`
|
|
|
7522
7699
|
-webkit-user-select: text;
|
|
7523
7700
|
user-select: text;
|
|
7524
7701
|
|
|
7525
|
-
@media (max-width: ${smMax$
|
|
7702
|
+
@media (max-width: ${smMax$20}) {
|
|
7526
7703
|
position: fixed;
|
|
7527
7704
|
inset: auto 0 0 0;
|
|
7528
7705
|
border-radius: var(--semantics-overlays-corner-radius) var(--semantics-overlays-corner-radius) 0 0;
|
|
@@ -7536,7 +7713,7 @@ var popoverStyles = css`
|
|
|
7536
7713
|
overlay var(--semantics-sheets-bottom-animation-duration) allow-discrete;
|
|
7537
7714
|
}
|
|
7538
7715
|
|
|
7539
|
-
@media (min-width: ${mdMin$
|
|
7716
|
+
@media (min-width: ${mdMin$23}) {
|
|
7540
7717
|
position: absolute;
|
|
7541
7718
|
inset: unset;
|
|
7542
7719
|
border-radius: var(--semantics-overlays-corner-radius);
|
|
@@ -7572,7 +7749,7 @@ var popoverStyles = css`
|
|
|
7572
7749
|
keeps it laid out so its size can be measured. The sm bottom-sheet is CSS-animated
|
|
7573
7750
|
and positioned, so it is excluded. The positioned attribute is set once
|
|
7574
7751
|
reposition() finishes and cleared on every re-open. */
|
|
7575
|
-
@media (min-width: ${mdMin$
|
|
7752
|
+
@media (min-width: ${mdMin$23}) {
|
|
7576
7753
|
:host(:popover-open:not([positioned])) {
|
|
7577
7754
|
visibility: hidden;
|
|
7578
7755
|
}
|
|
@@ -7585,7 +7762,7 @@ var popoverStyles = css`
|
|
|
7585
7762
|
}
|
|
7586
7763
|
|
|
7587
7764
|
:host(:popover-open) {
|
|
7588
|
-
@media (max-width: ${smMax$
|
|
7765
|
+
@media (max-width: ${smMax$20}) {
|
|
7589
7766
|
transform: translateY(0);
|
|
7590
7767
|
|
|
7591
7768
|
@starting-style {
|
|
@@ -7595,13 +7772,13 @@ var popoverStyles = css`
|
|
|
7595
7772
|
}
|
|
7596
7773
|
|
|
7597
7774
|
:host::backdrop {
|
|
7598
|
-
@media (max-width: ${smMax$
|
|
7775
|
+
@media (max-width: ${smMax$20}) {
|
|
7599
7776
|
background-color: var(--semantics-overlays-backdrop-color);
|
|
7600
7777
|
}
|
|
7601
7778
|
}
|
|
7602
7779
|
|
|
7603
7780
|
:host([sm-full-height]) {
|
|
7604
|
-
@media (max-width: ${smMax$
|
|
7781
|
+
@media (max-width: ${smMax$20}) {
|
|
7605
7782
|
height: calc(100dvh - var(--semantics-sheets-bottom-top-inset));
|
|
7606
7783
|
}
|
|
7607
7784
|
}
|
|
@@ -8124,10 +8301,10 @@ __decorate([property({
|
|
|
8124
8301
|
})], NLDDPopover.prototype, "open", void 0);
|
|
8125
8302
|
NLDDPopover = _NLDDPopover = __decorate([customElement("nldd-popover")], NLDDPopover);
|
|
8126
8303
|
// src/components/layout/container/container.styles.ts
|
|
8127
|
-
var smMax$
|
|
8128
|
-
var mdMin$
|
|
8129
|
-
var mdMax$
|
|
8130
|
-
var lgMin$
|
|
8304
|
+
var smMax$19 = unsafeCSS(queryBreakpoints.smMax);
|
|
8305
|
+
var mdMin$22 = unsafeCSS(queryBreakpoints.mdMin);
|
|
8306
|
+
var mdMax$15 = unsafeCSS(queryBreakpoints.mdMax);
|
|
8307
|
+
var lgMin$16 = unsafeCSS(queryBreakpoints.lgMin);
|
|
8131
8308
|
var containerStyles = css`
|
|
8132
8309
|
:host {
|
|
8133
8310
|
box-sizing: border-box;
|
|
@@ -8174,13 +8351,13 @@ var containerStyles = css`
|
|
|
8174
8351
|
container and anywhere else the viewport. Multicol reads the gap in three
|
|
8175
8352
|
rules, so the value is swapped here rather than declared in each. The
|
|
8176
8353
|
bare --_container-gap is what stands when neither set matches. */
|
|
8177
|
-
@media (max-width: ${smMax$
|
|
8178
|
-
@media (min-width: ${mdMin$
|
|
8179
|
-
@media (min-width: ${lgMin$
|
|
8354
|
+
@media (max-width: ${smMax$19}) { --_container-gap: var(--_container-sm-gap); }
|
|
8355
|
+
@media (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) { --_container-gap: var(--_container-md-gap); }
|
|
8356
|
+
@media (min-width: ${lgMin$16}) { --_container-gap: var(--_container-lg-gap); }
|
|
8180
8357
|
|
|
8181
|
-
@container layout-container (max-width: ${smMax$
|
|
8182
|
-
@container layout-container (min-width: ${mdMin$
|
|
8183
|
-
@container layout-container (min-width: ${lgMin$
|
|
8358
|
+
@container layout-container (max-width: ${smMax$19}) { --_container-gap: var(--_container-sm-gap); }
|
|
8359
|
+
@container layout-container (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) { --_container-gap: var(--_container-md-gap); }
|
|
8360
|
+
@container layout-container (min-width: ${lgMin$16}) { --_container-gap: var(--_container-lg-gap); }
|
|
8184
8361
|
|
|
8185
8362
|
display: block;
|
|
8186
8363
|
width: var(--_container-width);
|
|
@@ -8224,42 +8401,42 @@ var containerStyles = css`
|
|
|
8224
8401
|
padding-bottom: var(--_container-padding-bottom);
|
|
8225
8402
|
padding-left: var(--_container-padding-left);
|
|
8226
8403
|
|
|
8227
|
-
@media (max-width: ${smMax$
|
|
8404
|
+
@media (max-width: ${smMax$19}) {
|
|
8228
8405
|
padding-top: var(--_container-sm-padding-top);
|
|
8229
8406
|
padding-right: var(--_container-sm-padding-right);
|
|
8230
8407
|
padding-bottom: var(--_container-sm-padding-bottom);
|
|
8231
8408
|
padding-left: var(--_container-sm-padding-left);
|
|
8232
8409
|
}
|
|
8233
8410
|
|
|
8234
|
-
@media (min-width: ${mdMin$
|
|
8411
|
+
@media (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) {
|
|
8235
8412
|
padding-top: var(--_container-md-padding-top);
|
|
8236
8413
|
padding-right: var(--_container-md-padding-right);
|
|
8237
8414
|
padding-bottom: var(--_container-md-padding-bottom);
|
|
8238
8415
|
padding-left: var(--_container-md-padding-left);
|
|
8239
8416
|
}
|
|
8240
8417
|
|
|
8241
|
-
@media (min-width: ${lgMin$
|
|
8418
|
+
@media (min-width: ${lgMin$16}) {
|
|
8242
8419
|
padding-top: var(--_container-lg-padding-top);
|
|
8243
8420
|
padding-right: var(--_container-lg-padding-right);
|
|
8244
8421
|
padding-bottom: var(--_container-lg-padding-bottom);
|
|
8245
8422
|
padding-left: var(--_container-lg-padding-left);
|
|
8246
8423
|
}
|
|
8247
8424
|
|
|
8248
|
-
@container layout-container (max-width: ${smMax$
|
|
8425
|
+
@container layout-container (max-width: ${smMax$19}) {
|
|
8249
8426
|
padding-top: var(--_container-sm-padding-top);
|
|
8250
8427
|
padding-right: var(--_container-sm-padding-right);
|
|
8251
8428
|
padding-bottom: var(--_container-sm-padding-bottom);
|
|
8252
8429
|
padding-left: var(--_container-sm-padding-left);
|
|
8253
8430
|
}
|
|
8254
8431
|
|
|
8255
|
-
@container layout-container (min-width: ${mdMin$
|
|
8432
|
+
@container layout-container (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) {
|
|
8256
8433
|
padding-top: var(--_container-md-padding-top);
|
|
8257
8434
|
padding-right: var(--_container-md-padding-right);
|
|
8258
8435
|
padding-bottom: var(--_container-md-padding-bottom);
|
|
8259
8436
|
padding-left: var(--_container-md-padding-left);
|
|
8260
8437
|
}
|
|
8261
8438
|
|
|
8262
|
-
@container layout-container (min-width: ${lgMin$
|
|
8439
|
+
@container layout-container (min-width: ${lgMin$16}) {
|
|
8263
8440
|
padding-top: var(--_container-lg-padding-top);
|
|
8264
8441
|
padding-right: var(--_container-lg-padding-right);
|
|
8265
8442
|
padding-bottom: var(--_container-lg-padding-bottom);
|
|
@@ -8380,7 +8557,7 @@ var containerStyles = css`
|
|
|
8380
8557
|
|
|
8381
8558
|
/* # Column count — sm scope (queries :host own width) */
|
|
8382
8559
|
|
|
8383
|
-
@container (max-width: ${smMax$
|
|
8560
|
+
@container (max-width: ${smMax$19}) {
|
|
8384
8561
|
:host([sm-column-count="1"]) .container__inner { --_container-column-count: 1; }
|
|
8385
8562
|
:host([sm-column-count="2"]) .container__inner { --_container-column-count: 2; }
|
|
8386
8563
|
:host([sm-column-count="3"]) .container__inner { --_container-column-count: 3; }
|
|
@@ -8395,7 +8572,7 @@ var containerStyles = css`
|
|
|
8395
8572
|
|
|
8396
8573
|
/* # Column count — md scope */
|
|
8397
8574
|
|
|
8398
|
-
@container (min-width: ${mdMin$
|
|
8575
|
+
@container (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) {
|
|
8399
8576
|
:host([md-column-count="1"]) .container__inner { --_container-column-count: 1; }
|
|
8400
8577
|
:host([md-column-count="2"]) .container__inner { --_container-column-count: 2; }
|
|
8401
8578
|
:host([md-column-count="3"]) .container__inner { --_container-column-count: 3; }
|
|
@@ -8410,7 +8587,7 @@ var containerStyles = css`
|
|
|
8410
8587
|
|
|
8411
8588
|
/* # Column count — lg scope */
|
|
8412
8589
|
|
|
8413
|
-
@container (min-width: ${lgMin$
|
|
8590
|
+
@container (min-width: ${lgMin$16}) {
|
|
8414
8591
|
:host([lg-column-count="1"]) .container__inner { --_container-column-count: 1; }
|
|
8415
8592
|
:host([lg-column-count="2"]) .container__inner { --_container-column-count: 2; }
|
|
8416
8593
|
:host([lg-column-count="3"]) .container__inner { --_container-column-count: 3; }
|
|
@@ -8435,15 +8612,15 @@ var containerStyles = css`
|
|
|
8435
8612
|
order: var(--_container-slot-order, 0);
|
|
8436
8613
|
}
|
|
8437
8614
|
|
|
8438
|
-
@container (max-width: ${smMax$
|
|
8615
|
+
@container (max-width: ${smMax$19}) {
|
|
8439
8616
|
::slotted(*) { order: var(--_container-slot-sm-order, var(--_container-slot-order, 0)); }
|
|
8440
8617
|
}
|
|
8441
8618
|
|
|
8442
|
-
@container (min-width: ${mdMin$
|
|
8619
|
+
@container (min-width: ${mdMin$22}) and (max-width: ${mdMax$15}) {
|
|
8443
8620
|
::slotted(*) { order: var(--_container-slot-md-order, var(--_container-slot-order, 0)); }
|
|
8444
8621
|
}
|
|
8445
8622
|
|
|
8446
|
-
@container (min-width: ${lgMin$
|
|
8623
|
+
@container (min-width: ${lgMin$16}) {
|
|
8447
8624
|
::slotted(*) { order: var(--_container-slot-lg-order, var(--_container-slot-order, 0)); }
|
|
8448
8625
|
}
|
|
8449
8626
|
`;
|
|
@@ -13186,7 +13363,7 @@ __decorate([state()], NLDDAvatarGroup.prototype, "_total", void 0);
|
|
|
13186
13363
|
__decorate([state()], NLDDAvatarGroup.prototype, "_fitMax", void 0);
|
|
13187
13364
|
NLDDAvatarGroup = __decorate([customElement("nldd-avatar-group")], NLDDAvatarGroup);
|
|
13188
13365
|
// src/components/content/identity/identity.styles.ts
|
|
13189
|
-
var smMax$
|
|
13366
|
+
var smMax$18 = unsafeCSS(queryBreakpoints.smMax);
|
|
13190
13367
|
var identityStyles = css`
|
|
13191
13368
|
:host {
|
|
13192
13369
|
box-sizing: border-box;
|
|
@@ -13224,7 +13401,7 @@ var identityStyles = css`
|
|
|
13224
13401
|
}
|
|
13225
13402
|
|
|
13226
13403
|
.identity[data-multiple-avatars] {
|
|
13227
|
-
@container (max-width: ${smMax$
|
|
13404
|
+
@container (max-width: ${smMax$18}) {
|
|
13228
13405
|
flex-direction: column;
|
|
13229
13406
|
align-items: flex-start;
|
|
13230
13407
|
}
|
|
@@ -16122,6 +16299,50 @@ __decorate([state()], NLDDTag.prototype, "_hasSlotText", void 0);
|
|
|
16122
16299
|
__decorate([state()], NLDDTag.prototype, "_hasSlotIcon", void 0);
|
|
16123
16300
|
NLDDTag = __decorate([customElement("nldd-tag")], NLDDTag);
|
|
16124
16301
|
// src/components/content/text/text.styles.ts
|
|
16302
|
+
var smMax$17 = unsafeCSS(queryBreakpoints.smMax);
|
|
16303
|
+
var mdMin$21 = unsafeCSS(queryBreakpoints.mdMin);
|
|
16304
|
+
var mdMax$14 = unsafeCSS(queryBreakpoints.mdMax);
|
|
16305
|
+
var lgMin$15 = unsafeCSS(queryBreakpoints.lgMin);
|
|
16306
|
+
/** Sets --_text-font per breakpoint, from the viewport and from a layout-container alike, as nldd-title does. */
|
|
16307
|
+
var fontPerBreakpoint = (host, sm, md, lg) => css`
|
|
16308
|
+
${unsafeCSS(host)} {
|
|
16309
|
+
@media (max-width: ${smMax$17}) {
|
|
16310
|
+
--_text-font: ${unsafeCSS(sm)};
|
|
16311
|
+
}
|
|
16312
|
+
|
|
16313
|
+
@media (min-width: ${mdMin$21}) and (max-width: ${mdMax$14}) {
|
|
16314
|
+
--_text-font: ${unsafeCSS(md)};
|
|
16315
|
+
}
|
|
16316
|
+
|
|
16317
|
+
@media (min-width: ${lgMin$15}) {
|
|
16318
|
+
--_text-font: ${unsafeCSS(lg)};
|
|
16319
|
+
}
|
|
16320
|
+
|
|
16321
|
+
@container layout-container (max-width: ${smMax$17}) {
|
|
16322
|
+
--_text-font: ${unsafeCSS(sm)};
|
|
16323
|
+
}
|
|
16324
|
+
|
|
16325
|
+
@container layout-container (min-width: ${mdMin$21}) and (max-width: ${mdMax$14}) {
|
|
16326
|
+
--_text-font: ${unsafeCSS(md)};
|
|
16327
|
+
}
|
|
16328
|
+
|
|
16329
|
+
@container layout-container (min-width: ${lgMin$15}) {
|
|
16330
|
+
--_text-font: ${unsafeCSS(lg)};
|
|
16331
|
+
}
|
|
16332
|
+
}
|
|
16333
|
+
`;
|
|
16334
|
+
/** Sets --_text-font at one breakpoint only, for a custom size. */
|
|
16335
|
+
var fontAt = (host, query, containerQuery, font) => css`
|
|
16336
|
+
${unsafeCSS(host)} {
|
|
16337
|
+
@media ${query} {
|
|
16338
|
+
--_text-font: ${unsafeCSS(font)};
|
|
16339
|
+
}
|
|
16340
|
+
|
|
16341
|
+
@container layout-container ${containerQuery} {
|
|
16342
|
+
--_text-font: ${unsafeCSS(font)};
|
|
16343
|
+
}
|
|
16344
|
+
}
|
|
16345
|
+
`;
|
|
16125
16346
|
var textStyles = css`
|
|
16126
16347
|
|
|
16127
16348
|
|
|
@@ -16132,6 +16353,15 @@ var textStyles = css`
|
|
|
16132
16353
|
--_text-font-weight: var(--primitives-font-weight-body-regular);
|
|
16133
16354
|
--_text-line-height: var(--primitives-line-height-snug);
|
|
16134
16355
|
--_text-max-width: var(--semantics-text-max-width);
|
|
16356
|
+
--_text-font: var(--_text-font-weight) var(--_text-font-size) / var(--_text-line-height) var(--primitives-font-family-body);
|
|
16357
|
+
--_text-hyphenate-limit-before: 5;
|
|
16358
|
+
--_text-hyphenate-limit-after: 5;
|
|
16359
|
+
--_text-sm-custom-size: initial;
|
|
16360
|
+
--_text-md-custom-size: initial;
|
|
16361
|
+
--_text-lg-custom-size: initial;
|
|
16362
|
+
--_text-sm-custom-font: var(--primitives-font-weight-display-bold) max(var(--_text-sm-custom-size), var(--primitives-font-size-700)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
16363
|
+
--_text-md-custom-font: var(--primitives-font-weight-display-bold) max(var(--_text-md-custom-size), var(--primitives-font-size-800)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
16364
|
+
--_text-lg-custom-font: var(--primitives-font-weight-display-bold) max(var(--_text-lg-custom-size), var(--primitives-font-size-1000)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
16135
16365
|
--_text-color: var(--context-content-color, var(--semantics-content-color));
|
|
16136
16366
|
--_text-align: left;
|
|
16137
16367
|
--_text-link-color: var(--semantics-links-color);
|
|
@@ -16165,7 +16395,7 @@ var textStyles = css`
|
|
|
16165
16395
|
max-width: var(--_text-max-width);
|
|
16166
16396
|
color: var(--_text-color);
|
|
16167
16397
|
text-align: var(--_text-align);
|
|
16168
|
-
font: var(--_text-font
|
|
16398
|
+
font: var(--_text-font);
|
|
16169
16399
|
text-wrap: pretty;
|
|
16170
16400
|
}
|
|
16171
16401
|
|
|
@@ -16192,6 +16422,39 @@ var textStyles = css`
|
|
|
16192
16422
|
--_text-font-size: var(--primitives-font-size-200);
|
|
16193
16423
|
}
|
|
16194
16424
|
|
|
16425
|
+
/* ## Display */
|
|
16426
|
+
|
|
16427
|
+
${unsafeCSS([
|
|
16428
|
+
6,
|
|
16429
|
+
5,
|
|
16430
|
+
4,
|
|
16431
|
+
3,
|
|
16432
|
+
2,
|
|
16433
|
+
1
|
|
16434
|
+
].map((n) => fontPerBreakpoint(`:host([size="display-${n}"])`, `var(--primitives-font-display-${n}-sm)`, `var(--primitives-font-display-${n}-md)`, `var(--primitives-font-display-${n}-lg)`).cssText).join("\n"))}
|
|
16435
|
+
|
|
16436
|
+
/* ## Custom size */
|
|
16437
|
+
|
|
16438
|
+
${fontAt(":host([data-sm-custom-size])", css`(max-width: ${smMax$17})`, css`(max-width: ${smMax$17})`, "var(--_text-sm-custom-font)")}
|
|
16439
|
+
${fontAt(":host([data-md-custom-size])", css`(min-width: ${mdMin$21}) and (max-width: ${mdMax$14})`, css`(min-width: ${mdMin$21}) and (max-width: ${mdMax$14})`, "var(--_text-md-custom-font)")}
|
|
16440
|
+
${fontAt(":host([data-lg-custom-size])", css`(min-width: ${lgMin$15})`, css`(min-width: ${lgMin$15})`, "var(--_text-lg-custom-font)")}
|
|
16441
|
+
|
|
16442
|
+
/* The measure is in ch, as on nldd-title: 40em of large letters is a ruler. */
|
|
16443
|
+
:host([size^="display-"]),
|
|
16444
|
+
:host([data-sm-custom-size]),
|
|
16445
|
+
:host([data-md-custom-size]),
|
|
16446
|
+
:host([data-lg-custom-size]) {
|
|
16447
|
+
--_text-max-width: 40ch;
|
|
16448
|
+
|
|
16449
|
+
overflow-wrap: anywhere;
|
|
16450
|
+
text-wrap: balance;
|
|
16451
|
+
-webkit-hyphens: auto;
|
|
16452
|
+
hyphens: auto;
|
|
16453
|
+
-webkit-hyphenate-limit-before: var(--_text-hyphenate-limit-before);
|
|
16454
|
+
-webkit-hyphenate-limit-after: var(--_text-hyphenate-limit-after);
|
|
16455
|
+
hyphenate-limit-chars: 12 var(--_text-hyphenate-limit-before) var(--_text-hyphenate-limit-after);
|
|
16456
|
+
}
|
|
16457
|
+
|
|
16195
16458
|
|
|
16196
16459
|
/* # Weight */
|
|
16197
16460
|
|
|
@@ -16212,6 +16475,11 @@ var textStyles = css`
|
|
|
16212
16475
|
font-weight: var(--primitives-font-weight-body-bold);
|
|
16213
16476
|
}
|
|
16214
16477
|
|
|
16478
|
+
:host([size^="display-"]) ::slotted(strong),
|
|
16479
|
+
:host([size^="display-"]) ::slotted(b) {
|
|
16480
|
+
font-weight: inherit;
|
|
16481
|
+
}
|
|
16482
|
+
|
|
16215
16483
|
|
|
16216
16484
|
/* # Inline elements */
|
|
16217
16485
|
|
|
@@ -16419,6 +16687,14 @@ function template$12() {
|
|
|
16419
16687
|
* own rhythm, spacing and media widths, which is `nldd-rich-text`. This is one
|
|
16420
16688
|
* run of text and nothing around it.
|
|
16421
16689
|
*
|
|
16690
|
+
* For large letters that are not a heading, such as a number or a statement on
|
|
16691
|
+
* a landing page, take a display size: `display-6` to `display-1` are the sizes
|
|
16692
|
+
* of `nldd-title`, with its weight, typeface and line height, and they follow
|
|
16693
|
+
* the breakpoint as a title does. `weight` and `line-height` belong to the body
|
|
16694
|
+
* sizes and do nothing at a display size. For a statement larger than
|
|
16695
|
+
* `display-1`, give each breakpoint a size of its own with `sm-custom-size`,
|
|
16696
|
+
* `md-custom-size` and `lg-custom-size`.
|
|
16697
|
+
*
|
|
16422
16698
|
* Color follows the context channel a list item, menu or table sets on its
|
|
16423
16699
|
* content, so text inside a row travels with that row as it is hovered or
|
|
16424
16700
|
* selected. Standalone that channel is unset and the semantic color answers.
|
|
@@ -16430,7 +16706,10 @@ function template$12() {
|
|
|
16430
16706
|
* beside its own heading.
|
|
16431
16707
|
*
|
|
16432
16708
|
* @element nldd-text
|
|
16433
|
-
* @attr {string} size - Text size
|
|
16709
|
+
* @attr {string} size - Text size: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' on the body scale (default: 'md'), or 'display-6' to 'display-1' for large letters that are not a heading, from small to large
|
|
16710
|
+
* @attr {string} sm-custom-size - A size of your own at sm, any CSS length (e.g. '56px', '3.5rem', 'clamp(3rem, 8vw, 7rem)'), for a statement larger than `display-1`. A var() works when the variable holds a length; one that is not defined leaves the text without its size, the floor included. Set per breakpoint on purpose: a breakpoint without one keeps the size from `size`, so text made large for a wide screen never breaks a narrow one. Never smaller than `display-1` at the same breakpoint: a smaller value shows as `display-1`, and a fixed length that is smaller says so in development (a relative value, such as vw, em or a percentage, is not checked there; the floor still holds). Takes the weight, typeface and line height of `display-1`. An invalid value falls back to `size`
|
|
16711
|
+
* @attr {string} md-custom-size - The same, at md
|
|
16712
|
+
* @attr {string} lg-custom-size - The same, at lg
|
|
16434
16713
|
* @attr {string} weight - Font weight: 'regular' | 'medium' | 'bold' (default: 'regular'). With 'bold' a slotted `<strong>` no longer stands out: there is nothing bolder in the scale.
|
|
16435
16714
|
* @attr {string} line-height - Line height: 'flat' | 'tight' | 'snug' | 'loose' (default: 'snug')
|
|
16436
16715
|
* @attr {string} color - Text color: 'content' (the default) | 'secondary' | 'accent' | 'success' | 'warning' | 'critical' | 'inherit'. 'content' and 'secondary' follow the surrounding content channel; 'inherit' takes the color it inherits, for text on a painted surface.
|
|
@@ -16442,10 +16721,28 @@ var _NLDDText = class NLDDText extends LitElement {
|
|
|
16442
16721
|
constructor(..._args) {
|
|
16443
16722
|
super(..._args);
|
|
16444
16723
|
this.size = "md";
|
|
16724
|
+
this.smCustomSize = "";
|
|
16725
|
+
this.mdCustomSize = "";
|
|
16726
|
+
this.lgCustomSize = "";
|
|
16445
16727
|
this.weight = "regular";
|
|
16446
16728
|
this.lineHeight = "snug";
|
|
16447
16729
|
this.color = "content";
|
|
16448
16730
|
this.horizontalAlignment = "left";
|
|
16731
|
+
this._customSizes = {};
|
|
16732
|
+
}
|
|
16733
|
+
willUpdate(changed) {
|
|
16734
|
+
super.willUpdate(changed);
|
|
16735
|
+
if (!changed.has("smCustomSize") && !changed.has("mdCustomSize") && !changed.has("lgCustomSize")) return;
|
|
16736
|
+
this._customSizes = applyCustomFontSizes(this, "text", {
|
|
16737
|
+
sm: this.smCustomSize,
|
|
16738
|
+
md: this.mdCustomSize,
|
|
16739
|
+
lg: this.lgCustomSize
|
|
16740
|
+
});
|
|
16741
|
+
}
|
|
16742
|
+
updated(changed) {
|
|
16743
|
+
super.updated(changed);
|
|
16744
|
+
if (!import.meta.env?.DEV) return;
|
|
16745
|
+
if (changed.has("smCustomSize") || changed.has("mdCustomSize") || changed.has("lgCustomSize")) checkCustomFontSizeFloor(this, this._customSizes, DISPLAY_1_FONT_SIZE);
|
|
16449
16746
|
}
|
|
16450
16747
|
render() {
|
|
16451
16748
|
return template$12();
|
|
@@ -16456,6 +16753,21 @@ __decorate([property({
|
|
|
16456
16753
|
reflect: true,
|
|
16457
16754
|
converter: reflectNonDefault("md")
|
|
16458
16755
|
})], NLDDText.prototype, "size", void 0);
|
|
16756
|
+
__decorate([property({
|
|
16757
|
+
reflect: true,
|
|
16758
|
+
attribute: "sm-custom-size",
|
|
16759
|
+
converter: reflectNonDefault("")
|
|
16760
|
+
})], NLDDText.prototype, "smCustomSize", void 0);
|
|
16761
|
+
__decorate([property({
|
|
16762
|
+
reflect: true,
|
|
16763
|
+
attribute: "md-custom-size",
|
|
16764
|
+
converter: reflectNonDefault("")
|
|
16765
|
+
})], NLDDText.prototype, "mdCustomSize", void 0);
|
|
16766
|
+
__decorate([property({
|
|
16767
|
+
reflect: true,
|
|
16768
|
+
attribute: "lg-custom-size",
|
|
16769
|
+
converter: reflectNonDefault("")
|
|
16770
|
+
})], NLDDText.prototype, "lgCustomSize", void 0);
|
|
16459
16771
|
__decorate([property({
|
|
16460
16772
|
reflect: true,
|
|
16461
16773
|
converter: reflectNonDefault("regular")
|
|
@@ -16888,50 +17200,14 @@ function titleTemplate(component) {
|
|
|
16888
17200
|
* @attr {string} text - Title text. Content in the default slot takes its place.
|
|
16889
17201
|
* @attr {string} supporting-text - Text below the title. Content in the supporting-text slot takes its place.
|
|
16890
17202
|
* @attr {string} overline - Text above the title. Content in the overline slot takes its place.
|
|
16891
|
-
* @attr {1|2|3|4|5|6} heading-level - Renders text as h1–h6
|
|
17203
|
+
* @attr {1|2|3|4|5|6} heading-level - Renders text as h1–h6. Absent renders a p, which is no heading: for large letters that are not a heading, use nldd-text with a display size.
|
|
16892
17204
|
*
|
|
16893
17205
|
* @slot overline - Overline that is more than text. Takes the place of the overline attribute.
|
|
16894
17206
|
* @slot - Title that is more than text, such as a link. Takes the place of text, and brings its own h1–h6 for semantics.
|
|
16895
17207
|
* @slot supporting-text - Supporting text that is more than text. Takes the place of the supporting-text attribute.
|
|
16896
17208
|
* @slot end - Whatever belongs at the end of the title line: a button, a menu, a status badge, a version. Named for the position, not for a kind of content, because anything can sit there.
|
|
16897
17209
|
*/
|
|
16898
|
-
var _NLDDTitle
|
|
16899
|
-
var BREAKPOINTS = [
|
|
16900
|
-
"sm",
|
|
16901
|
-
"md",
|
|
16902
|
-
"lg"
|
|
16903
|
-
];
|
|
16904
|
-
/** The font size of size 1 per breakpoint: the floor of a custom size. */
|
|
16905
|
-
var SIZE_1_FONT_SIZE = {
|
|
16906
|
-
sm: "var(--primitives-font-size-700)",
|
|
16907
|
-
md: "var(--primitives-font-size-800)",
|
|
16908
|
-
lg: "var(--primitives-font-size-1000)"
|
|
16909
|
-
};
|
|
16910
|
-
/** Font-size values that are not a length: the CSS-wide keywords and the
|
|
16911
|
-
* absolute and relative size keywords. */
|
|
16912
|
-
var NOT_A_LENGTH = /* @__PURE__ */ new Set([
|
|
16913
|
-
"inherit",
|
|
16914
|
-
"initial",
|
|
16915
|
-
"unset",
|
|
16916
|
-
"revert",
|
|
16917
|
-
"revert-layer",
|
|
16918
|
-
"xx-small",
|
|
16919
|
-
"x-small",
|
|
16920
|
-
"small",
|
|
16921
|
-
"medium",
|
|
16922
|
-
"large",
|
|
16923
|
-
"x-large",
|
|
16924
|
-
"xx-large",
|
|
16925
|
-
"xxx-large",
|
|
16926
|
-
"larger",
|
|
16927
|
-
"smaller",
|
|
16928
|
-
"math"
|
|
16929
|
-
]);
|
|
16930
|
-
/** A length font-size takes. A keyword cannot go inside the max() that keeps the floor, so it would void the whole font. */
|
|
16931
|
-
function isFontSize(value) {
|
|
16932
|
-
return !NOT_A_LENGTH.has(value.toLowerCase()) && CSS.supports("font-size", value);
|
|
16933
|
-
}
|
|
16934
|
-
var NLDDTitle = (_NLDDTitle = class NLDDTitle extends LitElement {
|
|
17210
|
+
var _NLDDTitle = class NLDDTitle extends LitElement {
|
|
16935
17211
|
constructor(..._args) {
|
|
16936
17212
|
super(..._args);
|
|
16937
17213
|
this.size = 3;
|
|
@@ -16958,60 +17234,22 @@ var NLDDTitle = (_NLDDTitle = class NLDDTitle extends LitElement {
|
|
|
16958
17234
|
willUpdate(changed) {
|
|
16959
17235
|
super.willUpdate(changed);
|
|
16960
17236
|
if (!changed.has("smCustomSize") && !changed.has("mdCustomSize") && !changed.has("lgCustomSize")) return;
|
|
16961
|
-
|
|
16962
|
-
const own = {
|
|
17237
|
+
this._customSizes = applyCustomFontSizes(this, "title", {
|
|
16963
17238
|
sm: this.smCustomSize,
|
|
16964
17239
|
md: this.mdCustomSize,
|
|
16965
17240
|
lg: this.lgCustomSize
|
|
16966
|
-
};
|
|
16967
|
-
this._customSizes = {};
|
|
16968
|
-
let invalid = false;
|
|
16969
|
-
for (const breakpoint of BREAKPOINTS) {
|
|
16970
|
-
const value = (own[breakpoint] || "").trim();
|
|
16971
|
-
const valid = value !== "" && isFontSize(value);
|
|
16972
|
-
if (valid) {
|
|
16973
|
-
this._customSizes[breakpoint] = value;
|
|
16974
|
-
this.style.setProperty(`--_title-${breakpoint}-custom-size`, value);
|
|
16975
|
-
} else this.style.removeProperty(`--_title-${breakpoint}-custom-size`);
|
|
16976
|
-
this.toggleAttribute(`data-${breakpoint}-custom-size`, valid);
|
|
16977
|
-
if (value !== "" && !valid) invalid = true;
|
|
16978
|
-
}
|
|
16979
|
-
setState$1(this, "invalid-custom-size", invalid);
|
|
17241
|
+
});
|
|
16980
17242
|
}
|
|
16981
17243
|
updated(changed) {
|
|
16982
17244
|
super.updated(changed);
|
|
16983
17245
|
if (!import.meta.env?.DEV) return;
|
|
16984
|
-
if (changed.has("smCustomSize") || changed.has("mdCustomSize") || changed.has("lgCustomSize"))
|
|
16985
|
-
}
|
|
16986
|
-
/** DEV-only: whether a custom size is smaller than size 1, which then shows instead. */
|
|
16987
|
-
_checkFloor(sizes) {
|
|
16988
|
-
if (!this.shadowRoot || Object.keys(sizes).length === 0) {
|
|
16989
|
-
setState$1(this, "custom-size-below-floor", false);
|
|
16990
|
-
return;
|
|
16991
|
-
}
|
|
16992
|
-
const probe = document.createElement("span");
|
|
16993
|
-
probe.style.position = "absolute";
|
|
16994
|
-
probe.style.visibility = "hidden";
|
|
16995
|
-
this.shadowRoot.append(probe);
|
|
16996
|
-
const px = (value) => {
|
|
16997
|
-
probe.style.fontSize = value;
|
|
16998
|
-
return parseFloat(getComputedStyle(probe).fontSize);
|
|
16999
|
-
};
|
|
17000
|
-
let below = false;
|
|
17001
|
-
try {
|
|
17002
|
-
for (const [breakpoint, value] of Object.entries(sizes)) {
|
|
17003
|
-
if (/%|\d(?:v[whib]|vmin|vmax|cq[whib]|cqmin|cqmax|em|ex|ch|cap|ic|lh)\b/.test(value)) continue;
|
|
17004
|
-
if (px(value) < px(SIZE_1_FONT_SIZE[breakpoint]) - .5) below = true;
|
|
17005
|
-
}
|
|
17006
|
-
} finally {
|
|
17007
|
-
probe.remove();
|
|
17008
|
-
}
|
|
17009
|
-
setState$1(this, "custom-size-below-floor", below);
|
|
17246
|
+
if (changed.has("smCustomSize") || changed.has("mdCustomSize") || changed.has("lgCustomSize")) checkCustomFontSizeFloor(this, this._customSizes, DISPLAY_1_FONT_SIZE);
|
|
17010
17247
|
}
|
|
17011
17248
|
render() {
|
|
17012
17249
|
return titleTemplate(this);
|
|
17013
17250
|
}
|
|
17014
|
-
}
|
|
17251
|
+
};
|
|
17252
|
+
var NLDDTitle = (_NLDDTitle.styles = titleStyles, _NLDDTitle);
|
|
17015
17253
|
__decorate([property({
|
|
17016
17254
|
type: Number,
|
|
17017
17255
|
reflect: true
|
|
@@ -28249,6 +28487,646 @@ __decorate([property({
|
|
|
28249
28487
|
reflect: true
|
|
28250
28488
|
})], NLDDNumberField.prototype, "invalid", void 0);
|
|
28251
28489
|
NLDDNumberField = __decorate([customElement("nldd-number-field")], NLDDNumberField);
|
|
28490
|
+
// src/components/inputs/one-time-code-field/one-time-code-field.styles.ts
|
|
28491
|
+
var oneTimeCodeFieldStyles = css`
|
|
28492
|
+
:host {
|
|
28493
|
+
box-sizing: border-box;
|
|
28494
|
+
}
|
|
28495
|
+
|
|
28496
|
+
|
|
28497
|
+
/* # Host */
|
|
28498
|
+
|
|
28499
|
+
:host {
|
|
28500
|
+
--_one-time-code-field-gap: var(--primitives-space-8);
|
|
28501
|
+
--_one-time-code-field-box-size: var(--semantics-controls-md-min-size);
|
|
28502
|
+
--_one-time-code-field-box-corner-radius: var(--semantics-controls-md-corner-radius);
|
|
28503
|
+
--_one-time-code-field-box-background-color: var(--semantics-input-fields-background-color);
|
|
28504
|
+
--_one-time-code-field-font: var(--semantics-input-fields-md-text-font);
|
|
28505
|
+
--_one-time-code-field-box-font: var(--primitives-font-monospace-md-regular-flat);
|
|
28506
|
+
--_one-time-code-field-caret-width: var(--primitives-space-2);
|
|
28507
|
+
--_one-time-code-field-caret-height: var(--primitives-space-20);
|
|
28508
|
+
|
|
28509
|
+
${inheritedTextReset}
|
|
28510
|
+
display: block;
|
|
28511
|
+
max-width: 100%;
|
|
28512
|
+
-webkit-tap-highlight-color: transparent;
|
|
28513
|
+
}
|
|
28514
|
+
|
|
28515
|
+
:host([hidden]) {
|
|
28516
|
+
display: none;
|
|
28517
|
+
}
|
|
28518
|
+
|
|
28519
|
+
:host([size="sm"]) {
|
|
28520
|
+
--_one-time-code-field-gap: var(--primitives-space-6);
|
|
28521
|
+
--_one-time-code-field-box-size: var(--semantics-controls-sm-min-size);
|
|
28522
|
+
--_one-time-code-field-box-corner-radius: var(--semantics-controls-sm-corner-radius);
|
|
28523
|
+
--_one-time-code-field-font: var(--semantics-input-fields-sm-text-font);
|
|
28524
|
+
--_one-time-code-field-box-font: var(--primitives-font-monospace-sm-regular-flat);
|
|
28525
|
+
--_one-time-code-field-caret-height: var(--primitives-space-16);
|
|
28526
|
+
}
|
|
28527
|
+
|
|
28528
|
+
:host([size="lg"]) {
|
|
28529
|
+
--_one-time-code-field-gap: var(--primitives-space-10);
|
|
28530
|
+
--_one-time-code-field-box-size: var(--semantics-controls-lg-min-size);
|
|
28531
|
+
--_one-time-code-field-box-corner-radius: var(--semantics-controls-lg-corner-radius);
|
|
28532
|
+
--_one-time-code-field-box-font: var(--primitives-font-weight-body-regular) var(--primitives-font-size-300) / var(--primitives-line-height-flat) var(--primitives-font-family-monospace);
|
|
28533
|
+
--_one-time-code-field-caret-height: var(--primitives-space-28);
|
|
28534
|
+
}
|
|
28535
|
+
|
|
28536
|
+
:host([readonly]) {
|
|
28537
|
+
--_one-time-code-field-box-background-color: var(--semantics-input-fields-is-read-only-background-color);
|
|
28538
|
+
}
|
|
28539
|
+
|
|
28540
|
+
|
|
28541
|
+
/* # Block */
|
|
28542
|
+
|
|
28543
|
+
.one-time-code-field {
|
|
28544
|
+
display: flex;
|
|
28545
|
+
position: relative;
|
|
28546
|
+
width: fit-content;
|
|
28547
|
+
max-width: 100%;
|
|
28548
|
+
}
|
|
28549
|
+
|
|
28550
|
+
:host([disabled]) .one-time-code-field {
|
|
28551
|
+
opacity: var(--primitives-opacity-disabled);
|
|
28552
|
+
}
|
|
28553
|
+
|
|
28554
|
+
|
|
28555
|
+
/* # Elements */
|
|
28556
|
+
|
|
28557
|
+
.one-time-code-field__input {
|
|
28558
|
+
box-sizing: border-box;
|
|
28559
|
+
position: absolute;
|
|
28560
|
+
inset: 0;
|
|
28561
|
+
z-index: 1;
|
|
28562
|
+
margin: 0;
|
|
28563
|
+
outline: none;
|
|
28564
|
+
border: none;
|
|
28565
|
+
background: transparent;
|
|
28566
|
+
width: 100%;
|
|
28567
|
+
height: 100%;
|
|
28568
|
+
padding: 0;
|
|
28569
|
+
color: transparent;
|
|
28570
|
+
font: var(--_one-time-code-field-font);
|
|
28571
|
+
caret-color: transparent;
|
|
28572
|
+
appearance: none;
|
|
28573
|
+
}
|
|
28574
|
+
|
|
28575
|
+
.one-time-code-field__input::selection {
|
|
28576
|
+
background: transparent;
|
|
28577
|
+
}
|
|
28578
|
+
|
|
28579
|
+
.one-time-code-field__input:-webkit-autofill,
|
|
28580
|
+
.one-time-code-field__input:autofill {
|
|
28581
|
+
box-shadow: 0 0 0 999px transparent inset;
|
|
28582
|
+
-webkit-text-fill-color: transparent;
|
|
28583
|
+
}
|
|
28584
|
+
|
|
28585
|
+
:host([disabled]) .one-time-code-field__input {
|
|
28586
|
+
pointer-events: none;
|
|
28587
|
+
}
|
|
28588
|
+
|
|
28589
|
+
.one-time-code-field__boxes {
|
|
28590
|
+
display: flex;
|
|
28591
|
+
gap: var(--_one-time-code-field-gap);
|
|
28592
|
+
}
|
|
28593
|
+
|
|
28594
|
+
.one-time-code-field__box {
|
|
28595
|
+
box-sizing: border-box;
|
|
28596
|
+
display: flex;
|
|
28597
|
+
border: var(--semantics-input-fields-border);
|
|
28598
|
+
border-radius: var(--_one-time-code-field-box-corner-radius);
|
|
28599
|
+
background-color: var(--_one-time-code-field-box-background-color);
|
|
28600
|
+
width: var(--_one-time-code-field-box-size);
|
|
28601
|
+
min-width: 0;
|
|
28602
|
+
height: var(--_one-time-code-field-box-size);
|
|
28603
|
+
flex-shrink: 1;
|
|
28604
|
+
align-items: center;
|
|
28605
|
+
justify-content: center;
|
|
28606
|
+
color: var(--semantics-content-color);
|
|
28607
|
+
font: var(--_one-time-code-field-box-font);
|
|
28608
|
+
}
|
|
28609
|
+
|
|
28610
|
+
:host([invalid]) .one-time-code-field__box {
|
|
28611
|
+
border-color: var(--semantics-input-fields-is-invalid-border-color);
|
|
28612
|
+
}
|
|
28613
|
+
|
|
28614
|
+
:host([readonly]) .one-time-code-field__box {
|
|
28615
|
+
border-color: var(--semantics-input-fields-is-read-only-border-color);
|
|
28616
|
+
}
|
|
28617
|
+
|
|
28618
|
+
.one-time-code-field__box.is-active {
|
|
28619
|
+
outline: var(--semantics-focus-ring-outline);
|
|
28620
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
28621
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
28622
|
+
}
|
|
28623
|
+
|
|
28624
|
+
.one-time-code-field__separator {
|
|
28625
|
+
display: flex;
|
|
28626
|
+
align-items: center;
|
|
28627
|
+
color: var(--semantics-content-secondary-color);
|
|
28628
|
+
font: var(--_one-time-code-field-box-font);
|
|
28629
|
+
white-space: pre;
|
|
28630
|
+
}
|
|
28631
|
+
|
|
28632
|
+
.one-time-code-field__character {
|
|
28633
|
+
position: relative;
|
|
28634
|
+
}
|
|
28635
|
+
|
|
28636
|
+
.one-time-code-field__caret {
|
|
28637
|
+
background-color: currentColor;
|
|
28638
|
+
width: var(--_one-time-code-field-caret-width);
|
|
28639
|
+
height: var(--_one-time-code-field-caret-height);
|
|
28640
|
+
animation: one-time-code-field-blink 1s step-end infinite;
|
|
28641
|
+
}
|
|
28642
|
+
|
|
28643
|
+
.one-time-code-field__caret.is-after {
|
|
28644
|
+
position: absolute;
|
|
28645
|
+
top: 50%;
|
|
28646
|
+
left: 100%;
|
|
28647
|
+
margin-left: var(--_one-time-code-field-caret-width);
|
|
28648
|
+
transform: translateY(-50%);
|
|
28649
|
+
}
|
|
28650
|
+
|
|
28651
|
+
@media (prefers-reduced-motion: reduce) {
|
|
28652
|
+
.one-time-code-field__caret {
|
|
28653
|
+
animation: none;
|
|
28654
|
+
}
|
|
28655
|
+
}
|
|
28656
|
+
|
|
28657
|
+
@keyframes one-time-code-field-blink {
|
|
28658
|
+
50% {
|
|
28659
|
+
opacity: 0;
|
|
28660
|
+
}
|
|
28661
|
+
}
|
|
28662
|
+
|
|
28663
|
+
|
|
28664
|
+
/* # Accessibility */
|
|
28665
|
+
|
|
28666
|
+
@media (forced-colors: active) {
|
|
28667
|
+
.one-time-code-field__box {
|
|
28668
|
+
border-color: CanvasText;
|
|
28669
|
+
}
|
|
28670
|
+
|
|
28671
|
+
.one-time-code-field__box.is-active {
|
|
28672
|
+
outline: 2px solid Highlight;
|
|
28673
|
+
}
|
|
28674
|
+
}
|
|
28675
|
+
`;
|
|
28676
|
+
// src/components/inputs/one-time-code-field/one-time-code-field.template.ts
|
|
28677
|
+
function renderBox(component, index) {
|
|
28678
|
+
const character = component.charAt(index);
|
|
28679
|
+
const active = index === component.activeBox;
|
|
28680
|
+
const caret = active && !component.readonly;
|
|
28681
|
+
return html`
|
|
28682
|
+
<div class=${classMap({
|
|
28683
|
+
"one-time-code-field__box": true,
|
|
28684
|
+
"is-filled": character !== "",
|
|
28685
|
+
"is-active": active
|
|
28686
|
+
})}>
|
|
28687
|
+
${character === "" ? caret ? html`<span class="one-time-code-field__caret"></span>` : nothing : html`
|
|
28688
|
+
<span class="one-time-code-field__character">
|
|
28689
|
+
${character}
|
|
28690
|
+
${caret ? html`<span class="one-time-code-field__caret is-after"></span>` : nothing}
|
|
28691
|
+
</span>
|
|
28692
|
+
`}
|
|
28693
|
+
</div>
|
|
28694
|
+
`;
|
|
28695
|
+
}
|
|
28696
|
+
function renderBoxes(component) {
|
|
28697
|
+
const parts = component.formatParts;
|
|
28698
|
+
if (!parts) return Array.from({ length: component.boxes }, (_, index) => renderBox(component, index));
|
|
28699
|
+
let index = 0;
|
|
28700
|
+
return parts.map((part) => part === BOX ? renderBox(component, index++) : html`<span class="one-time-code-field__separator">${part}</span>`);
|
|
28701
|
+
}
|
|
28702
|
+
function oneTimeCodeFieldTemplate(component) {
|
|
28703
|
+
return html`
|
|
28704
|
+
<div class="one-time-code-field">
|
|
28705
|
+
<input class="one-time-code-field__input"
|
|
28706
|
+
id=${component.inputId || nothing}
|
|
28707
|
+
type="text"
|
|
28708
|
+
inputmode=${component.type === "alphanumeric" ? "text" : "numeric"}
|
|
28709
|
+
autocomplete="one-time-code"
|
|
28710
|
+
autocapitalize=${component.uppercase ? "characters" : "off"}
|
|
28711
|
+
spellcheck="false"
|
|
28712
|
+
pattern=${component.pattern}
|
|
28713
|
+
maxlength=${component.boxes}
|
|
28714
|
+
.value=${component.value}
|
|
28715
|
+
?disabled=${component.disabled}
|
|
28716
|
+
?readonly=${component.readonly}
|
|
28717
|
+
?required=${component.required}
|
|
28718
|
+
name=${component.name || nothing}
|
|
28719
|
+
aria-label=${component.accessibleLabel || nothing}
|
|
28720
|
+
aria-invalid=${component.invalid ? "true" : nothing}
|
|
28721
|
+
@focus=${component._handleFocus}
|
|
28722
|
+
@blur=${component._handleBlur}
|
|
28723
|
+
@pointerdown=${component._handlePointerDown}
|
|
28724
|
+
@select=${component._keepNativeCaretAtEnd}
|
|
28725
|
+
@pointerup=${component._keepNativeCaretAtEnd}
|
|
28726
|
+
@keydown=${component._handleKeydown}
|
|
28727
|
+
@beforeinput=${component._handleBeforeInput}
|
|
28728
|
+
@input=${component._handleInput}
|
|
28729
|
+
@change=${component._handleChange}
|
|
28730
|
+
>
|
|
28731
|
+
<div class="one-time-code-field__boxes"
|
|
28732
|
+
aria-hidden="true"
|
|
28733
|
+
>
|
|
28734
|
+
${renderBoxes(component)}
|
|
28735
|
+
</div>
|
|
28736
|
+
</div>
|
|
28737
|
+
`;
|
|
28738
|
+
}
|
|
28739
|
+
// src/components/inputs/one-time-code-field/one-time-code-field.ts
|
|
28740
|
+
/**
|
|
28741
|
+
* Nederlandse Digitale Dienst One-Time Code Field Component (Lit + TypeScript)
|
|
28742
|
+
*
|
|
28743
|
+
* A field for a code someone receives once and types over: by text message,
|
|
28744
|
+
* by email, from an authenticator app or on a letter. It shows a box per
|
|
28745
|
+
* character, but it is one native input underneath, so pasting the whole code,
|
|
28746
|
+
* the code a phone offers from a text message (`autocomplete="one-time-code"`),
|
|
28747
|
+
* a screen reader and voice control all work as on any other field.
|
|
28748
|
+
*
|
|
28749
|
+
* The characters are monospace, so 0 and O, or 1, l and I, read apart.
|
|
28750
|
+
*
|
|
28751
|
+
* Typing fills the boxes from the left. The arrow keys, Home, End and a click
|
|
28752
|
+
* move the caret from box to box. In a filled box it stands after the
|
|
28753
|
+
* character: Backspace empties that box, without moving the rest up, so you
|
|
28754
|
+
* type the right one straight in. A pasted code drops whatever is not part of
|
|
28755
|
+
* one, so "123 456" or "123-456" becomes "123456", and a whole code replaces
|
|
28756
|
+
* what was there. From a pasted sentence, such as a text message, the field
|
|
28757
|
+
* takes the last word that is as long as the code, so "Your code is 123456"
|
|
28758
|
+
* fills in "123456". Once every box is full
|
|
28759
|
+
* the field fires `nldd-complete`, and again after a correction that leaves it
|
|
28760
|
+
* full. Submitting then is up to your app: send the form, or wait for a
|
|
28761
|
+
* button, but never both, or a correction submits twice.
|
|
28762
|
+
*
|
|
28763
|
+
* Not for a PIN or a password, which must not be readable on screen: use
|
|
28764
|
+
* `nldd-password-field`. Put the field in an `nldd-form-field`, whose label
|
|
28765
|
+
* says where the code comes from ("Code uit de sms").
|
|
28766
|
+
*
|
|
28767
|
+
* @element nldd-one-time-code-field
|
|
28768
|
+
*
|
|
28769
|
+
* @attr {string} size - 'sm' | 'md' (default) | 'lg'. 'lg' has boxes of 56px with larger characters, for a page where the code is the only thing to do, such as signing in.
|
|
28770
|
+
* @attr {number} length - How many characters the code has (default: 6).
|
|
28771
|
+
* @attr {string} format - The shape of a code that is printed in groups, such as '###-###' or '#### ####': each `#` is a box, anything else a separator you see but a screen reader does not hear. The number of `#` is then the length, so `format` wins over `length`. The value never holds a separator: '123-234' is submitted as '123234'. Leave it out for a code without groups, as most codes from a text message are.
|
|
28772
|
+
* @attr {string} accessible-label - Accessible label forwarded to the inner input. Set automatically by nldd-form-field.
|
|
28773
|
+
* @attr {boolean} invalid - Marks the field as invalid
|
|
28774
|
+
* @attr {boolean} readonly - Readonly state
|
|
28775
|
+
* @attr {boolean} disabled - Disabled state
|
|
28776
|
+
* @attr {string} input-id - Sets the id on the native input. Set automatically by nldd-form-field.
|
|
28777
|
+
* @attr {string} name - Input name for form submission
|
|
28778
|
+
* @attr {string} value - The code
|
|
28779
|
+
* @attr {string} type - What the code holds: 'numeric' (default, digits only, raises the number keyboard) | 'alphanumeric' (letters and digits)
|
|
28780
|
+
* @attr {boolean} uppercase - Turns letters into capitals as they are typed or pasted, in the boxes and in the value. Only with `type="alphanumeric"`, and only for a code where case does not matter, as with most activation codes. Leave it off for a code that tells "a" from "A", such as some recovery codes: a value turned into capitals would no longer match.
|
|
28781
|
+
* @attr {boolean} required - Required state. A code that is not complete counts as invalid too.
|
|
28782
|
+
*
|
|
28783
|
+
* @fires input - When the code changes; detail: { value: string }
|
|
28784
|
+
* @fires change - When the code is committed; detail: { value: string }
|
|
28785
|
+
* @fires nldd-complete - When every box is filled; detail: { value: string }
|
|
28786
|
+
*/
|
|
28787
|
+
var _NLDDOneTimeCodeField;
|
|
28788
|
+
var DEFAULT_LENGTH = 6;
|
|
28789
|
+
/** A box in the format; any other part is a separator. */
|
|
28790
|
+
var BOX = Symbol("box");
|
|
28791
|
+
/** Characters that are not part of a code of this type. */
|
|
28792
|
+
var NOT_IN_CODE = {
|
|
28793
|
+
numeric: /[^0-9]/g,
|
|
28794
|
+
alphanumeric: /[^0-9A-Za-z]/g
|
|
28795
|
+
};
|
|
28796
|
+
var IN_CODE = {
|
|
28797
|
+
numeric: "[0-9]",
|
|
28798
|
+
alphanumeric: "[0-9A-Za-z]"
|
|
28799
|
+
};
|
|
28800
|
+
var NLDDOneTimeCodeField = (_NLDDOneTimeCodeField = class NLDDOneTimeCodeField extends DescribedBy(FormAssociated(LitElement)) {
|
|
28801
|
+
constructor(..._args) {
|
|
28802
|
+
super(..._args);
|
|
28803
|
+
this._initialValue = "";
|
|
28804
|
+
this.size = "md";
|
|
28805
|
+
this.length = DEFAULT_LENGTH;
|
|
28806
|
+
this.format = "";
|
|
28807
|
+
this.accessibleLabel = "";
|
|
28808
|
+
this.invalid = false;
|
|
28809
|
+
this.readonly = false;
|
|
28810
|
+
this.disabled = false;
|
|
28811
|
+
this.inputId = "";
|
|
28812
|
+
this.name = "";
|
|
28813
|
+
this.value = "";
|
|
28814
|
+
this.type = "numeric";
|
|
28815
|
+
this.uppercase = false;
|
|
28816
|
+
this.required = false;
|
|
28817
|
+
this._focused = false;
|
|
28818
|
+
this._chars = [];
|
|
28819
|
+
this._box = 0;
|
|
28820
|
+
this._completed = "";
|
|
28821
|
+
this._pressedBox = null;
|
|
28822
|
+
}
|
|
28823
|
+
/** The format as boxes and the separators between them, or null without a usable format. */
|
|
28824
|
+
get formatParts() {
|
|
28825
|
+
if (!this.format?.includes("#")) return null;
|
|
28826
|
+
return (this.format.match(/#|[^#]+/g) ?? []).map((part) => part === "#" ? BOX : part);
|
|
28827
|
+
}
|
|
28828
|
+
/** The length: the boxes in the format, or else `length` as a whole number of at least one. */
|
|
28829
|
+
get boxes() {
|
|
28830
|
+
const parts = this.formatParts;
|
|
28831
|
+
if (parts) return parts.filter((part) => part === BOX).length;
|
|
28832
|
+
const length = Math.floor(Number(this.length));
|
|
28833
|
+
return Number.isFinite(length) && length > 0 ? length : DEFAULT_LENGTH;
|
|
28834
|
+
}
|
|
28835
|
+
/** The `pattern` the native input checks: exactly `boxes` characters of the type. */
|
|
28836
|
+
get pattern() {
|
|
28837
|
+
return `${IN_CODE[this.type] ?? IN_CODE.numeric}{${this.boxes}}`;
|
|
28838
|
+
}
|
|
28839
|
+
/** The character in a box, '' when it is empty. */
|
|
28840
|
+
charAt(index) {
|
|
28841
|
+
return this._chars[index] ?? "";
|
|
28842
|
+
}
|
|
28843
|
+
/**
|
|
28844
|
+
* The box with the focus ring, or -1 while the field has no focus. A
|
|
28845
|
+
* readonly field gets the ring too, since the boxes are its only focus
|
|
28846
|
+
* indicator, but no caret.
|
|
28847
|
+
*/
|
|
28848
|
+
get activeBox() {
|
|
28849
|
+
if (!this._focused) return -1;
|
|
28850
|
+
return Math.min(this._box, this.boxes - 1);
|
|
28851
|
+
}
|
|
28852
|
+
/** Keeps what belongs in a code, up to the length. */
|
|
28853
|
+
_clean(raw) {
|
|
28854
|
+
const code = raw.replace(NOT_IN_CODE[this.type] ?? NOT_IN_CODE.numeric, "").slice(0, this.boxes);
|
|
28855
|
+
return this.uppercase ? code.toUpperCase() : code;
|
|
28856
|
+
}
|
|
28857
|
+
/**
|
|
28858
|
+
* The code in a pasted text: the last word as long as the code, so a
|
|
28859
|
+
* sentence around it, or a phone number before it, falls away. Without such
|
|
28860
|
+
* a word the whole text is cleaned, as when typed.
|
|
28861
|
+
*/
|
|
28862
|
+
_codeIn(raw) {
|
|
28863
|
+
const pattern = NOT_IN_CODE[this.type] ?? NOT_IN_CODE.numeric;
|
|
28864
|
+
const word = raw.split(/\s+/).map((part) => part.replace(pattern, "")).reverse().find((part) => part.length === this.boxes);
|
|
28865
|
+
return this._clean(word ?? raw);
|
|
28866
|
+
}
|
|
28867
|
+
/** The boxes for a value set from outside, filled from the left. */
|
|
28868
|
+
_charsOf(value) {
|
|
28869
|
+
return Array.from({ length: this.boxes }, (_, index) => value[index] ?? "");
|
|
28870
|
+
}
|
|
28871
|
+
willUpdate(changed) {
|
|
28872
|
+
if ([
|
|
28873
|
+
"value",
|
|
28874
|
+
"type",
|
|
28875
|
+
"length",
|
|
28876
|
+
"format",
|
|
28877
|
+
"uppercase"
|
|
28878
|
+
].some((key) => changed.has(key))) {
|
|
28879
|
+
const clean = this._clean(this.value ?? "");
|
|
28880
|
+
if (clean !== this.value) this.value = clean;
|
|
28881
|
+
const own = this._chars.join("");
|
|
28882
|
+
if (this.value !== own || this._chars.length !== this.boxes) this._chars = this._charsOf(this.value);
|
|
28883
|
+
}
|
|
28884
|
+
}
|
|
28885
|
+
firstUpdated() {
|
|
28886
|
+
this._initialValue = this.value;
|
|
28887
|
+
}
|
|
28888
|
+
formValue() {
|
|
28889
|
+
return this.value;
|
|
28890
|
+
}
|
|
28891
|
+
formResetCallback() {
|
|
28892
|
+
this.value = this._initialValue;
|
|
28893
|
+
}
|
|
28894
|
+
formStateRestoreCallback(state) {
|
|
28895
|
+
if (typeof state === "string") this.value = state;
|
|
28896
|
+
}
|
|
28897
|
+
/** The first empty box, or the last one when every box is filled. */
|
|
28898
|
+
get _nextBox() {
|
|
28899
|
+
const empty = this._chars.indexOf("");
|
|
28900
|
+
return empty === -1 ? this.boxes - 1 : empty;
|
|
28901
|
+
}
|
|
28902
|
+
_moveTo(box) {
|
|
28903
|
+
this._box = Math.max(0, Math.min(box, this.boxes - 1));
|
|
28904
|
+
}
|
|
28905
|
+
/** The box under a point, or the nearest one. The text in the input is not laid out over the boxes, so a press finds its box here. */
|
|
28906
|
+
_boxAt(x) {
|
|
28907
|
+
const boxes = [...this.shadowRoot?.querySelectorAll(".one-time-code-field__box") ?? []];
|
|
28908
|
+
let nearest = 0;
|
|
28909
|
+
let distance = Infinity;
|
|
28910
|
+
boxes.forEach((box, index) => {
|
|
28911
|
+
const { left, right } = box.getBoundingClientRect();
|
|
28912
|
+
const away = x < left ? left - x : x > right ? x - right : 0;
|
|
28913
|
+
if (away < distance) {
|
|
28914
|
+
distance = away;
|
|
28915
|
+
nearest = index;
|
|
28916
|
+
}
|
|
28917
|
+
});
|
|
28918
|
+
return nearest;
|
|
28919
|
+
}
|
|
28920
|
+
/**
|
|
28921
|
+
* A press puts the caret in that box. With a mouse the field takes the
|
|
28922
|
+
* focus itself, so the browser never places a caret of its own; a touch
|
|
28923
|
+
* keeps the browser's focus, which is what raises the keyboard.
|
|
28924
|
+
*/
|
|
28925
|
+
_handlePointerDown(e) {
|
|
28926
|
+
const box = this._boxAt(e.clientX);
|
|
28927
|
+
this._pressedBox = box;
|
|
28928
|
+
this._moveTo(box);
|
|
28929
|
+
if (e.pointerType !== "mouse" || this.disabled) return;
|
|
28930
|
+
e.preventDefault();
|
|
28931
|
+
this._input.focus();
|
|
28932
|
+
}
|
|
28933
|
+
_handleFocus() {
|
|
28934
|
+
this._focused = true;
|
|
28935
|
+
if (this._pressedBox === null) this._moveTo(this._nextBox);
|
|
28936
|
+
this._pressedBox = null;
|
|
28937
|
+
this._keepNativeCaretAtEnd();
|
|
28938
|
+
}
|
|
28939
|
+
_handleBlur() {
|
|
28940
|
+
this._focused = false;
|
|
28941
|
+
this._pressedBox = null;
|
|
28942
|
+
}
|
|
28943
|
+
/** The native caret means nothing here; at the end it never selects a part of the code. */
|
|
28944
|
+
_keepNativeCaretAtEnd() {
|
|
28945
|
+
const input = this._input;
|
|
28946
|
+
if (!input || this.shadowRoot?.activeElement !== input) return;
|
|
28947
|
+
const end = input.value.length;
|
|
28948
|
+
if (input.selectionStart !== end || input.selectionEnd !== end) input.setSelectionRange(end, end);
|
|
28949
|
+
}
|
|
28950
|
+
/**
|
|
28951
|
+
* Typing writes the box the caret is in when it is empty, and the next one
|
|
28952
|
+
* when it is filled, so the caret after a character reads as in any field.
|
|
28953
|
+
* Backspace empties the box, or the one before it when it is already empty;
|
|
28954
|
+
* nothing moves up. A paste of a whole code replaces it, a part fills from
|
|
28955
|
+
* the caret on.
|
|
28956
|
+
*/
|
|
28957
|
+
_handleBeforeInput(e) {
|
|
28958
|
+
if (this.readonly || this.disabled) return;
|
|
28959
|
+
switch (e.inputType) {
|
|
28960
|
+
case "insertText": {
|
|
28961
|
+
e.preventDefault();
|
|
28962
|
+
const typed = this._clean(e.data ?? "");
|
|
28963
|
+
if (typed) this._write(typed, false);
|
|
28964
|
+
return;
|
|
28965
|
+
}
|
|
28966
|
+
case "insertFromPaste":
|
|
28967
|
+
case "insertFromDrop":
|
|
28968
|
+
case "insertReplacementText": {
|
|
28969
|
+
e.preventDefault();
|
|
28970
|
+
const text = this._codeIn(e.dataTransfer?.getData("text/plain") ?? e.data ?? "");
|
|
28971
|
+
if (text) this._write(text, true);
|
|
28972
|
+
return;
|
|
28973
|
+
}
|
|
28974
|
+
case "deleteContentBackward":
|
|
28975
|
+
case "deleteWordBackward":
|
|
28976
|
+
case "deleteSoftLineBackward":
|
|
28977
|
+
case "deleteHardLineBackward": {
|
|
28978
|
+
e.preventDefault();
|
|
28979
|
+
const box = this.activeBox < 0 ? this._box : this.activeBox;
|
|
28980
|
+
const target = this.charAt(box) ? box : box - 1;
|
|
28981
|
+
if (target < 0) return;
|
|
28982
|
+
this._setChars(this._chars.map((char, index) => index === target ? "" : char), target);
|
|
28983
|
+
return;
|
|
28984
|
+
}
|
|
28985
|
+
case "deleteContentForward":
|
|
28986
|
+
e.preventDefault();
|
|
28987
|
+
this._setChars(this._chars.map((char, index) => index === this._box ? "" : char), this._box);
|
|
28988
|
+
return;
|
|
28989
|
+
}
|
|
28990
|
+
}
|
|
28991
|
+
/** Writes characters from the caret on; a whole code at once replaces what was there. */
|
|
28992
|
+
_write(text, pasted) {
|
|
28993
|
+
if (pasted && text.length === this.boxes) {
|
|
28994
|
+
this._setChars(text.split(""), this.boxes - 1);
|
|
28995
|
+
return;
|
|
28996
|
+
}
|
|
28997
|
+
const chars = [...this._chars];
|
|
28998
|
+
let box = this.charAt(this._box) && !pasted ? this._box + 1 : this._box;
|
|
28999
|
+
if (box >= this.boxes) box = this.boxes - 1;
|
|
29000
|
+
for (const char of text) {
|
|
29001
|
+
if (box >= this.boxes) break;
|
|
29002
|
+
chars[box] = char;
|
|
29003
|
+
box++;
|
|
29004
|
+
}
|
|
29005
|
+
this._setChars(chars, box);
|
|
29006
|
+
}
|
|
29007
|
+
_handleKeydown(e) {
|
|
29008
|
+
submitOnEnter(this, e);
|
|
29009
|
+
if (e.altKey || e.ctrlKey || e.metaKey) return;
|
|
29010
|
+
const move = {
|
|
29011
|
+
ArrowLeft: () => this._box - 1,
|
|
29012
|
+
ArrowRight: () => Math.min(this._box + 1, this._nextBox),
|
|
29013
|
+
Home: () => 0,
|
|
29014
|
+
End: () => this._nextBox
|
|
29015
|
+
}[e.key];
|
|
29016
|
+
if (!move) return;
|
|
29017
|
+
e.preventDefault();
|
|
29018
|
+
this._moveTo(move());
|
|
29019
|
+
}
|
|
29020
|
+
/** Input that did not come through beforeinput, such as a code a phone fills in: take it from the start. */
|
|
29021
|
+
_handleInput(e) {
|
|
29022
|
+
e.stopPropagation();
|
|
29023
|
+
const clean = this._clean(this._input.value);
|
|
29024
|
+
this._setChars(this._charsOf(clean), Math.min(clean.length, this.boxes - 1));
|
|
29025
|
+
}
|
|
29026
|
+
_setChars(chars, box) {
|
|
29027
|
+
this._chars = chars;
|
|
29028
|
+
this._moveTo(box);
|
|
29029
|
+
const value = chars.join("");
|
|
29030
|
+
const input = this._input;
|
|
29031
|
+
if (input.value !== value) input.value = value;
|
|
29032
|
+
this._keepNativeCaretAtEnd();
|
|
29033
|
+
const changed = value !== this.value;
|
|
29034
|
+
this.value = value;
|
|
29035
|
+
this.commitFormValue();
|
|
29036
|
+
if (!changed) return;
|
|
29037
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
29038
|
+
detail: { value: this.value },
|
|
29039
|
+
bubbles: true,
|
|
29040
|
+
composed: true
|
|
29041
|
+
}));
|
|
29042
|
+
if (chars.includes("") || value.length < this.boxes) this._completed = "";
|
|
29043
|
+
else if (value !== this._completed) {
|
|
29044
|
+
this._completed = value;
|
|
29045
|
+
this.dispatchEvent(new CustomEvent("nldd-complete", {
|
|
29046
|
+
detail: { value },
|
|
29047
|
+
bubbles: true,
|
|
29048
|
+
composed: true
|
|
29049
|
+
}));
|
|
29050
|
+
}
|
|
29051
|
+
}
|
|
29052
|
+
_handleChange(e) {
|
|
29053
|
+
e.stopPropagation();
|
|
29054
|
+
this.commitFormValue();
|
|
29055
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
29056
|
+
detail: { value: this.value },
|
|
29057
|
+
bubbles: true,
|
|
29058
|
+
composed: true
|
|
29059
|
+
}));
|
|
29060
|
+
}
|
|
29061
|
+
blur() {
|
|
29062
|
+
this._input?.blur();
|
|
29063
|
+
}
|
|
29064
|
+
/** Delegates focus to the inner native `<input>`. */
|
|
29065
|
+
focus(options) {
|
|
29066
|
+
if (deferFocus(this, options)) return;
|
|
29067
|
+
this._input?.focus(options);
|
|
29068
|
+
}
|
|
29069
|
+
render() {
|
|
29070
|
+
return oneTimeCodeFieldTemplate(this);
|
|
29071
|
+
}
|
|
29072
|
+
}, _NLDDOneTimeCodeField.shadowRootOptions = {
|
|
29073
|
+
...LitElement.shadowRootOptions,
|
|
29074
|
+
delegatesFocus: true
|
|
29075
|
+
}, _NLDDOneTimeCodeField.styles = oneTimeCodeFieldStyles, _NLDDOneTimeCodeField.isFormInput = true, _NLDDOneTimeCodeField.blocksImplicitSubmission = true, _NLDDOneTimeCodeField);
|
|
29076
|
+
__decorate([property({
|
|
29077
|
+
reflect: true,
|
|
29078
|
+
converter: reflectNonDefault("md")
|
|
29079
|
+
})], NLDDOneTimeCodeField.prototype, "size", void 0);
|
|
29080
|
+
__decorate([property({
|
|
29081
|
+
reflect: true,
|
|
29082
|
+
converter: reflectNonDefault(DEFAULT_LENGTH)
|
|
29083
|
+
})], NLDDOneTimeCodeField.prototype, "length", void 0);
|
|
29084
|
+
__decorate([property({
|
|
29085
|
+
reflect: true,
|
|
29086
|
+
converter: reflectNonDefault("")
|
|
29087
|
+
})], NLDDOneTimeCodeField.prototype, "format", void 0);
|
|
29088
|
+
__decorate([property({
|
|
29089
|
+
type: String,
|
|
29090
|
+
attribute: "accessible-label"
|
|
29091
|
+
})], NLDDOneTimeCodeField.prototype, "accessibleLabel", void 0);
|
|
29092
|
+
__decorate([property({
|
|
29093
|
+
type: Boolean,
|
|
29094
|
+
reflect: true
|
|
29095
|
+
})], NLDDOneTimeCodeField.prototype, "invalid", void 0);
|
|
29096
|
+
__decorate([property({
|
|
29097
|
+
type: Boolean,
|
|
29098
|
+
reflect: true
|
|
29099
|
+
})], NLDDOneTimeCodeField.prototype, "readonly", void 0);
|
|
29100
|
+
__decorate([property({
|
|
29101
|
+
type: Boolean,
|
|
29102
|
+
reflect: true
|
|
29103
|
+
})], NLDDOneTimeCodeField.prototype, "disabled", void 0);
|
|
29104
|
+
__decorate([property({
|
|
29105
|
+
type: String,
|
|
29106
|
+
attribute: "input-id"
|
|
29107
|
+
})], NLDDOneTimeCodeField.prototype, "inputId", void 0);
|
|
29108
|
+
__decorate([property({
|
|
29109
|
+
reflect: true,
|
|
29110
|
+
converter: reflectNonDefault("")
|
|
29111
|
+
})], NLDDOneTimeCodeField.prototype, "name", void 0);
|
|
29112
|
+
__decorate([property({ type: String })], NLDDOneTimeCodeField.prototype, "value", void 0);
|
|
29113
|
+
__decorate([property({
|
|
29114
|
+
reflect: true,
|
|
29115
|
+
converter: reflectNonDefault("numeric")
|
|
29116
|
+
})], NLDDOneTimeCodeField.prototype, "type", void 0);
|
|
29117
|
+
__decorate([property({
|
|
29118
|
+
type: Boolean,
|
|
29119
|
+
reflect: true
|
|
29120
|
+
})], NLDDOneTimeCodeField.prototype, "uppercase", void 0);
|
|
29121
|
+
__decorate([property({
|
|
29122
|
+
type: Boolean,
|
|
29123
|
+
reflect: true
|
|
29124
|
+
})], NLDDOneTimeCodeField.prototype, "required", void 0);
|
|
29125
|
+
__decorate([state()], NLDDOneTimeCodeField.prototype, "_focused", void 0);
|
|
29126
|
+
__decorate([state()], NLDDOneTimeCodeField.prototype, "_chars", void 0);
|
|
29127
|
+
__decorate([state()], NLDDOneTimeCodeField.prototype, "_box", void 0);
|
|
29128
|
+
__decorate([query(".one-time-code-field__input")], NLDDOneTimeCodeField.prototype, "_input", void 0);
|
|
29129
|
+
NLDDOneTimeCodeField = __decorate([customElement("nldd-one-time-code-field")], NLDDOneTimeCodeField);
|
|
28252
29130
|
// src/components/inputs/password-field/password-field.styles.ts
|
|
28253
29131
|
var passwordFieldStyles = css`
|
|
28254
29132
|
:host {
|
|
@@ -29871,7 +30749,8 @@ var searchFieldStyles = css`
|
|
|
29871
30749
|
// src/components/inputs/search-field/search-field.template.ts
|
|
29872
30750
|
function searchFieldTemplate(component) {
|
|
29873
30751
|
const buttonSize = component.size === "sm" ? "xs" : "sm";
|
|
29874
|
-
const
|
|
30752
|
+
const hasSearchButton = component.searchButton !== null;
|
|
30753
|
+
const hasEnd = Boolean(component.value) || hasSearchButton;
|
|
29875
30754
|
return html`
|
|
29876
30755
|
<div class="search-field">
|
|
29877
30756
|
<label class="search-field__label">
|
|
@@ -29922,10 +30801,10 @@ function searchFieldTemplate(component) {
|
|
|
29922
30801
|
></nldd-icon-button>
|
|
29923
30802
|
</div>
|
|
29924
30803
|
` : nothing}
|
|
29925
|
-
${
|
|
30804
|
+
${hasSearchButton ? html`
|
|
29926
30805
|
<div class="search-field__search-button">
|
|
29927
30806
|
<nldd-button
|
|
29928
|
-
appearance
|
|
30807
|
+
appearance=${component.searchButton === "accent-filled" ? "accent-filled" : "neutral-tinted"}
|
|
29929
30808
|
size=${buttonSize}
|
|
29930
30809
|
text=${component._t("components.search-field.search-action")}
|
|
29931
30810
|
@click=${component._handleSearch}
|
|
@@ -29949,7 +30828,7 @@ function searchFieldTemplate(component) {
|
|
|
29949
30828
|
* @attr {string} width - Optional fixed width (any CSS length, e.g. "240px"). Default: stretches to fill container.
|
|
29950
30829
|
* @attr {string} placeholder - Placeholder text for the input
|
|
29951
30830
|
* @attr {string} accessible-label - Accessible name (aria-label) of the native input. Falls back to `placeholder`, and keeps it when a value is typed. That works while the placeholder names the field ('Zoek een gebruiker'); set this when the placeholder is an example instead ('bijv. Jansen'). Without a visible label the placeholder is the only text on screen, so a name of your own starts with it: someone who works the computer by voice says what they see, and a name that leaves it out does not answer (WCAG 2.5.3).
|
|
29952
|
-
* @attr {
|
|
30831
|
+
* @attr {string} search-button - Shows a search button on the right, in the appearance you name: 'neutral-tinted' (also with no value) | 'accent-filled'. Leave it out for no button: Enter searches as well. 'accent-filled' is for a page where searching is the main task, such as a search page; in a header or above a list the quiet one fits.
|
|
29953
30832
|
* @attr {string} shortcut - Keyboard shortcut hint shown at the right end of the empty field, e.g. 'Cmd+K' or '/'. Display only (rendered via nldd-keyboard-shortcut): it does not bind the key, wire up focusing the field in your app. Hidden while the field has focus or a value, and on touch-only devices. Joins the field's description for screen readers.
|
|
29954
30833
|
* @attr {string} shortcut-mac - Override of `shortcut` on macOS, where the keys differ (falls back to `shortcut`).
|
|
29955
30834
|
* @attr {string} shortcut-windows - Override of `shortcut` on Windows (falls back to `shortcut`).
|
|
@@ -29978,7 +30857,7 @@ var _NLDDSearchField = class NLDDSearchField extends DescribedBy(FormAssociated(
|
|
|
29978
30857
|
this.width = "";
|
|
29979
30858
|
this.placeholder = "Zoeken";
|
|
29980
30859
|
this.accessibleLabel = "";
|
|
29981
|
-
this.
|
|
30860
|
+
this.searchButton = null;
|
|
29982
30861
|
this.shortcut = "";
|
|
29983
30862
|
this.shortcutMac = "";
|
|
29984
30863
|
this.shortcutWindows = "";
|
|
@@ -30095,10 +30974,10 @@ __decorate([property({
|
|
|
30095
30974
|
attribute: "accessible-label"
|
|
30096
30975
|
})], NLDDSearchField.prototype, "accessibleLabel", void 0);
|
|
30097
30976
|
__decorate([property({
|
|
30098
|
-
type:
|
|
30977
|
+
type: String,
|
|
30099
30978
|
reflect: true,
|
|
30100
|
-
attribute: "
|
|
30101
|
-
})], NLDDSearchField.prototype, "
|
|
30979
|
+
attribute: "search-button"
|
|
30980
|
+
})], NLDDSearchField.prototype, "searchButton", void 0);
|
|
30102
30981
|
__decorate([property({
|
|
30103
30982
|
reflect: true,
|
|
30104
30983
|
converter: reflectNonDefault("")
|
|
@@ -39996,6 +40875,8 @@ var textFieldStyles = css`
|
|
|
39996
40875
|
--_text-field-inline-padding: var(--semantics-controls-md-inline-padding);
|
|
39997
40876
|
--_text-field-font: var(--semantics-input-fields-md-text-font);
|
|
39998
40877
|
--_text-field-validation-icon-size: var(--semantics-input-fields-md-validation-icon-size);
|
|
40878
|
+
--_text-field-end-padding-right: calc((var(--_text-field-min-size) - var(--semantics-controls-sm-min-size)) / 2 - var(--semantics-input-fields-border-width));
|
|
40879
|
+
--_text-field-button-focus-z-index: 1;
|
|
39999
40880
|
|
|
40000
40881
|
${inheritedTextReset}
|
|
40001
40882
|
display: block;
|
|
@@ -40014,6 +40895,7 @@ var textFieldStyles = css`
|
|
|
40014
40895
|
--_text-field-inline-padding: var(--semantics-controls-sm-inline-padding);
|
|
40015
40896
|
--_text-field-font: var(--semantics-input-fields-sm-text-font);
|
|
40016
40897
|
--_text-field-validation-icon-size: var(--semantics-input-fields-sm-validation-icon-size);
|
|
40898
|
+
--_text-field-end-padding-right: calc((var(--_text-field-min-size) - var(--semantics-controls-xs-min-size)) / 2 - var(--semantics-input-fields-border-width));
|
|
40017
40899
|
}
|
|
40018
40900
|
|
|
40019
40901
|
|
|
@@ -40054,7 +40936,7 @@ var textFieldStyles = css`
|
|
|
40054
40936
|
--_text-field-background-color: var(--semantics-input-fields-is-autofill-background-color);
|
|
40055
40937
|
}
|
|
40056
40938
|
|
|
40057
|
-
.text-field:focus-
|
|
40939
|
+
.text-field:has(.text-field__input:focus-visible) {
|
|
40058
40940
|
outline: var(--semantics-focus-ring-outline);
|
|
40059
40941
|
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
40060
40942
|
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
@@ -40136,6 +41018,23 @@ var textFieldStyles = css`
|
|
|
40136
41018
|
width: var(--_text-field-validation-icon-size);
|
|
40137
41019
|
height: var(--_text-field-validation-icon-size);
|
|
40138
41020
|
}
|
|
41021
|
+
|
|
41022
|
+
.text-field__end {
|
|
41023
|
+
display: flex;
|
|
41024
|
+
position: relative;
|
|
41025
|
+
padding-right: var(--_text-field-end-padding-right);
|
|
41026
|
+
flex-shrink: 0;
|
|
41027
|
+
align-items: center;
|
|
41028
|
+
}
|
|
41029
|
+
|
|
41030
|
+
.text-field__end[hidden] {
|
|
41031
|
+
display: none;
|
|
41032
|
+
}
|
|
41033
|
+
|
|
41034
|
+
.text-field__button:focus-within {
|
|
41035
|
+
position: relative;
|
|
41036
|
+
z-index: var(--_text-field-button-focus-z-index);
|
|
41037
|
+
}
|
|
40139
41038
|
`;
|
|
40140
41039
|
// src/components/inputs/text-field/text-field.template.ts
|
|
40141
41040
|
function renderValidationIcon$2(component) {
|
|
@@ -40184,6 +41083,11 @@ function textFieldTemplate(component) {
|
|
|
40184
41083
|
/>
|
|
40185
41084
|
<div class="text-field__input-fade"></div>
|
|
40186
41085
|
${renderValidationIcon$2(component)}
|
|
41086
|
+
<div class="text-field__end" ?hidden=${!component._hasButton}>
|
|
41087
|
+
<div class="text-field__button">
|
|
41088
|
+
<slot name="button" @slotchange=${component._handleButtonSlotChange}></slot>
|
|
41089
|
+
</div>
|
|
41090
|
+
</div>
|
|
40187
41091
|
</div>
|
|
40188
41092
|
`;
|
|
40189
41093
|
}
|
|
@@ -40214,6 +41118,8 @@ function textFieldTemplate(component) {
|
|
|
40214
41118
|
* @attr {number} minlength - Fewest characters the value may have.
|
|
40215
41119
|
* @attr {number} maxlength - Most characters the value may have.
|
|
40216
41120
|
*
|
|
41121
|
+
* @slot button - One `nldd-button` or `nldd-icon-button` at the end of the field, for the one action of a form that is only this field: sign up with an email address, redeem a code. The field sets its `size`, `sm` in a field of `md` and `xs` in one of `sm`, so it sits inside the border; a `size` of your own is overwritten. A disabled field disables the button too. Give it `type="submit"` in a form, and its own `text`. A form with more fields keeps its buttons in `nldd-form-actions`.
|
|
41122
|
+
*
|
|
40217
41123
|
* @fires input - When input value changes
|
|
40218
41124
|
* @fires change - When input value is committed
|
|
40219
41125
|
*/
|
|
@@ -40244,13 +41150,18 @@ var NLDDTextField = (_NLDDTextField = class NLDDTextField extends DescribedBy(Fo
|
|
|
40244
41150
|
this.accessibleLabel = "";
|
|
40245
41151
|
this.noSpellcheck = false;
|
|
40246
41152
|
this.width = "";
|
|
41153
|
+
this._hasButton = false;
|
|
40247
41154
|
this.pattern = "";
|
|
41155
|
+
this._sized = /* @__PURE__ */ new WeakSet();
|
|
41156
|
+
this._disabledButtons = /* @__PURE__ */ new WeakSet();
|
|
40248
41157
|
}
|
|
40249
41158
|
firstUpdated() {
|
|
40250
41159
|
this._initialValue = this.value;
|
|
40251
41160
|
}
|
|
40252
41161
|
updated(changed) {
|
|
40253
41162
|
if (changed.has("keyboard") || changed.has("type")) this._syncKeyboardConflict();
|
|
41163
|
+
if (changed.has("size")) this._sizeButton();
|
|
41164
|
+
if (changed.has("disabled")) this._disableButton();
|
|
40254
41165
|
if (changed.has("width")) {
|
|
40255
41166
|
const w = this.width;
|
|
40256
41167
|
if (w && w !== "full" && CSS.supports("width", w)) this.style.setProperty("--_text-field-width", w);
|
|
@@ -40264,6 +41175,35 @@ var NLDDTextField = (_NLDDTextField = class NLDDTextField extends DescribedBy(Fo
|
|
|
40264
41175
|
const implied = KEYBOARD_IMPLIED_BY_TYPE[this.type];
|
|
40265
41176
|
setState$1(this, "keyboard-contradicts-type", !!this.keyboard && !!implied && this.keyboard !== implied);
|
|
40266
41177
|
}
|
|
41178
|
+
/** The size a slotted button gets: one step below the field, so it fits inside the border. */
|
|
41179
|
+
get buttonSize() {
|
|
41180
|
+
return this.size === "sm" ? "xs" : "sm";
|
|
41181
|
+
}
|
|
41182
|
+
_buttons() {
|
|
41183
|
+
return (this.shadowRoot?.querySelector("slot[name=\"button\"]"))?.assignedElements({ flatten: true }) ?? [];
|
|
41184
|
+
}
|
|
41185
|
+
_sizeButton() {
|
|
41186
|
+
for (const button of this._buttons()) {
|
|
41187
|
+
const own = button.getAttribute("size");
|
|
41188
|
+
if (own !== null && own !== this.buttonSize && !this._sized.has(button)) setState$1(this, "own-button-size-overwritten", true);
|
|
41189
|
+
if (own !== this.buttonSize) button.setAttribute("size", this.buttonSize);
|
|
41190
|
+
this._sized.add(button);
|
|
41191
|
+
}
|
|
41192
|
+
}
|
|
41193
|
+
_disableButton() {
|
|
41194
|
+
for (const button of this._buttons()) if (this.disabled && !button.hasAttribute("disabled")) {
|
|
41195
|
+
button.setAttribute("disabled", "");
|
|
41196
|
+
this._disabledButtons.add(button);
|
|
41197
|
+
} else if (!this.disabled && this._disabledButtons.has(button)) {
|
|
41198
|
+
button.removeAttribute("disabled");
|
|
41199
|
+
this._disabledButtons.delete(button);
|
|
41200
|
+
}
|
|
41201
|
+
}
|
|
41202
|
+
_handleButtonSlotChange() {
|
|
41203
|
+
this._hasButton = this._buttons().length > 0;
|
|
41204
|
+
this._sizeButton();
|
|
41205
|
+
this._disableButton();
|
|
41206
|
+
}
|
|
40267
41207
|
formValue() {
|
|
40268
41208
|
return this.value;
|
|
40269
41209
|
}
|
|
@@ -40380,6 +41320,7 @@ __decorate([property({
|
|
|
40380
41320
|
converter: reflectNonDefault("")
|
|
40381
41321
|
})], NLDDTextField.prototype, "width", void 0);
|
|
40382
41322
|
__decorate([query(".text-field__input")], NLDDTextField.prototype, "_input", void 0);
|
|
41323
|
+
__decorate([state()], NLDDTextField.prototype, "_hasButton", void 0);
|
|
40383
41324
|
__decorate([property({
|
|
40384
41325
|
reflect: true,
|
|
40385
41326
|
converter: reflectNonDefault("")
|
|
@@ -52374,23 +53315,23 @@ __decorate([state()], NLDDPageFooter.prototype, "_hasBreadcrumbs", void 0);
|
|
|
52374
53315
|
__decorate([state()], NLDDPageFooter.prototype, "_hasMain", void 0);
|
|
52375
53316
|
__decorate([state()], NLDDPageFooter.prototype, "_hasLegalBar", void 0);
|
|
52376
53317
|
NLDDPageFooter = __decorate([customElement("nldd-page-footer")], NLDDPageFooter);
|
|
52377
|
-
// src/components/layout/
|
|
52378
|
-
var
|
|
53318
|
+
// src/components/layout/column-board/column-board.styles.ts
|
|
53319
|
+
var columnBoardStyles = css`
|
|
52379
53320
|
|
|
52380
53321
|
|
|
52381
53322
|
/* # Host */
|
|
52382
53323
|
|
|
52383
53324
|
:host {
|
|
52384
|
-
--
|
|
52385
|
-
--
|
|
52386
|
-
--
|
|
52387
|
-
--
|
|
52388
|
-
--
|
|
53325
|
+
--_column-board-gap: var(--primitives-space-12);
|
|
53326
|
+
--_column-board-fade-size: var(--primitives-space-32);
|
|
53327
|
+
--_column-board-fade-left: var(--primitives-space-0);
|
|
53328
|
+
--_column-board-fade-right: var(--primitives-space-0);
|
|
53329
|
+
--_column-board-height: auto;
|
|
52389
53330
|
|
|
52390
53331
|
box-sizing: border-box;
|
|
52391
53332
|
display: block;
|
|
52392
53333
|
min-width: 0;
|
|
52393
|
-
height: var(--
|
|
53334
|
+
height: var(--_column-board-height);
|
|
52394
53335
|
}
|
|
52395
53336
|
|
|
52396
53337
|
:host([hidden]) {
|
|
@@ -52400,41 +53341,41 @@ var taskBoardStyles = css`
|
|
|
52400
53341
|
|
|
52401
53342
|
/* # Block */
|
|
52402
53343
|
|
|
52403
|
-
.
|
|
53344
|
+
.column-board {
|
|
52404
53345
|
display: flex;
|
|
52405
53346
|
height: 100%;
|
|
52406
53347
|
overflow-x: auto;
|
|
52407
|
-
gap: var(--
|
|
53348
|
+
gap: var(--_column-board-gap);
|
|
52408
53349
|
align-items: stretch;
|
|
52409
53350
|
scroll-snap-type: x proximity;
|
|
52410
|
-
scroll-padding-inline: var(--
|
|
52411
|
-
mask-image: linear-gradient(to right, transparent 0, black var(--
|
|
53351
|
+
scroll-padding-inline: var(--_column-board-gap);
|
|
53352
|
+
mask-image: linear-gradient(to right, transparent 0, black var(--_column-board-fade-left), black calc(100% - var(--_column-board-fade-right)), transparent 100%);
|
|
52412
53353
|
}
|
|
52413
53354
|
|
|
52414
|
-
.
|
|
52415
|
-
--
|
|
53355
|
+
.column-board.can-scroll-left {
|
|
53356
|
+
--_column-board-fade-left: var(--_column-board-fade-size);
|
|
52416
53357
|
}
|
|
52417
53358
|
|
|
52418
|
-
.
|
|
52419
|
-
--
|
|
53359
|
+
.column-board.can-scroll-right {
|
|
53360
|
+
--_column-board-fade-right: var(--_column-board-fade-size);
|
|
52420
53361
|
}
|
|
52421
53362
|
|
|
52422
53363
|
/* Snapping would pull the board back after every step it scrolls while an
|
|
52423
53364
|
item is dragged to its edge. */
|
|
52424
|
-
.
|
|
53365
|
+
.column-board.is-dragging {
|
|
52425
53366
|
scroll-snap-type: none;
|
|
52426
53367
|
}
|
|
52427
53368
|
|
|
52428
|
-
.
|
|
53369
|
+
.column-board:focus-visible {
|
|
52429
53370
|
outline: var(--semantics-focus-ring-outline);
|
|
52430
53371
|
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
52431
53372
|
}
|
|
52432
53373
|
|
|
52433
|
-
::slotted(nldd-
|
|
53374
|
+
::slotted(nldd-column-board-column) {
|
|
52434
53375
|
scroll-snap-align: start;
|
|
52435
53376
|
}
|
|
52436
53377
|
|
|
52437
|
-
.
|
|
53378
|
+
.column-board__announcer {
|
|
52438
53379
|
position: absolute;
|
|
52439
53380
|
width: 1px;
|
|
52440
53381
|
height: 1px;
|
|
@@ -52443,50 +53384,50 @@ var taskBoardStyles = css`
|
|
|
52443
53384
|
overflow: hidden;
|
|
52444
53385
|
}
|
|
52445
53386
|
`;
|
|
52446
|
-
var
|
|
53387
|
+
var columnBoardColumnStyles = css`
|
|
52447
53388
|
|
|
52448
53389
|
|
|
52449
53390
|
/* # Host */
|
|
52450
53391
|
|
|
52451
53392
|
:host {
|
|
52452
|
-
--
|
|
52453
|
-
--
|
|
52454
|
-
--
|
|
52455
|
-
--
|
|
52456
|
-
--
|
|
52457
|
-
--
|
|
52458
|
-
--
|
|
52459
|
-
--
|
|
52460
|
-
--
|
|
52461
|
-
--
|
|
52462
|
-
--
|
|
52463
|
-
--
|
|
52464
|
-
--
|
|
52465
|
-
--
|
|
52466
|
-
--
|
|
52467
|
-
--
|
|
52468
|
-
--
|
|
52469
|
-
--
|
|
52470
|
-
--
|
|
52471
|
-
--
|
|
52472
|
-
--
|
|
52473
|
-
--
|
|
52474
|
-
--
|
|
52475
|
-
--
|
|
52476
|
-
--
|
|
52477
|
-
--
|
|
52478
|
-
--
|
|
52479
|
-
--
|
|
52480
|
-
--
|
|
52481
|
-
--
|
|
52482
|
-
--
|
|
52483
|
-
--
|
|
53393
|
+
--_column-board-column-width: var(--primitives-area-280);
|
|
53394
|
+
--_column-board-column-corner-radius: var(--semantics-surfaces-corner-radius);
|
|
53395
|
+
--_column-board-column-highlight-border-width: var(--semantics-surfaces-highlight-border-width);
|
|
53396
|
+
--_column-board-column-highlight-border-color: var(--semantics-surfaces-tinted-highlight-border-color);
|
|
53397
|
+
--_column-board-column-background-color: var(--semantics-surfaces-tinted-background-color);
|
|
53398
|
+
--_column-board-column-drop-border-width: var(--semantics-drop-targets-border-width);
|
|
53399
|
+
--_column-board-column-available-border-color: var(--semantics-drop-targets-is-available-border-color);
|
|
53400
|
+
--_column-board-column-over-border-color: var(--semantics-drop-targets-is-over-border-color);
|
|
53401
|
+
--_column-board-column-over-background-color: var(--semantics-drop-targets-is-over-background-color);
|
|
53402
|
+
--_column-board-column-header-padding: var(--primitives-space-12) var(--primitives-space-16) var(--primitives-space-4);
|
|
53403
|
+
--_column-board-column-header-gap: var(--primitives-space-8);
|
|
53404
|
+
--_column-board-column-title-font: var(--primitives-font-body-md-bold-tight);
|
|
53405
|
+
--_column-board-column-count-color: var(--semantics-content-secondary-color);
|
|
53406
|
+
--_column-board-column-count-font: var(--primitives-font-body-sm-regular-tight);
|
|
53407
|
+
--_column-board-column-main-gap: var(--primitives-space-8);
|
|
53408
|
+
--_column-board-column-main-padding: var(--primitives-space-8);
|
|
53409
|
+
--_column-board-column-main-min-height: var(--primitives-space-80);
|
|
53410
|
+
--_column-board-column-main-fade-size: var(--primitives-space-24);
|
|
53411
|
+
--_column-board-column-main-fade-top: var(--primitives-space-0);
|
|
53412
|
+
--_column-board-column-main-fade-bottom: var(--primitives-space-0);
|
|
53413
|
+
--_column-board-column-placeholder-background-color: var(--semantics-drop-targets-placeholder-background-color);
|
|
53414
|
+
--_column-board-column-placeholder-corner-radius: var(--semantics-surfaces-corner-radius);
|
|
53415
|
+
--_column-board-column-placeholder-border-width: var(--semantics-drop-targets-border-width);
|
|
53416
|
+
--_column-board-column-placeholder-border-color: var(--semantics-drop-indicators-color);
|
|
53417
|
+
--_column-board-column-placeholder-top: 0px;
|
|
53418
|
+
--_column-board-column-placeholder-left: 0px;
|
|
53419
|
+
--_column-board-column-placeholder-width: 0px;
|
|
53420
|
+
--_column-board-column-placeholder-height: 0px;
|
|
53421
|
+
--_column-board-column-indicator-top: 0px;
|
|
53422
|
+
--_column-board-column-indicator-inset: var(--primitives-space-8);
|
|
53423
|
+
--_column-board-column-indicator-thickness: var(--primitives-border-width-regular);
|
|
53424
|
+
--_column-board-column-indicator-color: var(--semantics-drop-indicators-color);
|
|
52484
53425
|
|
|
52485
53426
|
${inheritedTextReset}
|
|
52486
53427
|
box-sizing: border-box;
|
|
52487
53428
|
display: flex;
|
|
52488
53429
|
flex-shrink: 0;
|
|
52489
|
-
width: var(--
|
|
53430
|
+
width: var(--_column-board-column-width);
|
|
52490
53431
|
min-height: 0;
|
|
52491
53432
|
}
|
|
52492
53433
|
|
|
@@ -52497,80 +53438,80 @@ var taskBoardColumnStyles = css`
|
|
|
52497
53438
|
|
|
52498
53439
|
/* # Block */
|
|
52499
53440
|
|
|
52500
|
-
.
|
|
53441
|
+
.column-board-column {
|
|
52501
53442
|
box-sizing: border-box;
|
|
52502
53443
|
display: flex;
|
|
52503
|
-
border-radius: var(--
|
|
52504
|
-
box-shadow: inset 0 0 0 var(--
|
|
52505
|
-
background-color: var(--
|
|
53444
|
+
border-radius: var(--_column-board-column-corner-radius);
|
|
53445
|
+
box-shadow: inset 0 0 0 var(--_column-board-column-highlight-border-width) var(--_column-board-column-highlight-border-color);
|
|
53446
|
+
background-color: var(--_column-board-column-background-color);
|
|
52506
53447
|
width: 100%;
|
|
52507
53448
|
min-height: 0;
|
|
52508
53449
|
max-height: 100%;
|
|
52509
53450
|
flex-direction: column;
|
|
52510
53451
|
}
|
|
52511
53452
|
|
|
52512
|
-
.
|
|
52513
|
-
--
|
|
52514
|
-
--
|
|
53453
|
+
.column-board-column.is-drop-available {
|
|
53454
|
+
--_column-board-column-highlight-border-width: var(--_column-board-column-drop-border-width);
|
|
53455
|
+
--_column-board-column-highlight-border-color: var(--_column-board-column-available-border-color);
|
|
52515
53456
|
}
|
|
52516
53457
|
|
|
52517
|
-
.
|
|
52518
|
-
--
|
|
52519
|
-
--
|
|
52520
|
-
--
|
|
53458
|
+
.column-board-column.is-drop-over {
|
|
53459
|
+
--_column-board-column-highlight-border-width: var(--_column-board-column-drop-border-width);
|
|
53460
|
+
--_column-board-column-highlight-border-color: var(--_column-board-column-over-border-color);
|
|
53461
|
+
--_column-board-column-background-color: var(--_column-board-column-over-background-color);
|
|
52521
53462
|
}
|
|
52522
53463
|
|
|
52523
53464
|
|
|
52524
53465
|
/* # Elements */
|
|
52525
53466
|
|
|
52526
|
-
.
|
|
53467
|
+
.column-board-column__header {
|
|
52527
53468
|
display: flex;
|
|
52528
53469
|
flex-shrink: 0;
|
|
52529
|
-
padding: var(--
|
|
52530
|
-
gap: var(--
|
|
53470
|
+
padding: var(--_column-board-column-header-padding);
|
|
53471
|
+
gap: var(--_column-board-column-header-gap);
|
|
52531
53472
|
align-items: center;
|
|
52532
53473
|
}
|
|
52533
53474
|
|
|
52534
|
-
.
|
|
53475
|
+
.column-board-column__title {
|
|
52535
53476
|
min-width: 0;
|
|
52536
53477
|
flex-grow: 1;
|
|
52537
53478
|
color: var(--semantics-content-color);
|
|
52538
|
-
font: var(--
|
|
53479
|
+
font: var(--_column-board-column-title-font);
|
|
52539
53480
|
text-wrap: balance;
|
|
52540
53481
|
}
|
|
52541
53482
|
|
|
52542
|
-
.
|
|
53483
|
+
.column-board-column__count {
|
|
52543
53484
|
flex-shrink: 0;
|
|
52544
|
-
color: var(--
|
|
52545
|
-
font: var(--
|
|
53485
|
+
color: var(--_column-board-column-count-color);
|
|
53486
|
+
font: var(--_column-board-column-count-font);
|
|
52546
53487
|
}
|
|
52547
53488
|
|
|
52548
|
-
.
|
|
53489
|
+
.column-board-column__main {
|
|
52549
53490
|
box-sizing: border-box;
|
|
52550
53491
|
display: flex;
|
|
52551
53492
|
position: relative;
|
|
52552
|
-
min-height: var(--
|
|
53493
|
+
min-height: var(--_column-board-column-main-min-height);
|
|
52553
53494
|
overflow-y: auto;
|
|
52554
|
-
padding: var(--
|
|
53495
|
+
padding: var(--_column-board-column-main-padding);
|
|
52555
53496
|
flex-direction: column;
|
|
52556
53497
|
flex-grow: 1;
|
|
52557
|
-
gap: var(--
|
|
52558
|
-
mask-image: linear-gradient(to bottom, transparent 0, black var(--
|
|
53498
|
+
gap: var(--_column-board-column-main-gap);
|
|
53499
|
+
mask-image: linear-gradient(to bottom, transparent 0, black var(--_column-board-column-main-fade-top), black calc(100% - var(--_column-board-column-main-fade-bottom)), transparent 100%);
|
|
52559
53500
|
}
|
|
52560
53501
|
|
|
52561
|
-
.
|
|
52562
|
-
--
|
|
53502
|
+
.column-board-column__main.can-scroll-up {
|
|
53503
|
+
--_column-board-column-main-fade-top: var(--_column-board-column-main-fade-size);
|
|
52563
53504
|
}
|
|
52564
53505
|
|
|
52565
|
-
.
|
|
52566
|
-
--
|
|
53506
|
+
.column-board-column__main.can-scroll-down {
|
|
53507
|
+
--_column-board-column-main-fade-bottom: var(--_column-board-column-main-fade-size);
|
|
52567
53508
|
}
|
|
52568
53509
|
|
|
52569
|
-
.
|
|
53510
|
+
.column-board-column__footer {
|
|
52570
53511
|
flex-shrink: 0;
|
|
52571
53512
|
}
|
|
52572
53513
|
|
|
52573
|
-
.
|
|
53514
|
+
.column-board-column__footer[hidden] {
|
|
52574
53515
|
display: none;
|
|
52575
53516
|
}
|
|
52576
53517
|
|
|
@@ -52580,42 +53521,42 @@ var taskBoardColumnStyles = css`
|
|
|
52580
53521
|
}
|
|
52581
53522
|
|
|
52582
53523
|
/* The item keeps its place while it is dragged, as an empty slot. */
|
|
52583
|
-
::slotted([data-
|
|
53524
|
+
::slotted([data-column-board-dragging]) {
|
|
52584
53525
|
visibility: hidden;
|
|
52585
53526
|
}
|
|
52586
53527
|
|
|
52587
|
-
.
|
|
53528
|
+
.column-board-column__placeholder {
|
|
52588
53529
|
position: absolute;
|
|
52589
|
-
top: var(--
|
|
52590
|
-
left: var(--
|
|
52591
|
-
border-radius: var(--
|
|
52592
|
-
background-color: var(--
|
|
53530
|
+
top: var(--_column-board-column-placeholder-top);
|
|
53531
|
+
left: var(--_column-board-column-placeholder-left);
|
|
53532
|
+
border-radius: var(--_column-board-column-placeholder-corner-radius);
|
|
53533
|
+
background-color: var(--_column-board-column-placeholder-background-color);
|
|
52593
53534
|
pointer-events: none;
|
|
52594
|
-
width: var(--
|
|
52595
|
-
height: var(--
|
|
53535
|
+
width: var(--_column-board-column-placeholder-width);
|
|
53536
|
+
height: var(--_column-board-column-placeholder-height);
|
|
52596
53537
|
}
|
|
52597
53538
|
|
|
52598
|
-
.
|
|
52599
|
-
box-shadow: inset 0 0 0 var(--
|
|
53539
|
+
.column-board-column__placeholder.is-returning {
|
|
53540
|
+
box-shadow: inset 0 0 0 var(--_column-board-column-placeholder-border-width) var(--_column-board-column-placeholder-border-color);
|
|
52600
53541
|
}
|
|
52601
53542
|
|
|
52602
|
-
.
|
|
53543
|
+
.column-board-column__placeholder[hidden] {
|
|
52603
53544
|
display: none;
|
|
52604
53545
|
}
|
|
52605
53546
|
|
|
52606
|
-
.
|
|
53547
|
+
.column-board-column__drop-indicator {
|
|
52607
53548
|
position: absolute;
|
|
52608
|
-
top: var(--
|
|
52609
|
-
right: var(--
|
|
52610
|
-
left: var(--
|
|
52611
|
-
border-radius: var(--
|
|
52612
|
-
background-color: var(--
|
|
53549
|
+
top: var(--_column-board-column-indicator-top);
|
|
53550
|
+
right: var(--_column-board-column-indicator-inset);
|
|
53551
|
+
left: var(--_column-board-column-indicator-inset);
|
|
53552
|
+
border-radius: var(--_column-board-column-indicator-thickness);
|
|
53553
|
+
background-color: var(--_column-board-column-indicator-color);
|
|
52613
53554
|
pointer-events: none;
|
|
52614
|
-
height: var(--
|
|
53555
|
+
height: var(--_column-board-column-indicator-thickness);
|
|
52615
53556
|
transform: translateY(-50%);
|
|
52616
53557
|
}
|
|
52617
53558
|
|
|
52618
|
-
.
|
|
53559
|
+
.column-board-column__drop-indicator[hidden] {
|
|
52619
53560
|
display: none;
|
|
52620
53561
|
}
|
|
52621
53562
|
|
|
@@ -52623,84 +53564,84 @@ var taskBoardColumnStyles = css`
|
|
|
52623
53564
|
/* # High contrast */
|
|
52624
53565
|
|
|
52625
53566
|
@media (forced-colors: active) {
|
|
52626
|
-
.
|
|
52627
|
-
border: var(--
|
|
53567
|
+
.column-board-column {
|
|
53568
|
+
border: var(--_column-board-column-highlight-border-width) solid CanvasText;
|
|
52628
53569
|
}
|
|
52629
53570
|
|
|
52630
|
-
.
|
|
53571
|
+
.column-board-column__drop-indicator {
|
|
52631
53572
|
background-color: Highlight;
|
|
52632
53573
|
}
|
|
52633
53574
|
}
|
|
52634
53575
|
`;
|
|
52635
|
-
// src/components/layout/
|
|
52636
|
-
function
|
|
53576
|
+
// src/components/layout/column-board/column-board.template.ts
|
|
53577
|
+
function columnBoardTemplate(component) {
|
|
52637
53578
|
return html`
|
|
52638
53579
|
<div class=${classMap({
|
|
52639
|
-
"
|
|
53580
|
+
"column-board": true,
|
|
52640
53581
|
"can-scroll-left": component._canScrollLeft,
|
|
52641
53582
|
"can-scroll-right": component._canScrollRight,
|
|
52642
53583
|
"is-dragging": component._dragging
|
|
52643
53584
|
})}
|
|
52644
53585
|
role="region"
|
|
52645
|
-
aria-label=${component.accessibleLabel || component._t("components.
|
|
53586
|
+
aria-label=${component.accessibleLabel || component._t("components.column-board.accessible-label")}
|
|
52646
53587
|
tabindex=${component._canScrollLeft || component._canScrollRight ? "0" : nothing}
|
|
52647
53588
|
@scroll=${component._updateScroll}
|
|
52648
53589
|
>
|
|
52649
53590
|
<slot @slotchange=${component._updateScroll}></slot>
|
|
52650
53591
|
</div>
|
|
52651
|
-
<div class="
|
|
53592
|
+
<div class="column-board__announcer"
|
|
52652
53593
|
role="status"
|
|
52653
53594
|
aria-live="polite"
|
|
52654
53595
|
aria-atomic="true"
|
|
52655
53596
|
></div>
|
|
52656
53597
|
`;
|
|
52657
53598
|
}
|
|
52658
|
-
// src/components/layout/
|
|
52659
|
-
function
|
|
53599
|
+
// src/components/layout/column-board/column-board-column.template.ts
|
|
53600
|
+
function columnBoardColumnTemplate(component) {
|
|
52660
53601
|
return html`
|
|
52661
53602
|
<section class=${classMap({
|
|
52662
|
-
"
|
|
53603
|
+
"column-board-column": true,
|
|
52663
53604
|
"is-drop-available": component._dropState === "available",
|
|
52664
53605
|
"is-drop-over": component._dropState === "over"
|
|
52665
53606
|
})}
|
|
52666
53607
|
aria-label=${component.label || nothing}
|
|
52667
53608
|
>
|
|
52668
|
-
<div class="
|
|
53609
|
+
<div class="column-board-column__header">
|
|
52669
53610
|
<slot name="header">
|
|
52670
|
-
<span class="
|
|
53611
|
+
<span class="column-board-column__title">
|
|
52671
53612
|
${component.text}
|
|
52672
53613
|
</span>
|
|
52673
|
-
<span class="
|
|
53614
|
+
<span class="column-board-column__count">
|
|
52674
53615
|
${component._count}
|
|
52675
53616
|
</span>
|
|
52676
53617
|
</slot>
|
|
52677
53618
|
</div>
|
|
52678
53619
|
<div class=${classMap({
|
|
52679
|
-
"
|
|
53620
|
+
"column-board-column__main": true,
|
|
52680
53621
|
"can-scroll-up": component._canScrollUp,
|
|
52681
53622
|
"can-scroll-down": component._canScrollDown
|
|
52682
53623
|
})}
|
|
52683
53624
|
@scroll=${component._updateScroll}
|
|
52684
53625
|
>
|
|
52685
|
-
<div class="
|
|
53626
|
+
<div class="column-board-column__placeholder${component._returning ? " is-returning" : ""}"
|
|
52686
53627
|
?hidden=${!component._placeholder}
|
|
52687
53628
|
></div>
|
|
52688
53629
|
<slot @slotchange=${component._handleSlotChange}></slot>
|
|
52689
|
-
<div class="
|
|
53630
|
+
<div class="column-board-column__footer"
|
|
52690
53631
|
?hidden=${!component._hasFooter}
|
|
52691
53632
|
>
|
|
52692
53633
|
<slot name="footer" @slotchange=${component._handleFooterChange}></slot>
|
|
52693
53634
|
</div>
|
|
52694
|
-
<div class="
|
|
53635
|
+
<div class="column-board-column__drop-indicator"
|
|
52695
53636
|
?hidden=${component._dropIndex === null}
|
|
52696
53637
|
></div>
|
|
52697
53638
|
</div>
|
|
52698
53639
|
</section>
|
|
52699
53640
|
`;
|
|
52700
53641
|
}
|
|
52701
|
-
// src/components/layout/
|
|
53642
|
+
// src/components/layout/column-board/column-board-column.ts
|
|
52702
53643
|
/**
|
|
52703
|
-
* One column of an `nldd-
|
|
53644
|
+
* One column of an `nldd-column-board`: a header and the items under it. The items
|
|
52704
53645
|
* are whatever you put in the column, usually an `nldd-card` each; the board
|
|
52705
53646
|
* moves them between columns.
|
|
52706
53647
|
*
|
|
@@ -52713,7 +53654,7 @@ function taskBoardColumnTemplate(component) {
|
|
|
52713
53654
|
* The column scrolls on its own once its items do not fit the height of the
|
|
52714
53655
|
* board, and fades at the top or the bottom while there is more to scroll to.
|
|
52715
53656
|
*
|
|
52716
|
-
* @element nldd-
|
|
53657
|
+
* @element nldd-column-board-column
|
|
52717
53658
|
* @attr {string} text - The column's name, shown in the header and used as its accessible name
|
|
52718
53659
|
* @attr {string} accessible-label - Accessible name in place of `text`, for a column whose header comes from the slot
|
|
52719
53660
|
* @attr {string} value - What the column stands for in your data, such as a status; `nldd-move` reports it as `fromColumn` and `toColumn`
|
|
@@ -52722,7 +53663,7 @@ function taskBoardColumnTemplate(component) {
|
|
|
52722
53663
|
* @slot - The items
|
|
52723
53664
|
* @slot footer - Right under the last item, such as a button to add one; it scrolls along with the items
|
|
52724
53665
|
*/
|
|
52725
|
-
var
|
|
53666
|
+
var _NLDDColumnBoardColumn = class NLDDColumnBoardColumn extends LitElement {
|
|
52726
53667
|
constructor(..._args) {
|
|
52727
53668
|
super(..._args);
|
|
52728
53669
|
this.text = "";
|
|
@@ -52768,7 +53709,7 @@ var _NLDDTaskBoardColumn = class NLDDTaskBoardColumn extends LitElement {
|
|
|
52768
53709
|
this._resizeObserver.disconnect();
|
|
52769
53710
|
this._resizeObserver.observe(this._mainElement);
|
|
52770
53711
|
for (const item of this.items) this._resizeObserver.observe(item);
|
|
52771
|
-
const footer = this.shadowRoot?.querySelector(".
|
|
53712
|
+
const footer = this.shadowRoot?.querySelector(".column-board-column__footer");
|
|
52772
53713
|
if (footer) this._resizeObserver.observe(footer);
|
|
52773
53714
|
}
|
|
52774
53715
|
connectedCallback() {
|
|
@@ -52798,14 +53739,14 @@ var _NLDDTaskBoardColumn = class NLDDTaskBoardColumn extends LitElement {
|
|
|
52798
53739
|
/** Lays the placeholder over the empty place of the dragged item. */
|
|
52799
53740
|
_placePlaceholder() {
|
|
52800
53741
|
const item = this._placeholder;
|
|
52801
|
-
const placeholder = this.shadowRoot?.querySelector(".
|
|
53742
|
+
const placeholder = this.shadowRoot?.querySelector(".column-board-column__placeholder");
|
|
52802
53743
|
if (!item || !placeholder) return;
|
|
52803
53744
|
const main = this._mainElement.getBoundingClientRect();
|
|
52804
53745
|
const rect = item.getBoundingClientRect();
|
|
52805
|
-
placeholder.style.setProperty("--
|
|
52806
|
-
placeholder.style.setProperty("--
|
|
52807
|
-
placeholder.style.setProperty("--
|
|
52808
|
-
placeholder.style.setProperty("--
|
|
53746
|
+
placeholder.style.setProperty("--_column-board-column-placeholder-top", `${rect.top - main.top + this._mainElement.scrollTop}px`);
|
|
53747
|
+
placeholder.style.setProperty("--_column-board-column-placeholder-left", `${rect.left - main.left + this._mainElement.scrollLeft}px`);
|
|
53748
|
+
placeholder.style.setProperty("--_column-board-column-placeholder-width", `${rect.width}px`);
|
|
53749
|
+
placeholder.style.setProperty("--_column-board-column-placeholder-height", `${rect.height}px`);
|
|
52809
53750
|
}
|
|
52810
53751
|
/** Puts the line between the items where a dropped item would land. */
|
|
52811
53752
|
_placeIndicator() {
|
|
@@ -52819,43 +53760,43 @@ var _NLDDTaskBoardColumn = class NLDDTaskBoardColumn extends LitElement {
|
|
|
52819
53760
|
if (before) top = before.getBoundingClientRect().top - gap / 2;
|
|
52820
53761
|
else if (after) top = after.getBoundingClientRect().bottom + gap / 2;
|
|
52821
53762
|
else top = main.top + parseFloat(getComputedStyle(this._mainElement).paddingTop);
|
|
52822
|
-
this._indicator.style.setProperty("--
|
|
53763
|
+
this._indicator.style.setProperty("--_column-board-column-indicator-top", `${top - main.top + this._mainElement.scrollTop}px`);
|
|
52823
53764
|
}
|
|
52824
53765
|
render() {
|
|
52825
|
-
return
|
|
53766
|
+
return columnBoardColumnTemplate(this);
|
|
52826
53767
|
}
|
|
52827
53768
|
};
|
|
52828
|
-
var
|
|
53769
|
+
var NLDDColumnBoardColumn = (_NLDDColumnBoardColumn.styles = columnBoardColumnStyles, _NLDDColumnBoardColumn);
|
|
52829
53770
|
__decorate([property({
|
|
52830
53771
|
reflect: true,
|
|
52831
53772
|
converter: reflectNonDefault("")
|
|
52832
|
-
})],
|
|
53773
|
+
})], NLDDColumnBoardColumn.prototype, "text", void 0);
|
|
52833
53774
|
__decorate([property({
|
|
52834
53775
|
type: String,
|
|
52835
53776
|
attribute: "accessible-label"
|
|
52836
|
-
})],
|
|
53777
|
+
})], NLDDColumnBoardColumn.prototype, "accessibleLabel", void 0);
|
|
52837
53778
|
__decorate([property({
|
|
52838
53779
|
reflect: true,
|
|
52839
53780
|
converter: reflectNonDefault("")
|
|
52840
|
-
})],
|
|
52841
|
-
__decorate([state()],
|
|
52842
|
-
__decorate([state()],
|
|
52843
|
-
__decorate([state()],
|
|
52844
|
-
__decorate([state()],
|
|
52845
|
-
__decorate([state()],
|
|
52846
|
-
__decorate([state()],
|
|
52847
|
-
__decorate([state()],
|
|
52848
|
-
__decorate([state()],
|
|
52849
|
-
__decorate([query(".
|
|
52850
|
-
__decorate([query(".
|
|
52851
|
-
|
|
52852
|
-
// src/components/layout/
|
|
53781
|
+
})], NLDDColumnBoardColumn.prototype, "value", void 0);
|
|
53782
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_count", void 0);
|
|
53783
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_hasFooter", void 0);
|
|
53784
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_dropIndex", void 0);
|
|
53785
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_placeholder", void 0);
|
|
53786
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_returning", void 0);
|
|
53787
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_dropState", void 0);
|
|
53788
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_canScrollUp", void 0);
|
|
53789
|
+
__decorate([state()], NLDDColumnBoardColumn.prototype, "_canScrollDown", void 0);
|
|
53790
|
+
__decorate([query(".column-board-column__main")], NLDDColumnBoardColumn.prototype, "_mainElement", void 0);
|
|
53791
|
+
__decorate([query(".column-board-column__drop-indicator")], NLDDColumnBoardColumn.prototype, "_indicator", void 0);
|
|
53792
|
+
NLDDColumnBoardColumn = __decorate([customElement("nldd-column-board-column")], NLDDColumnBoardColumn);
|
|
53793
|
+
// src/components/layout/column-board/column-board.ts
|
|
52853
53794
|
/**
|
|
52854
|
-
* Nederlandse Digitale Dienst
|
|
53795
|
+
* Nederlandse Digitale Dienst Column Board Component (Lit + TypeScript)
|
|
52855
53796
|
*
|
|
52856
53797
|
* Columns side by side, with items you move between them: a kanban board, or
|
|
52857
53798
|
* any board where an item's column is one of its values, such as a status or a
|
|
52858
|
-
* team. Put `nldd-
|
|
53799
|
+
* team. Put `nldd-column-board-column`s in it, and the items in those, usually an
|
|
52859
53800
|
* `nldd-card` each. The board scrolls sideways once its columns do not fit, and
|
|
52860
53801
|
* a column scrolls on its own once its items do not fit the height you give the
|
|
52861
53802
|
* board.
|
|
@@ -52892,20 +53833,20 @@ NLDDTaskBoardColumn = __decorate([customElement("nldd-task-board-column")], NLDD
|
|
|
52892
53833
|
* synchronously in the handler: the board puts focus back on the item right
|
|
52893
53834
|
* after, and a screen reader hears where it landed.
|
|
52894
53835
|
*
|
|
52895
|
-
* @element nldd-
|
|
52896
|
-
* @attr {string} accessible-label - Accessible name of the board (default: "
|
|
53836
|
+
* @element nldd-column-board
|
|
53837
|
+
* @attr {string} accessible-label - Accessible name of the board (default: "Bord")
|
|
52897
53838
|
* @attr {string} height - Fixed height as a CSS length (e.g. '480px'): every column takes it, and scrolls its items once they do not fit. To fill a page or a pane, set the height in your layout instead (flex, or `height: 100%`)
|
|
52898
53839
|
* @attr {boolean} readonly - Items cannot be dragged or moved with the keyboard; they still work, and `moveItem()` still moves
|
|
52899
53840
|
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
52900
53841
|
*
|
|
52901
|
-
* @slot - The columns: `nldd-
|
|
53842
|
+
* @slot - The columns: `nldd-column-board-column`
|
|
52902
53843
|
*
|
|
52903
53844
|
* @fires nldd-move - An item moves: `{ item, fromColumn, fromIndex, toColumn, toIndex }`, where a column is its `value` (or its `text` without one)
|
|
52904
53845
|
* @fires nldd-move-denied - An item a `readonly` board does not move was dragged or moved with the keyboard: `{ item }`
|
|
52905
53846
|
*
|
|
52906
53847
|
* @method moveItem(item, toColumn, toIndex?) - Moves an item to a column, given as its `value` or as the element, at `toIndex` or at the end; fires `nldd-move` and says where it landed. Returns whether it moved.
|
|
52907
53848
|
*/
|
|
52908
|
-
var
|
|
53849
|
+
var _NLDDColumnBoard;
|
|
52909
53850
|
/** How far a mouse or pen moves before a press becomes a drag, in pixels. */
|
|
52910
53851
|
var DRAG_THRESHOLD$1 = 4;
|
|
52911
53852
|
/** How far a finger may wander while it holds an item, and how long it holds. */
|
|
@@ -52921,7 +53862,7 @@ var COLUMN_REVEAL_DELAY_MS = 300;
|
|
|
52921
53862
|
var DENIED_MS = 1500;
|
|
52922
53863
|
/** How long the pointer stays outside the board before the copy says it goes back. */
|
|
52923
53864
|
var RETURN_NOTE_DELAY_MS = 300;
|
|
52924
|
-
var
|
|
53865
|
+
var NLDDColumnBoard = (_NLDDColumnBoard = class NLDDColumnBoard extends withTranslations(LitElement, nlddColumnBoardTranslations) {
|
|
52925
53866
|
constructor(..._args) {
|
|
52926
53867
|
super(..._args);
|
|
52927
53868
|
this.accessibleLabel = "";
|
|
@@ -52979,7 +53920,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52979
53920
|
if (step === 0) {
|
|
52980
53921
|
const toIndex = fromIndex + (event.key === "ArrowUp" ? -1 : 1);
|
|
52981
53922
|
if (toIndex < 0 || toIndex > from.items.length - 1) {
|
|
52982
|
-
this._announce(this._t("components.
|
|
53923
|
+
this._announce(this._t("components.column-board.edge-text"));
|
|
52983
53924
|
return;
|
|
52984
53925
|
}
|
|
52985
53926
|
this._move(item, from, fromIndex, from, toIndex);
|
|
@@ -52987,7 +53928,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
52987
53928
|
}
|
|
52988
53929
|
const to = columns[columns.indexOf(from) + step];
|
|
52989
53930
|
if (!to) {
|
|
52990
|
-
this._announce(this._t("components.
|
|
53931
|
+
this._announce(this._t("components.column-board.edge-text"));
|
|
52991
53932
|
return;
|
|
52992
53933
|
}
|
|
52993
53934
|
this._move(item, from, fromIndex, to, Math.min(fromIndex, to.items.length));
|
|
@@ -53080,7 +54021,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53080
54021
|
}
|
|
53081
54022
|
/** The columns, in order. */
|
|
53082
54023
|
get columns() {
|
|
53083
|
-
return Array.from(this.children).filter((el) => el instanceof
|
|
54024
|
+
return Array.from(this.children).filter((el) => el instanceof NLDDColumnBoardColumn && !el.hidden);
|
|
53084
54025
|
}
|
|
53085
54026
|
connectedCallback() {
|
|
53086
54027
|
super.connectedCallback();
|
|
@@ -53102,8 +54043,8 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53102
54043
|
updated(changed) {
|
|
53103
54044
|
if (changed.has("height")) {
|
|
53104
54045
|
const height = this.height;
|
|
53105
|
-
if (height && CSS.supports("height", height)) this.style.setProperty("--
|
|
53106
|
-
else this.style.removeProperty("--
|
|
54046
|
+
if (height && CSS.supports("height", height)) this.style.setProperty("--_column-board-height", height);
|
|
54047
|
+
else this.style.removeProperty("--_column-board-height");
|
|
53107
54048
|
}
|
|
53108
54049
|
if (changed.has("readonly")) {
|
|
53109
54050
|
this._endPress();
|
|
@@ -53127,7 +54068,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53127
54068
|
const room = to.items.filter((el) => el !== item).length;
|
|
53128
54069
|
const index = Math.max(0, Math.min(toIndex ?? room, room));
|
|
53129
54070
|
if (from === to && index === fromIndex) {
|
|
53130
|
-
this._announce(this._t("components.
|
|
54071
|
+
this._announce(this._t("components.column-board.no-change-text"));
|
|
53131
54072
|
return false;
|
|
53132
54073
|
}
|
|
53133
54074
|
return this._move(item, from, fromIndex, to, index);
|
|
@@ -53149,7 +54090,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53149
54090
|
composed: true
|
|
53150
54091
|
}));
|
|
53151
54092
|
const total = to.items.filter((el) => el !== item).length + 1;
|
|
53152
|
-
this._announce(this._t("components.
|
|
54093
|
+
this._announce(this._t("components.column-board.moved-text", {
|
|
53153
54094
|
column: to.label,
|
|
53154
54095
|
position: toIndex + 1,
|
|
53155
54096
|
total
|
|
@@ -53165,7 +54106,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53165
54106
|
/** The column an element sits in as an item, if it is one in this board. */
|
|
53166
54107
|
_columnOf(item) {
|
|
53167
54108
|
const parent = item.parentElement;
|
|
53168
|
-
return parent instanceof
|
|
54109
|
+
return parent instanceof NLDDColumnBoardColumn && parent.parentElement === this && !item.slot ? parent : null;
|
|
53169
54110
|
}
|
|
53170
54111
|
/** The item an event happened in: the child of a column it came through. */
|
|
53171
54112
|
_itemFrom(event) {
|
|
@@ -53191,7 +54132,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53191
54132
|
return active instanceof HTMLElement ? active : null;
|
|
53192
54133
|
}
|
|
53193
54134
|
_announce(message) {
|
|
53194
|
-
const region = this.shadowRoot?.querySelector(".
|
|
54135
|
+
const region = this.shadowRoot?.querySelector(".column-board__announcer");
|
|
53195
54136
|
if (!region) return;
|
|
53196
54137
|
region.textContent = "";
|
|
53197
54138
|
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
@@ -53254,7 +54195,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53254
54195
|
borderRadius: this._cornerRadius(item)
|
|
53255
54196
|
});
|
|
53256
54197
|
document.body.append(ghost);
|
|
53257
|
-
item.setAttribute("data-
|
|
54198
|
+
item.setAttribute("data-column-board-dragging", "");
|
|
53258
54199
|
document.getSelection()?.removeAllRanges();
|
|
53259
54200
|
document.documentElement.style.setProperty("user-select", "none");
|
|
53260
54201
|
document.documentElement.style.setProperty("-webkit-user-select", "none");
|
|
@@ -53343,7 +54284,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53343
54284
|
}
|
|
53344
54285
|
if (!drag.note && !drag.noteTimer) drag.noteTimer = window.setTimeout(() => {
|
|
53345
54286
|
if (this._drag !== drag) return;
|
|
53346
|
-
drag.note = this._note(this._t("components.
|
|
54287
|
+
drag.note = this._note(this._t("components.column-board.drag-return-text"));
|
|
53347
54288
|
this._followReturnNote(false);
|
|
53348
54289
|
}, RETURN_NOTE_DELAY_MS);
|
|
53349
54290
|
if (!drag.note) return;
|
|
@@ -53372,7 +54313,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53372
54313
|
_columnRevealLeft(column) {
|
|
53373
54314
|
const el = this._scroller;
|
|
53374
54315
|
const styles = getComputedStyle(el);
|
|
53375
|
-
const insetStart = parseFloat(styles.getPropertyValue("--
|
|
54316
|
+
const insetStart = parseFloat(styles.getPropertyValue("--_column-board-fade-size")) || 0;
|
|
53376
54317
|
const insetEnd = insetStart;
|
|
53377
54318
|
const current = el.scrollLeft;
|
|
53378
54319
|
const rect = column.getBoundingClientRect();
|
|
@@ -53401,11 +54342,11 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53401
54342
|
const { item, from, fromIndex, target, index } = drag;
|
|
53402
54343
|
this._endDrag();
|
|
53403
54344
|
if (!target) {
|
|
53404
|
-
this._announce(this._t("components.
|
|
54345
|
+
this._announce(this._t("components.column-board.drag-canceled-text"));
|
|
53405
54346
|
return;
|
|
53406
54347
|
}
|
|
53407
54348
|
if (target === from && (index === fromIndex || index === fromIndex + 1)) {
|
|
53408
|
-
this._announce(this._t("components.
|
|
54349
|
+
this._announce(this._t("components.column-board.no-change-text"));
|
|
53409
54350
|
return;
|
|
53410
54351
|
}
|
|
53411
54352
|
this._move(item, from, fromIndex, target, target === from && index > fromIndex ? index - 1 : index);
|
|
@@ -53413,7 +54354,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53413
54354
|
_cancelDrag() {
|
|
53414
54355
|
if (!this._drag) return;
|
|
53415
54356
|
this._endDrag();
|
|
53416
|
-
this._announce(this._t("components.
|
|
54357
|
+
this._announce(this._t("components.column-board.drag-canceled-text"));
|
|
53417
54358
|
}
|
|
53418
54359
|
_endDrag() {
|
|
53419
54360
|
const drag = this._drag;
|
|
@@ -53423,7 +54364,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53423
54364
|
clearTimeout(drag.columnRevealTimer);
|
|
53424
54365
|
drag.note?.remove();
|
|
53425
54366
|
drag.ghost.remove();
|
|
53426
|
-
drag.item.removeAttribute("data-
|
|
54367
|
+
drag.item.removeAttribute("data-column-board-dragging");
|
|
53427
54368
|
if (drag.target) drag.target._dropIndex = null;
|
|
53428
54369
|
for (const column of this.columns) column._dropState = null;
|
|
53429
54370
|
drag.from._placeholder = null;
|
|
@@ -53457,7 +54398,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53457
54398
|
* and tells the app. */
|
|
53458
54399
|
_deny(item) {
|
|
53459
54400
|
this._hideDenied();
|
|
53460
|
-
const text = this._t("components.
|
|
54401
|
+
const text = this._t("components.column-board.readonly-text");
|
|
53461
54402
|
this._announce(text);
|
|
53462
54403
|
const rect = item.getBoundingClientRect();
|
|
53463
54404
|
const below = rect.top < SCROLL_EDGE;
|
|
@@ -53507,26 +54448,26 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
|
|
|
53507
54448
|
this._deniedCursor = null;
|
|
53508
54449
|
}
|
|
53509
54450
|
render() {
|
|
53510
|
-
return
|
|
54451
|
+
return columnBoardTemplate(this);
|
|
53511
54452
|
}
|
|
53512
|
-
},
|
|
54453
|
+
}, _NLDDColumnBoard.styles = columnBoardStyles, _NLDDColumnBoard);
|
|
53513
54454
|
__decorate([property({
|
|
53514
54455
|
type: String,
|
|
53515
54456
|
attribute: "accessible-label"
|
|
53516
|
-
})],
|
|
54457
|
+
})], NLDDColumnBoard.prototype, "accessibleLabel", void 0);
|
|
53517
54458
|
__decorate([property({
|
|
53518
54459
|
type: String,
|
|
53519
54460
|
reflect: true
|
|
53520
|
-
})],
|
|
54461
|
+
})], NLDDColumnBoard.prototype, "height", void 0);
|
|
53521
54462
|
__decorate([property({
|
|
53522
54463
|
type: Boolean,
|
|
53523
54464
|
reflect: true
|
|
53524
|
-
})],
|
|
53525
|
-
__decorate([query(".
|
|
53526
|
-
__decorate([state()],
|
|
53527
|
-
__decorate([state()],
|
|
53528
|
-
__decorate([state()],
|
|
53529
|
-
|
|
54465
|
+
})], NLDDColumnBoard.prototype, "readonly", void 0);
|
|
54466
|
+
__decorate([query(".column-board")], NLDDColumnBoard.prototype, "_scroller", void 0);
|
|
54467
|
+
__decorate([state()], NLDDColumnBoard.prototype, "_canScrollLeft", void 0);
|
|
54468
|
+
__decorate([state()], NLDDColumnBoard.prototype, "_canScrollRight", void 0);
|
|
54469
|
+
__decorate([state()], NLDDColumnBoard.prototype, "_dragging", void 0);
|
|
54470
|
+
NLDDColumnBoard = __decorate([customElement("nldd-column-board")], NLDDColumnBoard);
|
|
53530
54471
|
// src/components/lists-and-tables/list-item-segment/list-item-segment.styles.ts
|
|
53531
54472
|
var listItemSegmentStyles = css`
|
|
53532
54473
|
:host {
|
|
@@ -57261,6 +58202,13 @@ __decorate([property({
|
|
|
57261
58202
|
})], NLDDSkipLink.prototype, "text", void 0);
|
|
57262
58203
|
__decorate([property({ type: String })], NLDDSkipLink.prototype, "href", void 0);
|
|
57263
58204
|
NLDDSkipLink = __decorate([customElement("nldd-skip-link")], NLDDSkipLink);
|
|
58205
|
+
// src/utilities/status-bar-change.ts
|
|
58206
|
+
/**
|
|
58207
|
+
* Fired on window when an nldd-status-bar connects or disconnects, so an
|
|
58208
|
+
* nldd-top-navigation-bar measures again where its ribbon starts. In a module
|
|
58209
|
+
* of its own, so the navigation bar can listen without bundling the status bar.
|
|
58210
|
+
*/
|
|
58211
|
+
var STATUS_BAR_CHANGE = "nldd-status-bar-change";
|
|
57264
58212
|
// src/components/navigation/top-navigation-bar/top-navigation-bar.styles.ts
|
|
57265
58213
|
var smMax$2 = unsafeCSS(queryBreakpoints.smMax);
|
|
57266
58214
|
var mdMin$1 = unsafeCSS(queryBreakpoints.mdMin);
|
|
@@ -57427,6 +58375,11 @@ var topNavigationBarStyles = css`
|
|
|
57427
58375
|
}
|
|
57428
58376
|
}
|
|
57429
58377
|
|
|
58378
|
+
:host([data-under-status-bar]) .top-navigation-bar__logo::before,
|
|
58379
|
+
:host([data-under-status-bar]) .top-navigation-bar__logo > .top-navigation-bar__ribbon-at-top {
|
|
58380
|
+
display: none;
|
|
58381
|
+
}
|
|
58382
|
+
|
|
57430
58383
|
@keyframes top-navigation-bar-ribbon-at-top {
|
|
57431
58384
|
to {
|
|
57432
58385
|
visibility: hidden;
|
|
@@ -58043,7 +58996,7 @@ async function loadDependencies() {
|
|
|
58043
58996
|
Promise.resolve().then(() => list_item_exports),
|
|
58044
58997
|
Promise.resolve().then(() => text_cell_exports),
|
|
58045
58998
|
Promise.resolve().then(() => icon_cell_exports),
|
|
58046
|
-
import("./icon-
|
|
58999
|
+
import("./icon-DU_IMj2t.js").then((n) => n.n)
|
|
58047
59000
|
]);
|
|
58048
59001
|
}
|
|
58049
59002
|
/** The rows of a level, read from its container: the global menu bar's items
|
|
@@ -58133,8 +59086,14 @@ var NLDDTopNavigationBar = (_NLDDTopNavigationBar = class NLDDTopNavigationBar e
|
|
|
58133
59086
|
if (window.scrollY > 0) return;
|
|
58134
59087
|
const logo = this.shadowRoot?.querySelector(".top-navigation-bar__logo");
|
|
58135
59088
|
if (!logo) return;
|
|
58136
|
-
const
|
|
59089
|
+
const rect = logo.getBoundingClientRect();
|
|
59090
|
+
const offset = Math.max(0, Math.round(rect.top + window.scrollY));
|
|
58137
59091
|
this.style.setProperty("--_top-navigation-bar-logo-offset", `${offset}px`);
|
|
59092
|
+
const underStatusBar = [...document.querySelectorAll("nldd-status-bar")].some((bar) => {
|
|
59093
|
+
const box = bar.getBoundingClientRect();
|
|
59094
|
+
return box.height > 0 && box.bottom <= rect.top + 1 && box.left < rect.right && box.right > rect.left;
|
|
59095
|
+
});
|
|
59096
|
+
this.toggleAttribute("data-under-status-bar", underStatusBar);
|
|
58138
59097
|
};
|
|
58139
59098
|
this._handleItemSelect = (event) => {
|
|
58140
59099
|
const detail = event.detail;
|
|
@@ -58251,6 +59210,7 @@ var NLDDTopNavigationBar = (_NLDDTopNavigationBar = class NLDDTopNavigationBar e
|
|
|
58251
59210
|
this.addEventListener("select", this._handleItemSelect);
|
|
58252
59211
|
window.addEventListener("scroll", this._syncLogoOffset, { passive: true });
|
|
58253
59212
|
window.addEventListener("resize", this._syncLogoOffset, { passive: true });
|
|
59213
|
+
window.addEventListener(STATUS_BAR_CHANGE, this._syncLogoOffset);
|
|
58254
59214
|
this._setupCompactDetection();
|
|
58255
59215
|
}
|
|
58256
59216
|
disconnectedCallback() {
|
|
@@ -58258,6 +59218,7 @@ var NLDDTopNavigationBar = (_NLDDTopNavigationBar = class NLDDTopNavigationBar e
|
|
|
58258
59218
|
this.removeEventListener("select", this._handleItemSelect);
|
|
58259
59219
|
window.removeEventListener("scroll", this._syncLogoOffset);
|
|
58260
59220
|
window.removeEventListener("resize", this._syncLogoOffset);
|
|
59221
|
+
window.removeEventListener(STATUS_BAR_CHANGE, this._syncLogoOffset);
|
|
58261
59222
|
this._cleanupCompactDetection();
|
|
58262
59223
|
this._menuSheet.remove();
|
|
58263
59224
|
}
|
|
@@ -64752,6 +65713,38 @@ __decorate([state()], NLDDProgressCircle.prototype, "_arcsAtZero", void 0);
|
|
|
64752
65713
|
NLDDProgressCircle = _NLDDProgressCircle = __decorate([customElement("nldd-progress-circle")], NLDDProgressCircle);
|
|
64753
65714
|
// src/components/status-and-feedback/step-bar/step-bar.styles.ts
|
|
64754
65715
|
var smMax = unsafeCSS(queryBreakpoints.smMax);
|
|
65716
|
+
/** The least room a step gets in the row; with less, the bar goes compact. 120px at a 16px root. */
|
|
65717
|
+
var STEP_MIN_WIDTH_REM = 7.5;
|
|
65718
|
+
/** Step counts whose row needs more than the sm breakpoint. From 12 on the bar keeps the threshold of 12. */
|
|
65719
|
+
var COMPACT_COUNTS = [
|
|
65720
|
+
6,
|
|
65721
|
+
7,
|
|
65722
|
+
8,
|
|
65723
|
+
9,
|
|
65724
|
+
10,
|
|
65725
|
+
11,
|
|
65726
|
+
12
|
|
65727
|
+
];
|
|
65728
|
+
var compactBelow = (host, width) => css`
|
|
65729
|
+
${unsafeCSS(host)} .step-bar__items {
|
|
65730
|
+
/* Stays in the DOM for assistive tech. Standard visually-hidden recipe. */
|
|
65731
|
+
@container (max-width: ${width}) {
|
|
65732
|
+
position: absolute;
|
|
65733
|
+
width: 1px;
|
|
65734
|
+
height: 1px;
|
|
65735
|
+
overflow: hidden;
|
|
65736
|
+
clip-path: inset(50%);
|
|
65737
|
+
white-space: nowrap;
|
|
65738
|
+
}
|
|
65739
|
+
}
|
|
65740
|
+
|
|
65741
|
+
${unsafeCSS(host)} .step-bar__compact-text,
|
|
65742
|
+
${unsafeCSS(host)} .step-bar__compact-bar {
|
|
65743
|
+
@container (max-width: ${width}) {
|
|
65744
|
+
display: flex;
|
|
65745
|
+
}
|
|
65746
|
+
}
|
|
65747
|
+
`;
|
|
64755
65748
|
var stepBarStyles = css`
|
|
64756
65749
|
:host {
|
|
64757
65750
|
box-sizing: border-box;
|
|
@@ -64802,17 +65795,6 @@ var stepBarStyles = css`
|
|
|
64802
65795
|
.step-bar__items {
|
|
64803
65796
|
display: flex;
|
|
64804
65797
|
align-items: start;
|
|
64805
|
-
|
|
64806
|
-
/* Stays in the DOM for assistive tech when the compact view takes over.
|
|
64807
|
-
Standard visually-hidden recipe. */
|
|
64808
|
-
@container (max-width: ${smMax}) {
|
|
64809
|
-
position: absolute;
|
|
64810
|
-
width: 1px;
|
|
64811
|
-
height: 1px;
|
|
64812
|
-
overflow: hidden;
|
|
64813
|
-
clip-path: inset(50%);
|
|
64814
|
-
white-space: nowrap;
|
|
64815
|
-
}
|
|
64816
65798
|
}
|
|
64817
65799
|
|
|
64818
65800
|
.step-bar__compact-text {
|
|
@@ -64823,10 +65805,6 @@ var stepBarStyles = css`
|
|
|
64823
65805
|
align-items: baseline;
|
|
64824
65806
|
color: var(--_step-bar-compact-text-color);
|
|
64825
65807
|
font: var(--primitives-font-body-md-regular-flat);
|
|
64826
|
-
|
|
64827
|
-
@container (max-width: ${smMax}) {
|
|
64828
|
-
display: flex;
|
|
64829
|
-
}
|
|
64830
65808
|
}
|
|
64831
65809
|
|
|
64832
65810
|
.step-bar__compact-title {
|
|
@@ -64843,10 +65821,6 @@ var stepBarStyles = css`
|
|
|
64843
65821
|
display: none;
|
|
64844
65822
|
margin-top: var(--_step-bar-compact-bar-gap);
|
|
64845
65823
|
gap: var(--_step-bar-compact-bar-segment-gap);
|
|
64846
|
-
|
|
64847
|
-
@container (max-width: ${smMax}) {
|
|
64848
|
-
display: flex;
|
|
64849
|
-
}
|
|
64850
65824
|
}
|
|
64851
65825
|
|
|
64852
65826
|
.step-bar__compact-bar-segment {
|
|
@@ -64859,6 +65833,12 @@ var stepBarStyles = css`
|
|
|
64859
65833
|
.step-bar__compact-bar-segment[data-filled] {
|
|
64860
65834
|
background-color: var(--_step-bar-progress-color);
|
|
64861
65835
|
}
|
|
65836
|
+
|
|
65837
|
+
|
|
65838
|
+
/* ## Compact */
|
|
65839
|
+
|
|
65840
|
+
${compactBelow(":host", smMax)}
|
|
65841
|
+
${unsafeCSS(COMPACT_COUNTS.map((count) => compactBelow(`:host([data-steps="${count}"])`, unsafeCSS(`${count * STEP_MIN_WIDTH_REM}rem`)).cssText).join("\n"))}
|
|
64862
65842
|
`;
|
|
64863
65843
|
var stepBarItemStyles = css`
|
|
64864
65844
|
:host {
|
|
@@ -64966,6 +65946,7 @@ var stepBarItemStyles = css`
|
|
|
64966
65946
|
color: var(--_step-bar-title-color);
|
|
64967
65947
|
font: var(--primitives-font-body-sm-regular-flat);
|
|
64968
65948
|
overflow-wrap: anywhere;
|
|
65949
|
+
hyphens: auto;
|
|
64969
65950
|
text-wrap: balance;
|
|
64970
65951
|
}
|
|
64971
65952
|
|
|
@@ -65133,13 +66114,17 @@ function stepBarItemTemplate(component) {
|
|
|
65133
66114
|
* values as `nldd-step-cell`, so a flow reads in one vocabulary
|
|
65134
66115
|
* whether it runs across or down.
|
|
65135
66116
|
*
|
|
65136
|
-
* Horizontal only
|
|
65137
|
-
*
|
|
65138
|
-
*
|
|
65139
|
-
*
|
|
65140
|
-
*
|
|
65141
|
-
*
|
|
65142
|
-
*
|
|
66117
|
+
* Horizontal only, for 3 to 5 steps and 7 at most: each step needs room for
|
|
66118
|
+
* its label, and with more of them you count instead of seeing at a glance
|
|
66119
|
+
* how far you are. For more steps, or steps under each other, build an
|
|
66120
|
+
* `nldd-list` with an `nldd-step-cell` and an `nldd-title-cell` per row:
|
|
66121
|
+
* vertical steps usually carry more than a title, and a list row already does
|
|
66122
|
+
* that.
|
|
66123
|
+
*
|
|
66124
|
+
* When the bar is no wider than the sm breakpoint, or than 120px per step,
|
|
66125
|
+
* whichever is wider (a container query, so measured on the component itself
|
|
66126
|
+
* rather than on the viewport), it folds into one line of text plus a
|
|
66127
|
+
* segmented bar. A label that is too long for its step breaks at a syllable. The full list of steps stays in the DOM, only visually hidden,
|
|
65143
66128
|
* so assistive software hears no less than a wide screen shows. A step that
|
|
65144
66129
|
* is a link or a button is out of the tab order then: Tab would land on
|
|
65145
66130
|
* something you cannot see (WCAG 2.4.7).
|
|
@@ -65247,8 +66232,9 @@ var NLDDStepBar = (_NLDDStepBar = class NLDDStepBar extends withTranslations(Lit
|
|
|
65247
66232
|
this._items = [];
|
|
65248
66233
|
this._observer = new MutationObserver(() => this.requestUpdate());
|
|
65249
66234
|
this._compact = false;
|
|
66235
|
+
this._width = 0;
|
|
65250
66236
|
this._resizeObserver = new ResizeObserver(([entry]) => {
|
|
65251
|
-
this.
|
|
66237
|
+
this._width = entry.contentRect.width;
|
|
65252
66238
|
});
|
|
65253
66239
|
this._onSlotChange = (e) => {
|
|
65254
66240
|
const slot = e.target;
|
|
@@ -65266,6 +66252,11 @@ var NLDDStepBar = (_NLDDStepBar = class NLDDStepBar extends withTranslations(Lit
|
|
|
65266
66252
|
get currentItem() {
|
|
65267
66253
|
return this._items.find((item) => item.resolvedStatus === "current") ?? this._items[this.resolvedCurrent - 1];
|
|
65268
66254
|
}
|
|
66255
|
+
/** The step count the styles have a threshold for: none up to 5, where the sm breakpoint is wider than the row needs, and 12 from 12 on. */
|
|
66256
|
+
get _thresholdCount() {
|
|
66257
|
+
if (this.total < COMPACT_COUNTS[0]) return null;
|
|
66258
|
+
return Math.min(this.total, COMPACT_COUNTS[COMPACT_COUNTS.length - 1]);
|
|
66259
|
+
}
|
|
65269
66260
|
connectedCallback() {
|
|
65270
66261
|
super.connectedCallback();
|
|
65271
66262
|
this._observer.observe(this, {
|
|
@@ -65285,6 +66276,11 @@ var NLDDStepBar = (_NLDDStepBar = class NLDDStepBar extends withTranslations(Lit
|
|
|
65285
66276
|
* element renders. */
|
|
65286
66277
|
willUpdate(changed) {
|
|
65287
66278
|
super.willUpdate(changed);
|
|
66279
|
+
const count = this._thresholdCount;
|
|
66280
|
+
if (count === null) this.removeAttribute("data-steps");
|
|
66281
|
+
else this.setAttribute("data-steps", String(count));
|
|
66282
|
+
const threshold = Math.max(breakpointPx("smMax"), (count ?? 0) * STEP_MIN_WIDTH_REM * rootFontSize());
|
|
66283
|
+
this._compact = this._width > 0 && this._width <= threshold;
|
|
65288
66284
|
this._syncItems();
|
|
65289
66285
|
}
|
|
65290
66286
|
/** Push position, derived status and status text down to the children. Push
|
|
@@ -65308,7 +66304,7 @@ __decorate([property({
|
|
|
65308
66304
|
attribute: "accessible-label"
|
|
65309
66305
|
})], NLDDStepBar.prototype, "accessibleLabel", void 0);
|
|
65310
66306
|
__decorate([state()], NLDDStepBar.prototype, "_items", void 0);
|
|
65311
|
-
__decorate([state()], NLDDStepBar.prototype, "
|
|
66307
|
+
__decorate([state()], NLDDStepBar.prototype, "_width", void 0);
|
|
65312
66308
|
NLDDStepBar = __decorate([customElement("nldd-step-bar")], NLDDStepBar);
|
|
65313
66309
|
// src/components/status-and-feedback/status-bar/status-bar.styles.ts
|
|
65314
66310
|
var statusBarStyles = css`
|
|
@@ -65445,6 +66441,65 @@ var statusBarStyles = css`
|
|
|
65445
66441
|
}
|
|
65446
66442
|
|
|
65447
66443
|
|
|
66444
|
+
/* # Above the page */
|
|
66445
|
+
|
|
66446
|
+
.status-bar__above-page {
|
|
66447
|
+
display: none;
|
|
66448
|
+
}
|
|
66449
|
+
|
|
66450
|
+
/* WebKit only, as the ribbon of nldd-top-navigation-bar: Chrome paints
|
|
66451
|
+
nothing above the page. */
|
|
66452
|
+
@supports (animation-timeline: scroll()) and (font: -apple-system-body) {
|
|
66453
|
+
:host {
|
|
66454
|
+
position: relative;
|
|
66455
|
+
}
|
|
66456
|
+
|
|
66457
|
+
/* The fixed ::after only sees the document scroll, and nldd-page can be
|
|
66458
|
+
the scroller. This one sees that and goes visibility: hidden on scroll. */
|
|
66459
|
+
:host([data-at-top]) .status-bar__above-page {
|
|
66460
|
+
display: block;
|
|
66461
|
+
position: absolute;
|
|
66462
|
+
inset: 0;
|
|
66463
|
+
pointer-events: none;
|
|
66464
|
+
animation: status-bar-above-page linear both;
|
|
66465
|
+
animation-timeline: scroll(nearest);
|
|
66466
|
+
animation-range: 0 1px;
|
|
66467
|
+
}
|
|
66468
|
+
|
|
66469
|
+
/* No z-index: Safari does not paint it above the page with one. */
|
|
66470
|
+
.status-bar__above-page::before {
|
|
66471
|
+
content: '';
|
|
66472
|
+
position: absolute;
|
|
66473
|
+
bottom: 100%;
|
|
66474
|
+
left: 0;
|
|
66475
|
+
width: 100%;
|
|
66476
|
+
height: 100lvh;
|
|
66477
|
+
background-color: var(--_status-bar-background-color);
|
|
66478
|
+
}
|
|
66479
|
+
|
|
66480
|
+
/* Safari only paints above the page while something fixed touches the top edge. */
|
|
66481
|
+
.status-bar__above-page::after {
|
|
66482
|
+
content: '';
|
|
66483
|
+
position: fixed;
|
|
66484
|
+
top: 0;
|
|
66485
|
+
left: 0;
|
|
66486
|
+
z-index: -1;
|
|
66487
|
+
width: 100%;
|
|
66488
|
+
height: var(--_status-bar-height);
|
|
66489
|
+
background-color: var(--_status-bar-background-color);
|
|
66490
|
+
animation: status-bar-above-page linear both;
|
|
66491
|
+
animation-timeline: scroll(root);
|
|
66492
|
+
animation-range: 0 1px;
|
|
66493
|
+
}
|
|
66494
|
+
}
|
|
66495
|
+
|
|
66496
|
+
@keyframes status-bar-above-page {
|
|
66497
|
+
to {
|
|
66498
|
+
visibility: hidden;
|
|
66499
|
+
}
|
|
66500
|
+
}
|
|
66501
|
+
|
|
66502
|
+
|
|
65448
66503
|
/* # Action icon */
|
|
65449
66504
|
|
|
65450
66505
|
.status-bar__action-icon {
|
|
@@ -65456,6 +66511,7 @@ var statusBarStyles = css`
|
|
|
65456
66511
|
// src/components/status-and-feedback/status-bar/status-bar.template.ts
|
|
65457
66512
|
function statusBarTemplate(component) {
|
|
65458
66513
|
const interactive = Boolean(component.href || component.button);
|
|
66514
|
+
const abovePage = html`<span class="status-bar__above-page" aria-hidden="true"></span>`;
|
|
65459
66515
|
const content = html`
|
|
65460
66516
|
<span class="status-bar__text">${component.text}</span>
|
|
65461
66517
|
${interactive ? html`
|
|
@@ -65467,6 +66523,7 @@ function statusBarTemplate(component) {
|
|
|
65467
66523
|
` : nothing}
|
|
65468
66524
|
`;
|
|
65469
66525
|
if (component.href) return html`
|
|
66526
|
+
${abovePage}
|
|
65470
66527
|
<a class="status-bar"
|
|
65471
66528
|
href=${component.href}
|
|
65472
66529
|
target=${component.target || nothing}
|
|
@@ -65474,11 +66531,12 @@ function statusBarTemplate(component) {
|
|
|
65474
66531
|
>${content}</a>
|
|
65475
66532
|
`;
|
|
65476
66533
|
if (component.button) return html`
|
|
66534
|
+
${abovePage}
|
|
65477
66535
|
<button class="status-bar"
|
|
65478
66536
|
type="button"
|
|
65479
66537
|
>${content}</button>
|
|
65480
66538
|
`;
|
|
65481
|
-
return html
|
|
66539
|
+
return html`${abovePage}<div class="status-bar">${content}</div>`;
|
|
65482
66540
|
}
|
|
65483
66541
|
// src/components/status-and-feedback/status-bar/status-bar.ts
|
|
65484
66542
|
/**
|
|
@@ -65508,7 +66566,10 @@ function statusBarTemplate(component) {
|
|
|
65508
66566
|
* nldd-top-title-bar, across the whole app, also when a split view shows
|
|
65509
66567
|
* several panes. It reports the state of the service, not of one page, so it
|
|
65510
66568
|
* never sits inside the content or below a top bar. Below a top bar it says so
|
|
65511
|
-
* in development.
|
|
66569
|
+
* in development. At the top of the page, in Safari, its color carries on above
|
|
66570
|
+
* the page when the page is pulled down, and the ribbon of an
|
|
66571
|
+
* nldd-top-navigation-bar below it then starts under the bar, as it does at
|
|
66572
|
+
* rest.
|
|
65512
66573
|
*
|
|
65513
66574
|
* ## ARIA
|
|
65514
66575
|
* role and aria-live are set automatically from the variant:
|
|
@@ -65537,13 +66598,34 @@ var _NLDDStatusBar = class NLDDStatusBar extends LitElement {
|
|
|
65537
66598
|
this.target = "";
|
|
65538
66599
|
this.rel = "";
|
|
65539
66600
|
this.button = false;
|
|
66601
|
+
this._syncAtTop = () => {
|
|
66602
|
+
if (window.scrollY > 0) return;
|
|
66603
|
+
const { top, height } = this.getBoundingClientRect();
|
|
66604
|
+
this.toggleAttribute("data-at-top", height > 0 && Math.abs(top) < 1);
|
|
66605
|
+
};
|
|
65540
66606
|
}
|
|
65541
66607
|
connectedCallback() {
|
|
65542
66608
|
super.connectedCallback();
|
|
65543
66609
|
this._applyAriaForVariant(this.variant);
|
|
66610
|
+
window.addEventListener("resize", this._syncAtTop, { passive: true });
|
|
66611
|
+
if (this.hasUpdated) {
|
|
66612
|
+
this._syncAtTop();
|
|
66613
|
+
this._announce();
|
|
66614
|
+
}
|
|
66615
|
+
}
|
|
66616
|
+
disconnectedCallback() {
|
|
66617
|
+
super.disconnectedCallback();
|
|
66618
|
+
window.removeEventListener("resize", this._syncAtTop);
|
|
66619
|
+
this._announce();
|
|
65544
66620
|
}
|
|
65545
66621
|
firstUpdated() {
|
|
65546
66622
|
this._checkPlacement();
|
|
66623
|
+
this._syncAtTop();
|
|
66624
|
+
this._announce();
|
|
66625
|
+
}
|
|
66626
|
+
/** Tells a top navigation bar that a status bar came or went, so it measures where its ribbon starts again. */
|
|
66627
|
+
_announce() {
|
|
66628
|
+
window.dispatchEvent(new Event(STATUS_BAR_CHANGE));
|
|
65547
66629
|
}
|
|
65548
66630
|
/** Whether a top bar comes before the status bar. Top bars in an overlay are left out, since a sheet or dialog has its own. */
|
|
65549
66631
|
_checkPlacement() {
|
|
@@ -66435,4 +67517,4 @@ __decorate([property({
|
|
|
66435
67517
|
attribute: "no-arrow"
|
|
66436
67518
|
})], NLDDJustInTimeEducation.prototype, "noArrow", void 0);
|
|
66437
67519
|
NLDDJustInTimeEducation = _NLDDJustInTimeEducation = __decorate([customElement("nldd-just-in-time-education")], NLDDJustInTimeEducation);
|
|
66438
|
-
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,
|
|
67520
|
+
export { NLDDActivityIndicator, NLDDAvatar, NLDDAvatarGroup, NLDDBadge, NLDDBanner, NLDDBarSplitView, NLDDBlockquote, NLDDBox, NLDDBreadcrumbs, NLDDBreadcrumbsItem, NLDDButton, NLDDButtonBar, NLDDButtonGroup, NLDDCard, NLDDCell, NLDDCheckbox, NLDDCheckboxField, NLDDCodeEditor, NLDDCodeViewer, NLDDCollection, NLDDColumnBoard, NLDDColumnBoardColumn, 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, NLDDOneTimeCodeField, 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, NLDDText, NLDDTextCell, NLDDTextEditor, NLDDTextField, NLDDTimeField, NLDDTimePicker, NLDDTitle, NLDDTitleCell, NLDDToggleButton, NLDDToggleButtonGroup, NLDDToken, NLDDTokenField, NLDDToolbar, NLDDTooltip, NLDDTopNavigationBar, NLDDTopTitleBar, NLDDTwoThirdsOneThirdSection, NLDDValidationList, NLDDVisuallyHidden, NLDDWindow, setTranslations };
|