@nldd/design-system 0.8.96 → 0.8.97
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/README.md +14 -10
- package/custom-elements.json +494 -92
- package/dist/components/components.js +609 -177
- package/dist/components/content/icon/icon-aliases.js +1 -1
- package/dist/components/content/icon/icon-aliases.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 +15 -4
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.js +12 -12
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/image/image.d.ts +19 -3
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +25 -4
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/image.styles.d.ts.map +1 -1
- package/dist/components/content/image/image.styles.js +36 -0
- package/dist/components/content/image/image.styles.js.map +1 -1
- package/dist/components/content/image/image.template.d.ts.map +1 -1
- package/dist/components/content/image/image.template.js +13 -1
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +25 -12
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +25 -12
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/{icon-DQHT2C7z.js → icon-D_ZGezHx.js} +13 -13
- package/dist/components/{icon-button-mevRsl4C.js → icon-button-NN0SrgS3.js} +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +1 -1
- package/dist/components/layout/box/box.js +1 -1
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +2 -1
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +9 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +36 -13
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.js +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +2 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +3 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +5 -0
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +57 -11
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +158 -15
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +95 -41
- package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +4 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +8 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +13 -0
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +4 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +8 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +17 -0
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts +11 -1
- package/dist/components/layout/page-sections/page-section-controls.d.ts.map +1 -1
- package/dist/components/layout/page-sections/page-section-controls.js +11 -2
- package/dist/components/layout/page-sections/page-section-controls.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +5 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +6 -2
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +11 -10
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +2 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +3 -2
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +2 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +4 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +8 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +17 -0
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.js +1 -1
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/{app-view/app-view.d.ts → shell/shell.d.ts} +11 -11
- package/dist/components/layout/shell/shell.d.ts.map +1 -0
- package/dist/components/layout/{app-view/app-view.js → shell/shell.js} +24 -24
- package/dist/components/layout/shell/shell.js.map +1 -0
- package/dist/components/layout/shell/shell.styles.d.ts +2 -0
- package/dist/components/layout/shell/shell.styles.d.ts.map +1 -0
- package/dist/components/layout/{app-view/app-view.styles.js → shell/shell.styles.js} +8 -8
- package/dist/components/layout/shell/shell.styles.js.map +1 -0
- package/dist/components/layout/shell/shell.template.d.ts +4 -0
- package/dist/components/layout/shell/shell.template.d.ts.map +1 -0
- package/dist/components/layout/shell/shell.template.js +9 -0
- package/dist/components/layout/shell/shell.template.js.map +1 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +2 -0
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +2 -0
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +15 -5
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +20 -7
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +4 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +8 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +5 -0
- 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 +13 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +12 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js +11 -10
- package/dist/components/navigation/menu-bar-item/menu-bar-item.template.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +10 -0
- 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 +21 -0
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/css/document-reset.css +3 -3
- package/dist/css/rich-text.css +36 -90
- package/dist/nldd.min.js +506 -349
- package/dist/types/vue.d.ts +67 -24
- package/dist/utilities/page-section-mixin.d.ts +5 -0
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +10 -1
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/scroll-mode-controller.d.ts +29 -13
- package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
- package/dist/utilities/scroll-mode-controller.js +48 -13
- package/dist/utilities/scroll-mode-controller.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/layout/app-view/app-view.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.js.map +0 -1
- package/dist/components/layout/app-view/app-view.styles.d.ts +0 -2
- package/dist/components/layout/app-view/app-view.styles.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.styles.js.map +0 -1
- package/dist/components/layout/app-view/app-view.template.d.ts +0 -4
- package/dist/components/layout/app-view/app-view.template.d.ts.map +0 -1
- package/dist/components/layout/app-view/app-view.template.js +0 -9
- package/dist/components/layout/app-view/app-view.template.js.map +0 -1
- package/dist/components/palettes.html +0 -245
- package/dist/components/sample-images/butterfly-1200.jpg +0 -0
- package/dist/components/sample-images/butterfly-1600.jpg +0 -0
- package/dist/components/sample-images/butterfly-480.jpg +0 -0
- package/dist/components/sample-images/butterfly-960.jpg +0 -0
- package/dist/palettes.html +0 -245
- package/dist/sample-images/butterfly-1200.jpg +0 -0
- package/dist/sample-images/butterfly-1600.jpg +0 -0
- package/dist/sample-images/butterfly-480.jpg +0 -0
- package/dist/sample-images/butterfly-960.jpg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
2
|
export type ScrollMode = 'nested' | 'root';
|
|
3
3
|
/** Bubbling + composed event a horizontal split view fires when it collapses to
|
|
4
|
-
* (or expands out of) a single visible column. nldd-
|
|
4
|
+
* (or expands out of) a single visible column. nldd-shell listens for it to
|
|
5
5
|
* derive the document-vs-nested scroll mode. */
|
|
6
6
|
export declare const SINGLE_COLUMN_CHANGE_EVENT = "nldd-single-column-change";
|
|
7
7
|
export interface SingleColumnChangeDetail {
|
|
@@ -10,44 +10,57 @@ export interface SingleColumnChangeDetail {
|
|
|
10
10
|
/** A layout layer that reflects the upstream-derived scroll mode. */
|
|
11
11
|
export interface ScrollModeConsumer {
|
|
12
12
|
/**
|
|
13
|
-
* Apply the derived scroll mode.
|
|
14
|
-
* consumer applies it directly; called with no argument (resize / no
|
|
13
|
+
* Apply the derived scroll mode. shell passes the mode it derived so the
|
|
14
|
+
* consumer applies it directly; called with no argument (resize / no shell)
|
|
15
15
|
* it re-reads the inherited `--context-scroll-mode` instead.
|
|
16
16
|
*/
|
|
17
17
|
readScrollMode(mode?: ScrollMode): void;
|
|
18
18
|
}
|
|
19
|
-
/** nldd-
|
|
19
|
+
/** nldd-shell — derives the mode and pushes re-reads to its registered layers. */
|
|
20
20
|
export interface ScrollModeProvider {
|
|
21
21
|
registerScrollConsumer(consumer: ScrollModeConsumer): void;
|
|
22
22
|
unregisterScrollConsumer(consumer: ScrollModeConsumer): void;
|
|
23
23
|
}
|
|
24
|
-
/** Nearest ancestor
|
|
24
|
+
/** Nearest ancestor shell (light-DOM `closest`; slotted layers stay in the
|
|
25
25
|
* consumer's light tree so this reaches across the slot boundaries), or null
|
|
26
26
|
* when a layer is used stand-alone (e.g. a bare page in the docs).
|
|
27
27
|
*
|
|
28
28
|
* An overlay ends the search: a sheet or a modal dialog is its own scroll
|
|
29
29
|
* container and its own top edge, so a page inside one owns its scroller
|
|
30
|
-
* whatever the app around it does. Without this the
|
|
30
|
+
* whatever the app around it does. Without this the shell would push its
|
|
31
31
|
* root mode straight through the overlay and the page's sticky header would
|
|
32
32
|
* stick against the document, over the content of the overlay. The overlays
|
|
33
33
|
* reset --context-scroll-mode as well, which is what the stand-alone read
|
|
34
34
|
* below then finds. */
|
|
35
35
|
export declare function findScrollModeProvider(host: Element): ScrollModeProvider | null;
|
|
36
|
+
/**
|
|
37
|
+
* Hands `adopt` the provider above `host` once it is defined, when it was not
|
|
38
|
+
* yet at the moment `host` connected.
|
|
39
|
+
*
|
|
40
|
+
* Custom elements upgrade in the order their modules are defined, and an app
|
|
41
|
+
* does not control that: importing nldd-sidebar-section defines nldd-page, and
|
|
42
|
+
* a route that loads before its shell defines the page before the shell. The
|
|
43
|
+
* provider is then in the DOM but has no `registerScrollConsumer` yet, so
|
|
44
|
+
* findScrollModeProvider returns null and the layer starts out stand-alone.
|
|
45
|
+
* This lets it register as soon as the provider is defined. Nothing happens
|
|
46
|
+
* when the host has left the DOM by then, or sits under another provider.
|
|
47
|
+
*/
|
|
48
|
+
export declare function whenScrollModeProviderDefined(host: Element, adopt: (provider: ScrollModeProvider) => void): void;
|
|
36
49
|
/**
|
|
37
50
|
* Reads the inherited `--context-scroll-mode` and reflects it to the host's
|
|
38
51
|
* `[data-scroll]` attribute so CSS can branch.
|
|
39
52
|
*
|
|
40
|
-
* In root-scroll mode the DOCUMENT scrolls (see nldd-
|
|
41
|
-
* layer between the document and an nldd-page —
|
|
53
|
+
* In root-scroll mode the DOCUMENT scrolls (see nldd-shell): every layout
|
|
54
|
+
* layer between the document and an nldd-page — shell, the split views and
|
|
42
55
|
* their panes — must flow (overflow: visible) instead of clipping, so the page's
|
|
43
56
|
* sticky header/footer can stick against the document. Rather than duplicate the
|
|
44
57
|
* read-and-reflect logic in each of those components, they share this controller.
|
|
45
58
|
*
|
|
46
|
-
* The mode is derived upstream by nldd-
|
|
47
|
-
* host registers as a consumer and
|
|
59
|
+
* The mode is derived upstream by nldd-shell. When a shell is present the
|
|
60
|
+
* host registers as a consumer and shell pushes an authoritative re-read on
|
|
48
61
|
* every change (a bare `--context-scroll-mode` update would otherwise not reach
|
|
49
62
|
* the resize-polling layers in time — rAF runs before ResizeObserver). Without
|
|
50
|
-
*
|
|
63
|
+
* a shell (a stand-alone page), it falls back to re-reading on window resize
|
|
51
64
|
* so a manual/media-query override still works. `nldd-page` keeps its own inline
|
|
52
65
|
* logic because it also has to re-wire scroll listeners.
|
|
53
66
|
*/
|
|
@@ -59,13 +72,16 @@ export declare class ScrollModeController implements ReactiveController, ScrollM
|
|
|
59
72
|
private _provider;
|
|
60
73
|
constructor(host: ReactiveControllerHost & HTMLElement, onChange?: (mode: ScrollMode) => void);
|
|
61
74
|
hostConnected(): void;
|
|
75
|
+
/** Switches from stand-alone to push once a provider that was not yet
|
|
76
|
+
* defined at connect is. */
|
|
77
|
+
private _adopt;
|
|
62
78
|
hostDisconnected(): void;
|
|
63
79
|
/**
|
|
64
|
-
* ScrollModeConsumer — nldd-
|
|
80
|
+
* ScrollModeConsumer — nldd-shell pushes the mode it derived. When a mode is
|
|
65
81
|
* passed it is applied directly; this is race-free, whereas re-reading
|
|
66
82
|
* `getComputedStyle` during a synchronous push can return a stale value for a
|
|
67
83
|
* deeply-nested host (the var may not have propagated through an ancestor's
|
|
68
|
-
* pending re-render yet). With no argument (resize / no
|
|
84
|
+
* pending re-render yet). With no argument (resize / no shell) the inherited
|
|
69
85
|
* var is re-read instead.
|
|
70
86
|
*/
|
|
71
87
|
readScrollMode(mode?: ScrollMode): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-mode-controller.d.ts","sourceRoot":"","sources":["../../src/utilities/scroll-mode-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3C;;iDAEiD;AACjD,eAAO,MAAM,0BAA0B,8BAA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D,OAAO,CAAC,SAAS,CAAC,CAA6B;IAC/C,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,SAAS,CAAmC;gBAExC,IAAI,EAAE,sBAAsB,GAAG,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI;IAM7F,aAAa,IAAI,IAAI;IAmBrB;iCAC6B;IAC7B,OAAO,CAAC,MAAM,CAKZ;IAEF,gBAAgB,IAAI,IAAI;IAUxB;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAQvC,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,SAAS,CAMf;IAEF,gFAAgF;IAChF,IAAI,IAAI,IAAI;CAGZ"}
|
|
@@ -1,37 +1,62 @@
|
|
|
1
1
|
/** Bubbling + composed event a horizontal split view fires when it collapses to
|
|
2
|
-
* (or expands out of) a single visible column. nldd-
|
|
2
|
+
* (or expands out of) a single visible column. nldd-shell listens for it to
|
|
3
3
|
* derive the document-vs-nested scroll mode. */
|
|
4
4
|
export const SINGLE_COLUMN_CHANGE_EVENT = 'nldd-single-column-change';
|
|
5
|
-
|
|
5
|
+
const PROVIDER_SELECTOR = 'nldd-shell, nldd-sheet, nldd-modal-dialog';
|
|
6
|
+
/** Nearest ancestor shell (light-DOM `closest`; slotted layers stay in the
|
|
6
7
|
* consumer's light tree so this reaches across the slot boundaries), or null
|
|
7
8
|
* when a layer is used stand-alone (e.g. a bare page in the docs).
|
|
8
9
|
*
|
|
9
10
|
* An overlay ends the search: a sheet or a modal dialog is its own scroll
|
|
10
11
|
* container and its own top edge, so a page inside one owns its scroller
|
|
11
|
-
* whatever the app around it does. Without this the
|
|
12
|
+
* whatever the app around it does. Without this the shell would push its
|
|
12
13
|
* root mode straight through the overlay and the page's sticky header would
|
|
13
14
|
* stick against the document, over the content of the overlay. The overlays
|
|
14
15
|
* reset --context-scroll-mode as well, which is what the stand-alone read
|
|
15
16
|
* below then finds. */
|
|
16
17
|
export function findScrollModeProvider(host) {
|
|
17
|
-
const el = host.closest?.(
|
|
18
|
+
const el = host.closest?.(PROVIDER_SELECTOR);
|
|
18
19
|
return el && 'registerScrollConsumer' in el ? el : null;
|
|
19
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Hands `adopt` the provider above `host` once it is defined, when it was not
|
|
23
|
+
* yet at the moment `host` connected.
|
|
24
|
+
*
|
|
25
|
+
* Custom elements upgrade in the order their modules are defined, and an app
|
|
26
|
+
* does not control that: importing nldd-sidebar-section defines nldd-page, and
|
|
27
|
+
* a route that loads before its shell defines the page before the shell. The
|
|
28
|
+
* provider is then in the DOM but has no `registerScrollConsumer` yet, so
|
|
29
|
+
* findScrollModeProvider returns null and the layer starts out stand-alone.
|
|
30
|
+
* This lets it register as soon as the provider is defined. Nothing happens
|
|
31
|
+
* when the host has left the DOM by then, or sits under another provider.
|
|
32
|
+
*/
|
|
33
|
+
export function whenScrollModeProviderDefined(host, adopt) {
|
|
34
|
+
const el = host.closest?.(PROVIDER_SELECTOR);
|
|
35
|
+
if (!el || 'registerScrollConsumer' in el)
|
|
36
|
+
return;
|
|
37
|
+
void customElements.whenDefined(el.localName).then(() => {
|
|
38
|
+
if (!host.isConnected)
|
|
39
|
+
return;
|
|
40
|
+
const provider = findScrollModeProvider(host);
|
|
41
|
+
if (provider && provider === el)
|
|
42
|
+
adopt(provider);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
20
45
|
/**
|
|
21
46
|
* Reads the inherited `--context-scroll-mode` and reflects it to the host's
|
|
22
47
|
* `[data-scroll]` attribute so CSS can branch.
|
|
23
48
|
*
|
|
24
|
-
* In root-scroll mode the DOCUMENT scrolls (see nldd-
|
|
25
|
-
* layer between the document and an nldd-page —
|
|
49
|
+
* In root-scroll mode the DOCUMENT scrolls (see nldd-shell): every layout
|
|
50
|
+
* layer between the document and an nldd-page — shell, the split views and
|
|
26
51
|
* their panes — must flow (overflow: visible) instead of clipping, so the page's
|
|
27
52
|
* sticky header/footer can stick against the document. Rather than duplicate the
|
|
28
53
|
* read-and-reflect logic in each of those components, they share this controller.
|
|
29
54
|
*
|
|
30
|
-
* The mode is derived upstream by nldd-
|
|
31
|
-
* host registers as a consumer and
|
|
55
|
+
* The mode is derived upstream by nldd-shell. When a shell is present the
|
|
56
|
+
* host registers as a consumer and shell pushes an authoritative re-read on
|
|
32
57
|
* every change (a bare `--context-scroll-mode` update would otherwise not reach
|
|
33
58
|
* the resize-polling layers in time — rAF runs before ResizeObserver). Without
|
|
34
|
-
*
|
|
59
|
+
* a shell (a stand-alone page), it falls back to re-reading on window resize
|
|
35
60
|
* so a manual/media-query override still works. `nldd-page` keeps its own inline
|
|
36
61
|
* logic because it also has to re-wire scroll listeners.
|
|
37
62
|
*/
|
|
@@ -40,6 +65,15 @@ export class ScrollModeController {
|
|
|
40
65
|
this.mode = 'nested';
|
|
41
66
|
this._raf = 0;
|
|
42
67
|
this._provider = null;
|
|
68
|
+
/** Switches from stand-alone to push once a provider that was not yet
|
|
69
|
+
* defined at connect is. */
|
|
70
|
+
this._adopt = (provider) => {
|
|
71
|
+
if (this._provider)
|
|
72
|
+
return;
|
|
73
|
+
window.removeEventListener('resize', this._onResize);
|
|
74
|
+
this._provider = provider;
|
|
75
|
+
provider.registerScrollConsumer(this);
|
|
76
|
+
};
|
|
43
77
|
this._onResize = () => {
|
|
44
78
|
if (this._raf)
|
|
45
79
|
return;
|
|
@@ -55,7 +89,7 @@ export class ScrollModeController {
|
|
|
55
89
|
hostConnected() {
|
|
56
90
|
this._provider = findScrollModeProvider(this._host);
|
|
57
91
|
if (this._provider) {
|
|
58
|
-
// Push-driven: the
|
|
92
|
+
// Push-driven: the shell pushes the authoritative mode on register
|
|
59
93
|
// and on every change. We deliberately do NOT self-read the var here —
|
|
60
94
|
// a getComputedStyle read while a freshly (re)mounted host settles can
|
|
61
95
|
// be stale (the inherited var not yet propagated), which stuck a layer
|
|
@@ -63,11 +97,12 @@ export class ScrollModeController {
|
|
|
63
97
|
this._provider.registerScrollConsumer(this);
|
|
64
98
|
}
|
|
65
99
|
else {
|
|
66
|
-
// Stand-alone (no
|
|
100
|
+
// Stand-alone (no shell, e.g. docs): the mode comes from the
|
|
67
101
|
// inherited var; re-read on resize since it can flip at a media-query
|
|
68
102
|
// breakpoint.
|
|
69
103
|
window.addEventListener('resize', this._onResize, { passive: true });
|
|
70
104
|
this.read();
|
|
105
|
+
whenScrollModeProviderDefined(this._host, this._adopt);
|
|
71
106
|
}
|
|
72
107
|
}
|
|
73
108
|
hostDisconnected() {
|
|
@@ -82,11 +117,11 @@ export class ScrollModeController {
|
|
|
82
117
|
cancelAnimationFrame(this._raf);
|
|
83
118
|
}
|
|
84
119
|
/**
|
|
85
|
-
* ScrollModeConsumer — nldd-
|
|
120
|
+
* ScrollModeConsumer — nldd-shell pushes the mode it derived. When a mode is
|
|
86
121
|
* passed it is applied directly; this is race-free, whereas re-reading
|
|
87
122
|
* `getComputedStyle` during a synchronous push can return a stale value for a
|
|
88
123
|
* deeply-nested host (the var may not have propagated through an ancestor's
|
|
89
|
-
* pending re-render yet). With no argument (resize / no
|
|
124
|
+
* pending re-render yet). With no argument (resize / no shell) the inherited
|
|
90
125
|
* var is re-read instead.
|
|
91
126
|
*/
|
|
92
127
|
readScrollMode(mode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-mode-controller.js","sourceRoot":"","sources":["../../src/utilities/scroll-mode-controller.ts"],"names":[],"mappings":"AAIA;;iDAEiD;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,2BAA2B,CAAC;AAsBtE;;;;;;;;;;wBAUwB;AACxB,MAAM,UAAU,sBAAsB,CAAC,IAAa;IACnD,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"scroll-mode-controller.js","sourceRoot":"","sources":["../../src/utilities/scroll-mode-controller.ts"],"names":[],"mappings":"AAIA;;iDAEiD;AACjD,MAA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AS,GAAG,IAAI,CAAC;QACvB,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,IAAI,CAAC,IAAI;YAAE,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,IAAiB;QAC/B,MAAM,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACrC,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAEO,QAAQ;QACf,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1F,OAAO,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3C,CAAC;IAUD,gFAAgF;IAChF,IAAI;QACH,IAAI,CAAC,cAAc,EAAE,CAAC;IACvB,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nldd/design-system",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.97",
|
|
4
4
|
"description": "Designsysteem voor de Nederlandse Digitale Dienst",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/components.js",
|
|
@@ -218,9 +218,9 @@
|
|
|
218
218
|
"types": "./dist/components/inputs/token-field/token-field.d.ts",
|
|
219
219
|
"default": "./dist/components/inputs/token-field/token-field.js"
|
|
220
220
|
},
|
|
221
|
-
"./
|
|
222
|
-
"types": "./dist/components/layout/
|
|
223
|
-
"default": "./dist/components/layout/
|
|
221
|
+
"./shell": {
|
|
222
|
+
"types": "./dist/components/layout/shell/shell.d.ts",
|
|
223
|
+
"default": "./dist/components/layout/shell/shell.js"
|
|
224
224
|
},
|
|
225
225
|
"./bar-split-view": {
|
|
226
226
|
"types": "./dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-view.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/app-view/app-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAIjD,OAAO,KAAK,EAAc,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAyBvH,qBACa,WAAY,SAAQ,UAAW,YAAW,kBAAkB;IACxE,OAAgB,MAAM,0BAAiB;IAGvC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAU;IAIvC,OAAO,CAAC,gBAAgB,CAAiC;IAIzD,OAAO,CAAC,YAAY,CAA2B;IAK/C,OAAO,CAAC,WAAW,CAAiE;IAIpF,gBAAgB;IAChB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAe1D,gBAAgB;IAChB,wBAAwB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAa5D,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB,CAE3B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAqBlB,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAsBrC,OAAO,CAAC,gBAAgB;IAWf,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAM/C,OAAO,CAAC,oBAAoB;IAOnB,MAA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K,QAAQ;YACzC,CAAC,CAAC,8CAA8C;YAChD,CAAC,CAAC,4CAA4C,CAAC;QAChD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,OAAO,KAAK,GAAG,CAAC;IACvD,CAAC;IAEQ,MAAM;QACd,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;;AAnJe,kBAAM,GAAG,aAAa,AAAhB,CAAiB;AAGvC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAoB,MAAM,CAAC,EAAE,CAAC;+CAC9C;AAJ3B,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAqJvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-view.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/app-view/app-view.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,yBA2EzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-view.styles.js","sourceRoot":"","sources":["../../../../src/components/layout/app-view/app-view.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2E/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-view.template.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/app-view/app-view.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAgB,eAAe,CAAC,UAAU,EAAE,WAAW,GAAG,cAAc,CAMvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-view.template.js","sourceRoot":"","sources":["../../../../src/components/layout/app-view/app-view.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAG3C,MAAM,UAAU,eAAe,CAAC,UAAuB;IACtD,OAAO,IAAI,CAAA;;;;EAIV,CAAC;AACH,CAAC"}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="nl" data-scheme="light">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>NLDD Paletten</title>
|
|
7
|
-
<link rel="stylesheet" href="/css/settings.css">
|
|
8
|
-
<style>
|
|
9
|
-
body {
|
|
10
|
-
margin: 0;
|
|
11
|
-
padding: 2rem;
|
|
12
|
-
font-family: 'RijksSansVF', system-ui, sans-serif;
|
|
13
|
-
background: light-dark(#fff, #111);
|
|
14
|
-
color: light-dark(#111, #fff);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
header {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: baseline;
|
|
20
|
-
justify-content: space-between;
|
|
21
|
-
gap: 1rem;
|
|
22
|
-
max-width: 1400px;
|
|
23
|
-
margin: 0 auto 2rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h1 {
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-size: 1.5rem;
|
|
29
|
-
font-weight: 600;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
h2 {
|
|
33
|
-
margin: 2rem 0 0.5rem;
|
|
34
|
-
font-size: 1rem;
|
|
35
|
-
font-weight: 600;
|
|
36
|
-
text-transform: capitalize;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: baseline;
|
|
39
|
-
gap: 0.75rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
h2 small {
|
|
43
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
44
|
-
font-size: 0.75rem;
|
|
45
|
-
opacity: 0.6;
|
|
46
|
-
font-weight: 400;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
main {
|
|
50
|
-
max-width: 1400px;
|
|
51
|
-
margin: 0 auto;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
section + section h1 {
|
|
55
|
-
margin-top: 3rem;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.section-title {
|
|
59
|
-
margin: 2.5rem 0 0.5rem;
|
|
60
|
-
font-size: 0.875rem;
|
|
61
|
-
font-weight: 600;
|
|
62
|
-
text-transform: uppercase;
|
|
63
|
-
letter-spacing: 0.05em;
|
|
64
|
-
opacity: 0.6;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.strip {
|
|
68
|
-
display: grid;
|
|
69
|
-
grid-template-columns: repeat(25, 1fr);
|
|
70
|
-
gap: 2px;
|
|
71
|
-
border-radius: 6px;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.swatch {
|
|
76
|
-
aspect-ratio: 1 / 2;
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-direction: column;
|
|
79
|
-
justify-content: flex-end;
|
|
80
|
-
padding: 4px;
|
|
81
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
82
|
-
font-size: 9px;
|
|
83
|
-
line-height: 1;
|
|
84
|
-
position: relative;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.swatch.light-text { color: rgba(255,255,255,0.85); }
|
|
88
|
-
.swatch.dark-text { color: rgba(0,0,0,0.7); }
|
|
89
|
-
|
|
90
|
-
.swatch span {
|
|
91
|
-
text-align: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.swatch.is-ref::before {
|
|
95
|
-
content: '★';
|
|
96
|
-
position: absolute;
|
|
97
|
-
top: 4px;
|
|
98
|
-
right: 4px;
|
|
99
|
-
font-size: 10px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
button.toggle {
|
|
103
|
-
padding: 0.4rem 0.8rem;
|
|
104
|
-
border: 1px solid currentColor;
|
|
105
|
-
background: transparent;
|
|
106
|
-
color: inherit;
|
|
107
|
-
border-radius: 4px;
|
|
108
|
-
font: inherit;
|
|
109
|
-
font-size: 0.8rem;
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
button.toggle:hover {
|
|
114
|
-
background: light-dark(#0001, #fff1);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
footer {
|
|
118
|
-
max-width: 1400px;
|
|
119
|
-
margin: 3rem auto 0;
|
|
120
|
-
font-size: 0.75rem;
|
|
121
|
-
opacity: 0.6;
|
|
122
|
-
line-height: 1.5;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
footer code {
|
|
126
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
127
|
-
}
|
|
128
|
-
</style>
|
|
129
|
-
</head>
|
|
130
|
-
<body>
|
|
131
|
-
<header>
|
|
132
|
-
<h1>NLDD Paletten</h1>
|
|
133
|
-
<button class="toggle" type="button" aria-label="Wissel kleurenschema">Light / Dark</button>
|
|
134
|
-
</header>
|
|
135
|
-
|
|
136
|
-
<main>
|
|
137
|
-
<div class="section-title">Functionele aliassen</div>
|
|
138
|
-
<div id="aliases"></div>
|
|
139
|
-
|
|
140
|
-
<div class="section-title">Descriptive paletten</div>
|
|
141
|
-
<div id="descriptive"></div>
|
|
142
|
-
</main>
|
|
143
|
-
|
|
144
|
-
<footer>
|
|
145
|
-
<p>★ markeert de step die het dichtst bij de oorspronkelijke referentiekleur ligt.
|
|
146
|
-
Step 500 = peak chroma. Plateau van mirror(ref) tot ref op volle chroma; daarbuiten taper.</p>
|
|
147
|
-
<p>Hex-waarden vind je in <code>src/assets/styles/palettes.generated.css</code>.</p>
|
|
148
|
-
</footer>
|
|
149
|
-
|
|
150
|
-
<script type="module">
|
|
151
|
-
const STEPS = [0, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500,
|
|
152
|
-
550, 600, 650, 700, 750, 800, 850, 900, 925, 950, 975, 1000];
|
|
153
|
-
|
|
154
|
-
const ALIASES = ['accent', 'critical', 'mark', 'neutral', 'success', 'warning'];
|
|
155
|
-
|
|
156
|
-
const DESCRIPTIVE = [
|
|
157
|
-
{ name: 'coolgray', hex: '#64748B' },
|
|
158
|
-
{ name: 'lintblauw', hex: '#154273' },
|
|
159
|
-
{ name: 'donkerblauw', hex: '#01689B' },
|
|
160
|
-
{ name: 'hemelblauw', hex: '#007BC7' },
|
|
161
|
-
{ name: 'lichtblauw', hex: '#8FCAE7' },
|
|
162
|
-
{ name: 'paars', hex: '#42145F' },
|
|
163
|
-
{ name: 'violet', hex: '#A90061' },
|
|
164
|
-
{ name: 'robijnrood', hex: '#CA005D' },
|
|
165
|
-
{ name: 'roze', hex: '#F092CD' },
|
|
166
|
-
{ name: 'rood', hex: '#D52B1E' },
|
|
167
|
-
{ name: 'oranje', hex: '#E17000' },
|
|
168
|
-
{ name: 'donkergeel', hex: '#FFB612' },
|
|
169
|
-
{ name: 'geel', hex: '#F9E11E' },
|
|
170
|
-
{ name: 'donkerbruin', hex: '#673327' },
|
|
171
|
-
{ name: 'bruin', hex: '#94710A' },
|
|
172
|
-
{ name: 'donkergroen', hex: '#275937' },
|
|
173
|
-
{ name: 'groen', hex: '#39870C' },
|
|
174
|
-
{ name: 'mosgroen', hex: '#777B00' },
|
|
175
|
-
{ name: 'mintgroen', hex: '#76D2B6' },
|
|
176
|
-
];
|
|
177
|
-
|
|
178
|
-
// WCAG luminance from hex
|
|
179
|
-
function relLum(hex) {
|
|
180
|
-
const c = hex.slice(1).match(/.{2}/g).map(h => {
|
|
181
|
-
const v = parseInt(h, 16) / 255;
|
|
182
|
-
return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
183
|
-
});
|
|
184
|
-
return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Find the step whose target_lum is closest to the reference color's lum
|
|
188
|
-
function nearestStep(refHex) {
|
|
189
|
-
const lum = relLum(refHex);
|
|
190
|
-
const centerLum = Math.sqrt(1.05 * 0.05) - 0.05;
|
|
191
|
-
const logTarget = Math.log(Math.max(lum, 0.0001) + 0.05);
|
|
192
|
-
const logWhite = Math.log(1.05);
|
|
193
|
-
const logCenter = Math.log(centerLum + 0.05);
|
|
194
|
-
const logBlack = Math.log(0.05);
|
|
195
|
-
|
|
196
|
-
let pos;
|
|
197
|
-
if (logTarget >= logCenter) {
|
|
198
|
-
const t = (logTarget - logWhite) / (logCenter - logWhite);
|
|
199
|
-
pos = Math.max(0, Math.min(0.5, t * 0.5));
|
|
200
|
-
} else {
|
|
201
|
-
const t = (logTarget - logCenter) / (logBlack - logCenter);
|
|
202
|
-
pos = Math.max(0.5, Math.min(1.0, 0.5 + t * 0.5));
|
|
203
|
-
}
|
|
204
|
-
const target = pos * 1000;
|
|
205
|
-
return STEPS.reduce((a, b) =>
|
|
206
|
-
Math.abs(b - target) < Math.abs(a - target) ? b : a
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Decide light/dark text per swatch based on step (rough proxy for lightness in current scheme)
|
|
211
|
-
function textClass(step, scheme) {
|
|
212
|
-
// In light scheme, lower steps = lighter; in dark scheme, mirrored
|
|
213
|
-
const effective = scheme === 'dark' ? 1000 - step : step;
|
|
214
|
-
return effective < 500 ? 'dark-text' : 'light-text';
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function renderPalette(name, refHex) {
|
|
218
|
-
const refStep = refHex ? nearestStep(refHex) : null;
|
|
219
|
-
const scheme = document.documentElement.dataset.scheme;
|
|
220
|
-
const swatches = STEPS.map(step => {
|
|
221
|
-
const cls = ['swatch', textClass(step, scheme)];
|
|
222
|
-
if (step === refStep) cls.push('is-ref');
|
|
223
|
-
return `<div class="${cls.join(' ')}" style="background:var(--primitives-color-${name}-${step})"><span>${step}</span></div>`;
|
|
224
|
-
}).join('');
|
|
225
|
-
const refLabel = refHex ? `<small>${refHex}</small>` : '';
|
|
226
|
-
return `<h2>${name}${refLabel}</h2><div class="strip">${swatches}</div>`;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function render() {
|
|
230
|
-
document.getElementById('aliases').innerHTML =
|
|
231
|
-
ALIASES.map(name => renderPalette(name)).join('');
|
|
232
|
-
document.getElementById('descriptive').innerHTML =
|
|
233
|
-
DESCRIPTIVE.map(({ name, hex }) => renderPalette(name, hex)).join('');
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
document.querySelector('button.toggle').addEventListener('click', () => {
|
|
237
|
-
const root = document.documentElement;
|
|
238
|
-
root.dataset.scheme = root.dataset.scheme === 'light' ? 'dark' : 'light';
|
|
239
|
-
render();
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
render();
|
|
243
|
-
</script>
|
|
244
|
-
</body>
|
|
245
|
-
</html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|