@nldd/design-system 0.8.99 → 0.8.100
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 +161 -26
- package/dist/components/actions/button/button.d.ts +2 -2
- package/dist/components/actions/button/button.js +2 -2
- package/dist/components/actions/icon-button/icon-button.d.ts +2 -2
- package/dist/components/actions/icon-button/icon-button.js +2 -2
- package/dist/components/actions/menu/menu.d.ts +9 -0
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +18 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +1 -1
- package/dist/components/actions/split-button/split-button.js +1 -1
- package/dist/components/components.js +673 -190
- package/dist/components/content/text/text.d.ts +1 -1
- package/dist/components/content/text/text.js +1 -1
- package/dist/components/content/text/text.styles.d.ts.map +1 -1
- package/dist/components/content/text/text.styles.js +55 -0
- package/dist/components/content/text/text.styles.js.map +1 -1
- package/dist/components/content/title/title.d.ts +16 -1
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +109 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +39 -0
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/token/token.d.ts +1 -1
- package/dist/components/content/token/token.js +1 -1
- package/dist/components/{icon-button-CJIikwyu.js → icon-button-BtU8DX64.js} +2 -2
- package/dist/components/inputs/dropdown/dropdown.d.ts +6 -0
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +6 -0
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +16 -5
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +44 -10
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.styles.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.styles.js +7 -6
- package/dist/components/layout/collection/collection.styles.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +1 -1
- package/dist/components/layout/container/container.js +1 -1
- package/dist/components/layout/container/container.styles.d.ts.map +1 -1
- package/dist/components/layout/container/container.styles.js +4 -0
- package/dist/components/layout/container/container.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts +20 -0
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.js +103 -0
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts +2 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +132 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts +9 -5
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +15 -6
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +1 -1
- package/dist/components/layout/window/window.js +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +8 -5
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +19 -10
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +4 -0
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.js +5 -1
- package/dist/components/lists-and-tables/table/table.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +1 -1
- package/dist/components/navigation/link/link.js +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +4 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +11 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +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 +6 -3
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +11 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +21 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +1 -1
- package/dist/css/rich-text.css +1 -1
- package/dist/css/variables.css +1 -0
- package/dist/nldd.min.js +783 -550
- package/dist/types/vue.d.ts +43 -23
- package/package.json +2 -2
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* @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.
|
|
31
31
|
* @attr {string} horizontal-alignment - Alignment of the text within the block: 'left' | 'center' | 'right' (default: 'left'). Aligns the words; `horizontal-alignment` on nldd-container moves the box.
|
|
32
32
|
*
|
|
33
|
-
* @slot - The text. Inline elements
|
|
33
|
+
* @slot - The text. Inline elements look as they do in nldd-rich-text: `<strong>` and `<b>` take the bold weight from the scale, `<em>` and `<i>` are italic, `<a>` is an underlined link, `<code>` sits on a tinted surface in the monospace font, and `<mark>` is highlighted. This holds for elements directly in the text; one inside another (a link inside `<strong>`) keeps only the outer one's styling. Components such as `nldd-tag` are left alone.
|
|
34
34
|
*/
|
|
35
35
|
import { LitElement } from 'lit';
|
|
36
36
|
type Size = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* @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.
|
|
31
31
|
* @attr {string} horizontal-alignment - Alignment of the text within the block: 'left' | 'center' | 'right' (default: 'left'). Aligns the words; `horizontal-alignment` on nldd-container moves the box.
|
|
32
32
|
*
|
|
33
|
-
* @slot - The text. Inline elements
|
|
33
|
+
* @slot - The text. Inline elements look as they do in nldd-rich-text: `<strong>` and `<b>` take the bold weight from the scale, `<em>` and `<i>` are italic, `<a>` is an underlined link, `<code>` sits on a tinted surface in the monospace font, and `<mark>` is highlighted. This holds for elements directly in the text; one inside another (a link inside `<strong>`) keeps only the outer one's styling. Components such as `nldd-tag` are left alone.
|
|
34
34
|
*/
|
|
35
35
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
36
36
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/text/text.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"text.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/text/text.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,yBA2KtB,CAAC"}
|
|
@@ -11,6 +11,19 @@ export const textStyles = css `
|
|
|
11
11
|
--_text-max-width: var(--semantics-text-max-width);
|
|
12
12
|
--_text-color: var(--context-content-color, var(--semantics-content-color));
|
|
13
13
|
--_text-align: left;
|
|
14
|
+
--_text-link-color: var(--semantics-links-color);
|
|
15
|
+
--_text-link-is-hovered-color: var(--semantics-links-is-hovered-color);
|
|
16
|
+
--_text-link-is-active-color: var(--semantics-links-is-active-color);
|
|
17
|
+
--_text-link-underline-offset: var(--primitives-space-2);
|
|
18
|
+
--_text-code-padding: var(--primitives-space-4);
|
|
19
|
+
--_text-code-corner-radius: var(--semantics-controls-xs-corner-radius);
|
|
20
|
+
--_text-code-background-color: var(--semantics-surfaces-tinted-background-color);
|
|
21
|
+
--_text-code-font-family: var(--primitives-font-family-monospace);
|
|
22
|
+
--_text-code-font-size: var(--semantics-code-inline-font-size);
|
|
23
|
+
--_text-mark-padding: var(--primitives-space-1) var(--primitives-space-2);
|
|
24
|
+
--_text-mark-corner-radius: var(--semantics-controls-xs-corner-radius);
|
|
25
|
+
--_text-mark-background-color: var(--semantics-content-mark-background-color);
|
|
26
|
+
--_text-mark-color: var(--semantics-content-mark-color);
|
|
14
27
|
|
|
15
28
|
display: block;
|
|
16
29
|
max-width: var(--_text-max-width);
|
|
@@ -64,6 +77,48 @@ export const textStyles = css `
|
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
|
|
80
|
+
/* # Inline elements */
|
|
81
|
+
|
|
82
|
+
::slotted(em),
|
|
83
|
+
::slotted(i) {
|
|
84
|
+
color: inherit;
|
|
85
|
+
font-style: italic;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
::slotted(a) {
|
|
89
|
+
color: var(--_text-link-color);
|
|
90
|
+
text-decoration: underline;
|
|
91
|
+
text-underline-offset: var(--_text-link-underline-offset);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
::slotted(a:hover) {
|
|
95
|
+
color: var(--_text-link-is-hovered-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
::slotted(a:active) {
|
|
99
|
+
color: var(--_text-link-is-active-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([color="inherit"]) ::slotted(a) {
|
|
103
|
+
color: currentColor;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
::slotted(code) {
|
|
107
|
+
border-radius: var(--_text-code-corner-radius);
|
|
108
|
+
background-color: var(--_text-code-background-color);
|
|
109
|
+
padding: var(--_text-code-padding);
|
|
110
|
+
font-family: var(--_text-code-font-family);
|
|
111
|
+
font-size: var(--_text-code-font-size);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
::slotted(mark) {
|
|
115
|
+
border-radius: var(--_text-mark-corner-radius);
|
|
116
|
+
background-color: var(--_text-mark-background-color);
|
|
117
|
+
padding: var(--_text-mark-padding);
|
|
118
|
+
color: var(--_text-mark-color);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
67
122
|
/* # Line height */
|
|
68
123
|
|
|
69
124
|
:host([line-height="flat"]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.styles.js","sourceRoot":"","sources":["../../../../src/components/content/text/text.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"text.styles.js","sourceRoot":"","sources":["../../../../src/components/content/text/text.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2K5B,CAAC"}
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* @element nldd-title
|
|
14
14
|
*
|
|
15
15
|
* @attr {number} size - Visual size of the title: 1–6 (default: 3)
|
|
16
|
+
* @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 size 1. A var() works when the variable holds a length; one that is not defined leaves the title without its size, the floor included. For headings use `size`; if a design does not fit the scale, raise it as an issue. Set per breakpoint on purpose: a breakpoint without one keeps the size from `size`, so a title made large for a wide screen never breaks a narrow one. Never smaller than size 1 at the same breakpoint: a smaller value shows as size 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 size 1. An invalid value falls back to `size`
|
|
17
|
+
* @attr {string} md-custom-size - The same, at md
|
|
18
|
+
* @attr {string} lg-custom-size - The same, at lg
|
|
16
19
|
* @attr {string} color - 'content' (the default) takes the system's own content
|
|
17
20
|
* colors. 'inherit' lets the title follow the text color of the surface
|
|
18
21
|
* instead (for colored areas such as the filled categories); overline and
|
|
@@ -27,13 +30,16 @@
|
|
|
27
30
|
* @slot supporting-text - Supporting text that is more than text. Takes the place of the supporting-text attribute.
|
|
28
31
|
* @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.
|
|
29
32
|
*/
|
|
30
|
-
import { LitElement } from 'lit';
|
|
33
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
31
34
|
type Size = 1 | 2 | 3 | 4 | 5 | 6;
|
|
32
35
|
type TitleColor = 'content' | 'inherit';
|
|
33
36
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
34
37
|
export declare class NLDDTitle extends LitElement {
|
|
35
38
|
static styles: import("lit").CSSResult;
|
|
36
39
|
size: Size;
|
|
40
|
+
smCustomSize: string;
|
|
41
|
+
mdCustomSize: string;
|
|
42
|
+
lgCustomSize: string;
|
|
37
43
|
color: TitleColor;
|
|
38
44
|
text: string;
|
|
39
45
|
supportingText: string;
|
|
@@ -48,6 +54,15 @@ export declare class NLDDTitle extends LitElement {
|
|
|
48
54
|
/** @internal */
|
|
49
55
|
_onSlotChange: (e: Event) => void;
|
|
50
56
|
firstUpdated(): void;
|
|
57
|
+
/** The valid custom size per breakpoint, worked out before the first paint. */
|
|
58
|
+
private _customSizes;
|
|
59
|
+
willUpdate(changed: PropertyValues): void;
|
|
60
|
+
updated(changed: PropertyValues): void;
|
|
61
|
+
/** DEV-only: warnings already given, so each says it once per title. */
|
|
62
|
+
private _warned;
|
|
63
|
+
private _warnOnce;
|
|
64
|
+
/** DEV-only: says so when a custom size is smaller than size 1, which then shows instead. */
|
|
65
|
+
private _checkFloor;
|
|
51
66
|
render(): import("lit-html").TemplateResult;
|
|
52
67
|
}
|
|
53
68
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../src/components/content/title/title.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../src/components/content/title/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAMtD,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClC,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AACxC,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AA6B1C,qBACa,SAAU,SAAQ,UAAU;IACxC,OAAgB,MAAM,0BAAe;IAGrC,IAAI,EAAE,IAAI,CAAK;IAGf,YAAY,SAAM;IAGlB,YAAY,SAAM;IAGlB,YAAY,SAAM;IAGlB,KAAK,EAAE,UAAU,CAAa;IAG9B,IAAI,SAAM;IAGV,cAAc,SAAM;IAGpB,QAAQ,SAAM;IAGd,YAAY,EAAE,YAAY,GAAG,IAAI,CAAQ;IAEzC,gBAAgB;IACP,mBAAmB,UAAS;IACrC,gBAAgB;IACP,kBAAkB,UAAS;IACpC,gBAAgB;IACP,yBAAyB,UAAS;IAE3C,gBAAgB;IAChB,aAAa,GAAI,GAAG,KAAK,KAAG,IAAI,CAS9B;IAEO,YAAY,IAAI,IAAI;IAS7B,+EAA+E;IAC/E,OAAO,CAAC,YAAY,CAA2C;IAEtD,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA+BzC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAQ/C,wEAAwE;IACxE,OAAO,CAAC,OAAO,CAAqB;IAEpC,OAAO,CAAC,SAAS;IAMjB,6FAA6F;IAC7F,OAAO,CAAC,WAAW;IAyBV,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,YAAY,EAAE,SAAS,CAAC;KACxB;CACD"}
|
|
@@ -19,6 +19,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
19
19
|
* @element nldd-title
|
|
20
20
|
*
|
|
21
21
|
* @attr {number} size - Visual size of the title: 1–6 (default: 3)
|
|
22
|
+
* @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 size 1. A var() works when the variable holds a length; one that is not defined leaves the title without its size, the floor included. For headings use `size`; if a design does not fit the scale, raise it as an issue. Set per breakpoint on purpose: a breakpoint without one keeps the size from `size`, so a title made large for a wide screen never breaks a narrow one. Never smaller than size 1 at the same breakpoint: a smaller value shows as size 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 size 1. An invalid value falls back to `size`
|
|
23
|
+
* @attr {string} md-custom-size - The same, at md
|
|
24
|
+
* @attr {string} lg-custom-size - The same, at lg
|
|
22
25
|
* @attr {string} color - 'content' (the default) takes the system's own content
|
|
23
26
|
* colors. 'inherit' lets the title follow the text color of the surface
|
|
24
27
|
* instead (for colored areas such as the filled categories); overline and
|
|
@@ -40,10 +43,31 @@ import { titleStyles } from './title.styles.js';
|
|
|
40
43
|
import { titleTemplate } from './title.template.js';
|
|
41
44
|
/** One warning per page: a missed rename is one search-and-replace, not one per title. */
|
|
42
45
|
let warnedAboutSubtitle = false;
|
|
46
|
+
const BREAKPOINTS = ['sm', 'md', 'lg'];
|
|
47
|
+
/** The font size of size 1 per breakpoint: the floor of a custom size. */
|
|
48
|
+
const SIZE_1_FONT_SIZE = {
|
|
49
|
+
sm: 'var(--primitives-font-size-700)',
|
|
50
|
+
md: 'var(--primitives-font-size-800)',
|
|
51
|
+
lg: 'var(--primitives-font-size-1000)',
|
|
52
|
+
};
|
|
53
|
+
/** Font-size values that are not a length: the CSS-wide keywords and the
|
|
54
|
+
* absolute and relative size keywords. */
|
|
55
|
+
const NOT_A_LENGTH = new Set([
|
|
56
|
+
'inherit', 'initial', 'unset', 'revert', 'revert-layer',
|
|
57
|
+
'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', 'xxx-large',
|
|
58
|
+
'larger', 'smaller', 'math',
|
|
59
|
+
]);
|
|
60
|
+
/** A length font-size takes. A keyword cannot go inside the max() that keeps the floor, so it would void the whole font. */
|
|
61
|
+
function isFontSize(value) {
|
|
62
|
+
return !NOT_A_LENGTH.has(value.toLowerCase()) && CSS.supports('font-size', value);
|
|
63
|
+
}
|
|
43
64
|
let NLDDTitle = class NLDDTitle extends LitElement {
|
|
44
65
|
constructor() {
|
|
45
66
|
super(...arguments);
|
|
46
67
|
this.size = 3;
|
|
68
|
+
this.smCustomSize = '';
|
|
69
|
+
this.mdCustomSize = '';
|
|
70
|
+
this.lgCustomSize = '';
|
|
47
71
|
this.color = 'content';
|
|
48
72
|
this.text = '';
|
|
49
73
|
this.supportingText = '';
|
|
@@ -68,6 +92,10 @@ let NLDDTitle = class NLDDTitle extends LitElement {
|
|
|
68
92
|
else
|
|
69
93
|
this._hasDefaultSlotted = hasContent;
|
|
70
94
|
};
|
|
95
|
+
/** The valid custom size per breakpoint, worked out before the first paint. */
|
|
96
|
+
this._customSizes = {};
|
|
97
|
+
/** DEV-only: warnings already given, so each says it once per title. */
|
|
98
|
+
this._warned = new Set();
|
|
71
99
|
}
|
|
72
100
|
firstUpdated() {
|
|
73
101
|
// The subtitle slot was renamed to supporting-text. Content in a slot that
|
|
@@ -77,6 +105,78 @@ let NLDDTitle = class NLDDTitle extends LitElement {
|
|
|
77
105
|
console.warn('NLDDTitle: the subtitle slot is now supporting-text. Rename slot="subtitle" to slot="supporting-text", or use the supporting-text attribute, here and on every other nldd-title.');
|
|
78
106
|
}
|
|
79
107
|
}
|
|
108
|
+
willUpdate(changed) {
|
|
109
|
+
super.willUpdate(changed);
|
|
110
|
+
if (!changed.has('smCustomSize') &&
|
|
111
|
+
!changed.has('mdCustomSize') &&
|
|
112
|
+
!changed.has('lgCustomSize'))
|
|
113
|
+
return;
|
|
114
|
+
// Nothing to measure or write when rendered without a DOM, as on a server.
|
|
115
|
+
if (typeof CSS === 'undefined')
|
|
116
|
+
return;
|
|
117
|
+
// Written here rather than in updated(), so the first paint already has
|
|
118
|
+
// the custom size. A breakpoint left without a valid value keeps the
|
|
119
|
+
// size from the scale.
|
|
120
|
+
const own = { sm: this.smCustomSize, md: this.mdCustomSize, lg: this.lgCustomSize };
|
|
121
|
+
this._customSizes = {};
|
|
122
|
+
for (const breakpoint of BREAKPOINTS) {
|
|
123
|
+
const value = (own[breakpoint] || '').trim();
|
|
124
|
+
const valid = value !== '' && isFontSize(value);
|
|
125
|
+
if (valid) {
|
|
126
|
+
this._customSizes[breakpoint] = value;
|
|
127
|
+
this.style.setProperty(`--_title-${breakpoint}-custom-size`, value);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.style.removeProperty(`--_title-${breakpoint}-custom-size`);
|
|
131
|
+
}
|
|
132
|
+
this.toggleAttribute(`data-${breakpoint}-custom-size`, valid);
|
|
133
|
+
if (import.meta.env?.DEV && value !== '' && !valid) {
|
|
134
|
+
this._warnOnce(`invalid-${breakpoint}-${value}`, `<nldd-title>: ${breakpoint}-custom-size="${value}" is not a size the title can use, so it keeps its size from the scale at ${breakpoint}. Use a length such as "96px" or "6rem", not a keyword.`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
updated(changed) {
|
|
139
|
+
super.updated(changed);
|
|
140
|
+
if (!import.meta.env?.DEV)
|
|
141
|
+
return;
|
|
142
|
+
if (changed.has('smCustomSize') || changed.has('mdCustomSize') || changed.has('lgCustomSize')) {
|
|
143
|
+
this._checkFloor(this._customSizes);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
_warnOnce(key, message) {
|
|
147
|
+
if (this._warned.has(key))
|
|
148
|
+
return;
|
|
149
|
+
this._warned.add(key);
|
|
150
|
+
console.warn(message, this);
|
|
151
|
+
}
|
|
152
|
+
/** DEV-only: says so when a custom size is smaller than size 1, which then shows instead. */
|
|
153
|
+
_checkFloor(sizes) {
|
|
154
|
+
if (!this.shadowRoot || Object.keys(sizes).length === 0)
|
|
155
|
+
return;
|
|
156
|
+
const probe = document.createElement('span');
|
|
157
|
+
probe.style.position = 'absolute';
|
|
158
|
+
probe.style.visibility = 'hidden';
|
|
159
|
+
this.shadowRoot.append(probe);
|
|
160
|
+
const px = (value) => {
|
|
161
|
+
probe.style.fontSize = value;
|
|
162
|
+
return parseFloat(getComputedStyle(probe).fontSize);
|
|
163
|
+
};
|
|
164
|
+
try {
|
|
165
|
+
for (const [breakpoint, value] of Object.entries(sizes)) {
|
|
166
|
+
// A value relative to the viewport, a container or the surrounding
|
|
167
|
+
// text resolves to something else elsewhere, so it is left to the
|
|
168
|
+
// CSS floor rather than measured here.
|
|
169
|
+
if (/%|\d(?:v[whib]|vmin|vmax|cq[whib]|cqmin|cqmax|em|ex|ch|cap|ic|lh)\b/.test(value))
|
|
170
|
+
continue;
|
|
171
|
+
if (px(value) < px(SIZE_1_FONT_SIZE[breakpoint]) - 0.5) {
|
|
172
|
+
this._warnOnce(`floor-${breakpoint}-${value}`, `<nldd-title>: custom size "${value}" is smaller than size 1 at ${breakpoint} and shows as size 1. Use size for headings up to size 1.`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
probe.remove();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
80
180
|
render() {
|
|
81
181
|
return titleTemplate(this);
|
|
82
182
|
}
|
|
@@ -85,6 +185,15 @@ NLDDTitle.styles = titleStyles;
|
|
|
85
185
|
__decorate([
|
|
86
186
|
property({ type: Number, reflect: true })
|
|
87
187
|
], NLDDTitle.prototype, "size", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ reflect: true, attribute: 'sm-custom-size', converter: reflectNonDefault('') })
|
|
190
|
+
], NLDDTitle.prototype, "smCustomSize", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ reflect: true, attribute: 'md-custom-size', converter: reflectNonDefault('') })
|
|
193
|
+
], NLDDTitle.prototype, "mdCustomSize", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ reflect: true, attribute: 'lg-custom-size', converter: reflectNonDefault('') })
|
|
196
|
+
], NLDDTitle.prototype, "lgCustomSize", void 0);
|
|
88
197
|
__decorate([
|
|
89
198
|
property({ reflect: true, converter: reflectNonDefault('content') })
|
|
90
199
|
], NLDDTitle.prototype, "color", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../src/components/content/title/title.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../src/components/content/title/title.ts"],"names":[],"mappings":";;;;;;A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E,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;+CACjF;AAGlB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;+CACjF;AAGlB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAa,SAAS,CAAC,EAAE,CAAC;wCACnD;AAG9B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;uCAC5D;AAGV;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;iDAChF;AAGpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;2CACxD;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CAC7B;AAGhC;IAAR,KAAK,EAAE;sDAA6B;AAE5B;IAAR,KAAK,EAAE;qDAA4B;AAE3B;IAAR,KAAK,EAAE;4DAAmC;AAnC/B,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA0IrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/title/title.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"title.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/content/title/title.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,yBAmUvB,CAAC"}
|
|
@@ -14,6 +14,13 @@ export const titleStyles = css `
|
|
|
14
14
|
/* # Host */
|
|
15
15
|
|
|
16
16
|
:host {
|
|
17
|
+
--_title-sm-custom-size: initial;
|
|
18
|
+
--_title-md-custom-size: initial;
|
|
19
|
+
--_title-lg-custom-size: initial;
|
|
20
|
+
--_title-sm-custom-font: var(--primitives-font-weight-display-bold) max(var(--_title-sm-custom-size), var(--primitives-font-size-700)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
21
|
+
--_title-md-custom-font: var(--primitives-font-weight-display-bold) max(var(--_title-md-custom-size), var(--primitives-font-size-800)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
22
|
+
--_title-lg-custom-font: var(--primitives-font-weight-display-bold) max(var(--_title-lg-custom-size), var(--primitives-font-size-1000)) / var(--primitives-line-height-flat) var(--primitives-font-family-display);
|
|
23
|
+
|
|
17
24
|
@media (max-width: ${smMax}) {
|
|
18
25
|
--_title-font: var(--primitives-font-display-3-sm);
|
|
19
26
|
}
|
|
@@ -172,6 +179,38 @@ export const titleStyles = css `
|
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
181
|
|
|
182
|
+
/* ## Custom size */
|
|
183
|
+
|
|
184
|
+
:host([data-sm-custom-size]) {
|
|
185
|
+
@media (max-width: ${smMax}) {
|
|
186
|
+
--_title-font: var(--_title-sm-custom-font);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@container layout-container (max-width: ${smMax}) {
|
|
190
|
+
--_title-font: var(--_title-sm-custom-font);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
:host([data-md-custom-size]) {
|
|
195
|
+
@media (min-width: ${mdMin}) and (max-width: ${mdMax}) {
|
|
196
|
+
--_title-font: var(--_title-md-custom-font);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@container layout-container (min-width: ${mdMin}) and (max-width: ${mdMax}) {
|
|
200
|
+
--_title-font: var(--_title-md-custom-font);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([data-lg-custom-size]) {
|
|
205
|
+
@media (min-width: ${lgMin}) {
|
|
206
|
+
--_title-font: var(--_title-lg-custom-font);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@container layout-container (min-width: ${lgMin}) {
|
|
210
|
+
--_title-font: var(--_title-lg-custom-font);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
175
214
|
:host([hidden]) {
|
|
176
215
|
display: none;
|
|
177
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.styles.js","sourceRoot":"","sources":["../../../../src/components/content/title/title.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"title.styles.js","sourceRoot":"","sources":["../../../../src/components/content/title/title.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE3F,MAAM,KAAK,GAAG,SAAS,CAAC,WA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,KAAK;;;;;;uBAMpD,KAAK;;;;4CAIgB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwC7C,YAAY;IACZ,kBAAkB;;;;;;;;;;;;;;;;;;;IAmBlB,YAAY;IACZ,kBAAkB;;;;;;;;;;;;;;;;;IAiBlB,YAAY;IACZ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CrB,CAAC"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
18
18
|
* @attr {boolean} roving - Inside a roving-focus container (e.g. nldd-token-field): the host is the single tab stop, so the trailing control is not separately tabbable.
|
|
19
19
|
* @attr {boolean} expanded - Reflects whether the token's menu is open (control="menu"); managed by the token.
|
|
20
|
-
* @attr {boolean} disabled - Disabled state
|
|
20
|
+
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
21
21
|
*
|
|
22
22
|
* @slot - Token text
|
|
23
23
|
* @slot menu - An nldd-menu that the token opens from its menu button (control="menu").
|
|
@@ -23,7 +23,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
23
|
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
24
24
|
* @attr {boolean} roving - Inside a roving-focus container (e.g. nldd-token-field): the host is the single tab stop, so the trailing control is not separately tabbable.
|
|
25
25
|
* @attr {boolean} expanded - Reflects whether the token's menu is open (control="menu"); managed by the token.
|
|
26
|
-
* @attr {boolean} disabled - Disabled state
|
|
26
|
+
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
27
27
|
*
|
|
28
28
|
* @slot - Token text
|
|
29
29
|
* @slot menu - An nldd-menu that the token opens from its menu button (control="menu").
|
|
@@ -1482,9 +1482,9 @@ var nlddIconButtonTranslations = { "components.icon-button.opens-in-new-tab-labe
|
|
|
1482
1482
|
* @attr {string} size - Button size: 'xs' | 'sm' | 'md' | 'lg' (default: 'md')
|
|
1483
1483
|
* @attr {boolean} hide-lg-text - In lg size, hides the text label and enlarges the icon by one step (28px)
|
|
1484
1484
|
* @attr {boolean} no-highlight-border - Removes the per-appearance highlight border (e.g. when a control group draws a single border instead).
|
|
1485
|
-
* @attr {boolean} loading - Loading state (default: false). Shows an activity indicator over the visually hidden icon, sets aria-busy on the inner control and blocks activation, without dropping the button from the tab order (unlike disabled).
|
|
1485
|
+
* @attr {boolean} loading - Loading state (default: false). Shows an activity indicator over the visually hidden icon, sets aria-busy on the inner control and blocks activation, without dropping the button from the tab order (unlike disabled). Meant for an action that has to wait for the server, such as sending an application. For most actions, show the result right away and confirm in the background, as the design guidelines describe.
|
|
1486
1486
|
* @attr {string} loading-text - What the screen reader announces while `loading` is on, for a button that does more than load: "Aan het bewaren". Leave it out and the activity indicator says its translated "Laden".
|
|
1487
|
-
* @attr {boolean} disabled - Disabled state
|
|
1487
|
+
* @attr {boolean} disabled - Disabled state. Avoid it: let the action run and say afterwards what is missing; the design guidelines say why.
|
|
1488
1488
|
* @attr {boolean} no-tab - Takes the button out of the tab order (tabindex="-1"), for a control owned by a roving container (an nldd-token in nldd-token-field, a button in a row of an nldd-list) that manages focus itself. Still mouse- and script-focusable.
|
|
1489
1489
|
* @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
|
|
1490
1490
|
* @attr {boolean} expandable - Whether the button opens a menu or popover and shows chevron next to the icon
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
* and keyboard navigation, including `<optgroup>`, `data-*` attributes and
|
|
8
8
|
* dynamic changes to options.
|
|
9
9
|
*
|
|
10
|
+
* A dropdown hides its options, so it is the last resort for a choice from a
|
|
11
|
+
* fixed set. Show a handful of options with nldd-segmented-control,
|
|
12
|
+
* nldd-toggle-button-group or nldd-radio-button-group, and let the user type
|
|
13
|
+
* in nldd-combo-box when there are many, a list of countries included. The
|
|
14
|
+
* design guidelines explain the order.
|
|
15
|
+
*
|
|
10
16
|
* @element nldd-dropdown
|
|
11
17
|
* @attr {string} size - Size: 'xs' | 'sm' | 'md' (default: 'md')
|
|
12
18
|
* @attr {boolean} valid - Marks the field as valid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,OAAO,8BAA8B,CAAC;AAItC,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;;AAE9C,qBACa,YAAa,SAAQ,iBAAuB;IACxD,OAAgB,MAAM,0BAAkB;IAExC;wEACoE;IACpE,MAAM,CAAC,WAAW,UAAQ;IAG1B,IAAI,EAAE,YAAY,CAAQ;IAG1B,KAAK,UAAS;IAGd,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAGjB,QAAQ,UAAS;IAEjB,oGAAoG;IAEpG,KAAK,SAAM;IAEX;;;;OAIG;IAEH,eAAe,SAAM;IAErB,OAAO,CAAC,OAAO,CAAkC;IAIjD,QAAQ,UAAS;IAEjB,kFAAkF;IAClF,OAAO,CAAC,aAAa,CAAuB;IAE5C,gDAAgD;IAChD,OAAO,CAAC,gBAAgB,CAAuB;IAItC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAyBxD,aAAa,IAAI,IAAI;IAqC5B,OAAO,CAAC,aAAa;IAKrB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAK5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,mBAAmB,CAOzB;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,iBAAiB,CAGvB;IAEF,+EAA+E;IAC/E,OAAO,CAAC,oBAAoB,CAE1B;IAEF;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAEzB;IAEF;;;;OAIG;IACM,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAI5C,oEAAoE;IAC3D,eAAe,IAAI,OAAO,GAAG,IAAI;IAIjC,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,YAAY,CAAC;KAC9B;CACD"}
|
|
@@ -13,6 +13,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
* and keyboard navigation, including `<optgroup>`, `data-*` attributes and
|
|
14
14
|
* dynamic changes to options.
|
|
15
15
|
*
|
|
16
|
+
* A dropdown hides its options, so it is the last resort for a choice from a
|
|
17
|
+
* fixed set. Show a handful of options with nldd-segmented-control,
|
|
18
|
+
* nldd-toggle-button-group or nldd-radio-button-group, and let the user type
|
|
19
|
+
* in nldd-combo-box when there are many, a list of countries included. The
|
|
20
|
+
* design guidelines explain the order.
|
|
21
|
+
*
|
|
16
22
|
* @element nldd-dropdown
|
|
17
23
|
* @attr {string} size - Size: 'xs' | 'sm' | 'md' (default: 'md')
|
|
18
24
|
* @attr {boolean} valid - Marks the field as valid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../src/components/inputs/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../src/components/inputs/dropdown/dropdown.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAIjB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC;2CACnD;AAQX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;qDACrC;AAMrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC1B;AAtCL,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA0NxB"}
|
|
@@ -5,19 +5,23 @@
|
|
|
5
5
|
* Supports grid, stack, lanes and horizontal scroll layouts.
|
|
6
6
|
*
|
|
7
7
|
* Use it for a set of equal blocks, usually `nldd-card`s, instead of a CSS
|
|
8
|
-
* grid of your own: the collection sets the columns from `item-width` and
|
|
9
|
-
* available width, and the gap per breakpoint.
|
|
8
|
+
* grid of your own: the collection sets the columns from `item-min-width` and
|
|
9
|
+
* the available width, and the gap per breakpoint.
|
|
10
10
|
*
|
|
11
11
|
* In grid and stack modes, items are paginated via a load-more button. In
|
|
12
12
|
* horizontal scroll, the prev/next controls and the edge fade appear only when
|
|
13
|
-
* the items overflow the container.
|
|
13
|
+
* the items overflow the container. Use horizontal scroll for items that
|
|
14
|
+
* together serve one purpose, such as the events of one agenda; it is not a
|
|
15
|
+
* carousel for unrelated highlights, which the design guidelines advise
|
|
16
|
+
* against.
|
|
14
17
|
* With `lazy-load`, the next items are automatically loaded when
|
|
15
18
|
* the load-more button comes into view.
|
|
16
19
|
*
|
|
17
20
|
* @element nldd-collection
|
|
18
21
|
*
|
|
19
22
|
* @attr {string} layout - Layout mode: 'grid' | 'stack' | 'lanes' | 'horizontal-scroll' (default: 'grid')
|
|
20
|
-
* @attr {string} item-width -
|
|
23
|
+
* @attr {string} item-min-width - Smallest width an item takes (e.g. '280px', '20rem'). In grid and lanes the minimum column width: columns are at least this wide and grow to fill the row. In horizontal scroll the flex-basis: items never shrink below it, and grow up to `item-max-width` when they fit. No effect in stack. Never forces horizontal overflow, the value is clamped to the container width.
|
|
24
|
+
* @attr {string} item-max-width - Largest width an item takes in horizontal scroll (e.g. '400px', '25rem'), so one or two items that fit do not stretch across the container. Defaults to 480px; `item-max-width="100%"` lets items fill the container, as they did before the default. Never narrower than `item-min-width`, which wins when it is wider, and never wider than the container. No effect in grid, lanes and stack: a grid leaves empty columns rather than stretching an item, and its right edge stays aligned with the content around it.
|
|
21
25
|
* @attr {string} gap - Gap between items, as a step of the spacing scale ('0', '2', '4', '6', '8', '10', '12', '16', '20', '24', '28', '32', '40', '44', '48', '56', '64', '80', '96'). Overrides the responsive default at every breakpoint; unset keeps the default.
|
|
22
26
|
* @attr {string} sm-gap - Gap at sm, overriding `gap` there
|
|
23
27
|
* @attr {string} md-gap - Gap at md, overriding `gap` there
|
|
@@ -27,6 +31,10 @@
|
|
|
27
31
|
* @attr {boolean} show-load-more - Show load-more button in grid/stack (default: false)
|
|
28
32
|
* @attr {boolean} lazy-load - Automatically load more items when the button becomes visible
|
|
29
33
|
*
|
|
34
|
+
* @migration Items in horizontal scroll stop at 480px (or at `item-min-width` when that is wider) instead of filling the container.
|
|
35
|
+
* Set `item-max-width="100%"` where one or two items should still fill the row.
|
|
36
|
+
* @migration The `item-width` attribute has been renamed to `item-min-width`, because it was a minimum in every layout.
|
|
37
|
+
* Replace `item-width="320px"` with `item-min-width="320px"`.
|
|
30
38
|
* @migration The `load-more-label` attribute has been removed.
|
|
31
39
|
* Use `translations` property instead: `.translations=${{ 'components.collection.load-more-action': 'Show more' }}`
|
|
32
40
|
*
|
|
@@ -46,7 +54,8 @@ type Layout = 'grid' | 'stack' | 'lanes' | 'horizontal-scroll';
|
|
|
46
54
|
export declare class NLDDCollection extends LitElement {
|
|
47
55
|
static styles: import("lit").CSSResult;
|
|
48
56
|
layout: Layout;
|
|
49
|
-
|
|
57
|
+
itemMinWidth: string | undefined;
|
|
58
|
+
itemMaxWidth: string | undefined;
|
|
50
59
|
/** A step of the spacing scale, overriding the responsive default at every
|
|
51
60
|
* breakpoint. Unset keeps the default. */
|
|
52
61
|
gap: SpacingSize | undefined;
|
|
@@ -73,6 +82,8 @@ export declare class NLDDCollection extends LitElement {
|
|
|
73
82
|
private _resizeObserver;
|
|
74
83
|
private _scrollListenerAttached;
|
|
75
84
|
connectedCallback(): void;
|
|
85
|
+
static get observedAttributes(): string[];
|
|
86
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
76
87
|
disconnectedCallback(): void;
|
|
77
88
|
updated(changedProperties: Map<string, unknown>): void;
|
|
78
89
|
private _setupScrollListeners;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/collection/collection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/collection/collection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,gCAAgC,CAAC;AACxC,OAAO,wCAAwC,CAAC;AAChD,OAAO,0CAA0C,CAAC;AAClD,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGvF,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,O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