@atomic-ui/ui 0.12.1 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +130 -1
- package/dist/base/FieldElement.d.ts +20 -2
- package/dist/{chunk-2WHOBIOY.js → chunk-2BGOBD6Y.js} +2 -2
- package/dist/{chunk-FLAUZU7Y.js → chunk-2RC3QKYA.js} +84 -27
- package/dist/chunk-2RC3QKYA.js.map +1 -0
- package/dist/{chunk-BGHAANTP.js → chunk-5OCDXZXG.js} +3 -2
- package/dist/chunk-5OCDXZXG.js.map +1 -0
- package/dist/{chunk-UYTIJCCW.js → chunk-B2GWXXIW.js} +2 -2
- package/dist/{chunk-CFCFKLTN.js → chunk-EA3M6KPB.js} +11 -1
- package/dist/chunk-EA3M6KPB.js.map +1 -0
- package/dist/{chunk-R6YMSJR7.js → chunk-EFP7PJ6C.js} +68 -25
- package/dist/chunk-EFP7PJ6C.js.map +1 -0
- package/dist/{chunk-BAYSDP44.js → chunk-EIWICFXL.js} +51 -18
- package/dist/chunk-EIWICFXL.js.map +1 -0
- package/dist/{chunk-5IGBH4GL.js → chunk-EUOBFMWC.js} +2 -2
- package/dist/{chunk-FZWUQC42.js → chunk-F2MFV7RM.js} +2 -2
- package/dist/{chunk-3GPGDERO.js → chunk-G7CVRNY5.js} +2 -2
- package/dist/{chunk-2TNF7O43.js → chunk-LSEK5MEZ.js} +2 -2
- package/dist/{chunk-DXLEYNID.js → chunk-LVBYNQ45.js} +5 -3
- package/dist/chunk-LVBYNQ45.js.map +1 -0
- package/dist/{chunk-SOYKSPPX.js → chunk-NZSKUEYS.js} +18 -10
- package/dist/chunk-NZSKUEYS.js.map +1 -0
- package/dist/{chunk-5HCWL2YD.js → chunk-P5FAKEFK.js} +2 -2
- package/dist/{chunk-HSXLSJVG.js → chunk-PII4SJL5.js} +32 -16
- package/dist/chunk-PII4SJL5.js.map +1 -0
- package/dist/{chunk-ALFE35FS.js → chunk-QJBRENLI.js} +3 -3
- package/dist/{chunk-ALFE35FS.js.map → chunk-QJBRENLI.js.map} +1 -1
- package/dist/{chunk-3KAFK24X.js → chunk-RNFGIXJ7.js} +2 -2
- package/dist/{chunk-UBNCJROR.js → chunk-SRXC6ZPM.js} +11 -5
- package/dist/chunk-SRXC6ZPM.js.map +1 -0
- package/dist/{chunk-4MMRBNW7.js → chunk-WEX5RKVC.js} +10 -6
- package/dist/chunk-WEX5RKVC.js.map +1 -0
- package/dist/{chunk-CQT3VPYK.js → chunk-WT7MHYJR.js} +2 -2
- package/dist/{chunk-LXVPWTSY.js → chunk-ZOWOKIE4.js} +37 -21
- package/dist/chunk-ZOWOKIE4.js.map +1 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/app-bar.d.ts +22 -0
- package/dist/components/app-bar.js +3 -3
- package/dist/components/app-ui.d.ts +8 -0
- package/dist/components/app-ui.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.js +2 -2
- package/dist/components/chip-group.js +2 -2
- package/dist/components/chip.js +1 -1
- package/dist/components/date-input.js +2 -2
- package/dist/components/dialog.js +1 -1
- package/dist/components/journey.js +2 -2
- package/dist/components/layout.js +1 -1
- package/dist/components/navigation.js +1 -1
- package/dist/components/page.js +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/rows.js +1 -1
- package/dist/components/select.js +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/text-input.js +2 -2
- package/dist/components/textarea.js +2 -2
- package/dist/index.js +21 -21
- package/dist/server.d.ts +42 -0
- package/dist/server.js +26 -0
- package/dist/server.js.map +1 -0
- package/dist/standalone/atomic-ui.js +833 -746
- package/dist/standalone/atomic-ui.js.map +3 -3
- package/package.json +6 -2
- package/dist/chunk-4MMRBNW7.js.map +0 -1
- package/dist/chunk-BAYSDP44.js.map +0 -1
- package/dist/chunk-BGHAANTP.js.map +0 -1
- package/dist/chunk-CFCFKLTN.js.map +0 -1
- package/dist/chunk-DXLEYNID.js.map +0 -1
- package/dist/chunk-FLAUZU7Y.js.map +0 -1
- package/dist/chunk-HSXLSJVG.js.map +0 -1
- package/dist/chunk-LXVPWTSY.js.map +0 -1
- package/dist/chunk-R6YMSJR7.js.map +0 -1
- package/dist/chunk-SOYKSPPX.js.map +0 -1
- package/dist/chunk-UBNCJROR.js.map +0 -1
- /package/dist/{chunk-2WHOBIOY.js.map → chunk-2BGOBD6Y.js.map} +0 -0
- /package/dist/{chunk-UYTIJCCW.js.map → chunk-B2GWXXIW.js.map} +0 -0
- /package/dist/{chunk-5IGBH4GL.js.map → chunk-EUOBFMWC.js.map} +0 -0
- /package/dist/{chunk-FZWUQC42.js.map → chunk-F2MFV7RM.js.map} +0 -0
- /package/dist/{chunk-3GPGDERO.js.map → chunk-G7CVRNY5.js.map} +0 -0
- /package/dist/{chunk-2TNF7O43.js.map → chunk-LSEK5MEZ.js.map} +0 -0
- /package/dist/{chunk-5HCWL2YD.js.map → chunk-P5FAKEFK.js.map} +0 -0
- /package/dist/{chunk-3KAFK24X.js.map → chunk-RNFGIXJ7.js.map} +0 -0
- /package/dist/{chunk-CQT3VPYK.js.map → chunk-WT7MHYJR.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktSegmentedControl,
|
|
3
3
|
ImpaktSwitch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RNFGIXJ7.js";
|
|
5
5
|
import {
|
|
6
6
|
ImpaktTable
|
|
7
7
|
} from "./chunk-KE6WCXQP.js";
|
|
8
8
|
import {
|
|
9
9
|
ImpaktTextInput
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-B2GWXXIW.js";
|
|
11
11
|
import {
|
|
12
12
|
ImpaktTextarea
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WT7MHYJR.js";
|
|
14
14
|
import {
|
|
15
15
|
ImpaktToolCard
|
|
16
16
|
} from "./chunk-5PRB7P7N.js";
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
ImpaktFilterChip,
|
|
23
23
|
ImpaktRow,
|
|
24
24
|
ImpaktStatTile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-EIWICFXL.js";
|
|
26
26
|
import {
|
|
27
27
|
ImpaktSelect
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WEX5RKVC.js";
|
|
29
29
|
import {
|
|
30
30
|
ImpaktSource
|
|
31
31
|
} from "./chunk-QPOM7W3D.js";
|
|
@@ -47,11 +47,11 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ImpaktBreadcrumbs,
|
|
49
49
|
ImpaktNav
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-EA3M6KPB.js";
|
|
51
51
|
import {
|
|
52
52
|
ImpaktPage,
|
|
53
53
|
ImpaktSection
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-QJBRENLI.js";
|
|
55
55
|
import {
|
|
56
56
|
ImpaktPrice
|
|
57
57
|
} from "./chunk-EKPTMRBG.js";
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "./chunk-LP4RTYTL.js";
|
|
61
61
|
import {
|
|
62
62
|
ImpaktRadioGroup
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-LSEK5MEZ.js";
|
|
64
64
|
import {
|
|
65
65
|
ImpaktFieldset
|
|
66
66
|
} from "./chunk-F4IXELLK.js";
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
ImpaktRangeInput,
|
|
79
79
|
ImpaktTaskList,
|
|
80
80
|
groupDigits
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-2BGOBD6Y.js";
|
|
82
82
|
import {
|
|
83
83
|
ImpaktLanguageSwitch
|
|
84
84
|
} from "./chunk-NHEU5FT6.js";
|
|
@@ -87,40 +87,40 @@ import {
|
|
|
87
87
|
ImpaktHeading,
|
|
88
88
|
ImpaktStack,
|
|
89
89
|
ImpaktText
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-LVBYNQ45.js";
|
|
91
91
|
import {
|
|
92
92
|
ImpaktLink
|
|
93
93
|
} from "./chunk-K5QFVLCI.js";
|
|
94
94
|
import {
|
|
95
95
|
ImpaktCheckboxGroup
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-F2MFV7RM.js";
|
|
97
97
|
import {
|
|
98
98
|
ImpaktCheckbox
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-EUOBFMWC.js";
|
|
100
100
|
import {
|
|
101
101
|
ImpaktChecked
|
|
102
102
|
} from "./chunk-UFENSIWD.js";
|
|
103
103
|
import {
|
|
104
104
|
ImpaktChipGroup
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-G7CVRNY5.js";
|
|
106
106
|
import {
|
|
107
107
|
CYCLE,
|
|
108
108
|
ImpaktChip,
|
|
109
109
|
TONE,
|
|
110
110
|
toneOf
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-5OCDXZXG.js";
|
|
112
112
|
import {
|
|
113
113
|
ImpaktCodeDiff
|
|
114
114
|
} from "./chunk-7UI3OBXL.js";
|
|
115
115
|
import {
|
|
116
116
|
ImpaktDateInput
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-P5FAKEFK.js";
|
|
118
118
|
import {
|
|
119
119
|
ImpaktDialog
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-ZOWOKIE4.js";
|
|
121
121
|
import {
|
|
122
122
|
ImpaktAccordion
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-2RC3QKYA.js";
|
|
124
124
|
import "./chunk-6CDQSHVW.js";
|
|
125
125
|
import {
|
|
126
126
|
ImpaktStatus
|
|
@@ -131,7 +131,7 @@ import {
|
|
|
131
131
|
} from "./chunk-ZAWGJC4I.js";
|
|
132
132
|
import {
|
|
133
133
|
ImpaktAppBar
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-SRXC6ZPM.js";
|
|
135
135
|
import "./chunk-XX6JZW5N.js";
|
|
136
136
|
import {
|
|
137
137
|
ImpaktAvatar,
|
|
@@ -142,14 +142,14 @@ import {
|
|
|
142
142
|
ImpaktPagination,
|
|
143
143
|
ImpaktSlotPicker,
|
|
144
144
|
ImpaktToast
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-NZSKUEYS.js";
|
|
146
146
|
import {
|
|
147
147
|
pageLocale
|
|
148
148
|
} from "./chunk-UNGAG44M.js";
|
|
149
149
|
import {
|
|
150
150
|
FieldElement,
|
|
151
151
|
fieldWidths
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-PII4SJL5.js";
|
|
153
153
|
import {
|
|
154
154
|
lockScroll,
|
|
155
155
|
unlockScroll
|
|
@@ -172,7 +172,7 @@ import {
|
|
|
172
172
|
} from "./chunk-N6EEW2GF.js";
|
|
173
173
|
import {
|
|
174
174
|
ImpaktButton
|
|
175
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-EFP7PJ6C.js";
|
|
176
176
|
import {
|
|
177
177
|
ICONS,
|
|
178
178
|
ICON_NAMES,
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for a page drawn on the server with Lit's server renderer.
|
|
3
|
+
*
|
|
4
|
+
* Lit writes each element's styles into every declarative shadow root it draws, as a `<style>`.
|
|
5
|
+
* A page with thirteen buttons carries the button's styles thirteen times, which made the
|
|
6
|
+
* weareimpakt.com home page about 630 KB of HTML, three quarters of it repeated styles.
|
|
7
|
+
*
|
|
8
|
+
* `shareStyles` takes the drawn page and moves each distinct style into a file of its own, named
|
|
9
|
+
* by a hash of its text, and puts a `<link rel="stylesheet">` to that file where the `<style>`
|
|
10
|
+
* was. Every shadow root that shows the same element links to the same file, so the browser
|
|
11
|
+
* fetches and parses it once and shares it, and the page carries a short line in its place.
|
|
12
|
+
*
|
|
13
|
+
* The page is still whole without script: a stylesheet link works in a declarative shadow root
|
|
14
|
+
* as it does in the head. Hydration still works: Lit's hydration reads the markers after the
|
|
15
|
+
* styles, and keeps whatever stands before them. A browser holds back drawing what follows a
|
|
16
|
+
* stylesheet link in the body until the sheet has loaded, so nothing shows unstyled; the
|
|
17
|
+
* preload links in `head` start every sheet loading before the body is read, so that wait is short.
|
|
18
|
+
*
|
|
19
|
+
* Nothing here needs a DOM, so a build script can import it in Node.
|
|
20
|
+
*/
|
|
21
|
+
/** What `shareStyles` gives back. */
|
|
22
|
+
export interface SharedStyles {
|
|
23
|
+
/** The page, with each shadow root's `<style>` replaced by a link. */
|
|
24
|
+
html: string;
|
|
25
|
+
/** The style files to write beside the page: file name → CSS. */
|
|
26
|
+
sheets: Map<string, string>;
|
|
27
|
+
/** Preload links for the files this page uses, in the order the page first uses them, for its `<head>`. */
|
|
28
|
+
head: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ShareStylesOptions {
|
|
31
|
+
/** The address the page links each file at, from its file name, such as `name => '/atomic-ui/0.13.0/styles/' + name`. */
|
|
32
|
+
href: (file: string) => string;
|
|
33
|
+
}
|
|
34
|
+
/** A short, stable name for a style's text: FNV-1a, 64 bits, in base 36. Not for security, only to tell styles apart. */
|
|
35
|
+
export declare function styleName(cssText: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Move every declarative shadow root's styles into shared files.
|
|
38
|
+
*
|
|
39
|
+
* The same text always gets the same file name, so files can be cached for good and shared by
|
|
40
|
+
* every page of a site, and two builds of the same version write the same files.
|
|
41
|
+
*/
|
|
42
|
+
export declare function shareStyles(html: string, options: ShareStylesOptions): SharedStyles;
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// packages/ui/src/server.ts
|
|
2
|
+
var SHADOW_STYLE = /(<template\s+shadowroot(?:mode)?="(?:open|closed)"[^>]*>)<style>([\s\S]*?)<\/style>/g;
|
|
3
|
+
function styleName(cssText) {
|
|
4
|
+
let hash = 0xcbf29ce484222325n;
|
|
5
|
+
for (let i = 0; i < cssText.length; i += 1) {
|
|
6
|
+
hash ^= BigInt(cssText.charCodeAt(i));
|
|
7
|
+
hash = hash * 0x100000001b3n & 0xffffffffffffffffn;
|
|
8
|
+
}
|
|
9
|
+
return `${hash.toString(36).padStart(13, "0")}.css`;
|
|
10
|
+
}
|
|
11
|
+
var attr = (value) => value.replace(/&/g, "&").replace(/"/g, """);
|
|
12
|
+
function shareStyles(html, options) {
|
|
13
|
+
const sheets = /* @__PURE__ */ new Map();
|
|
14
|
+
const out = html.replace(SHADOW_STYLE, (_match, open, cssText) => {
|
|
15
|
+
const name = styleName(cssText);
|
|
16
|
+
if (!sheets.has(name)) sheets.set(name, cssText);
|
|
17
|
+
return `${open}<link rel="stylesheet" href="${attr(options.href(name))}">`;
|
|
18
|
+
});
|
|
19
|
+
const head = [...sheets.keys()].map((name) => `<link rel="preload" as="style" href="${attr(options.href(name))}">`).join("");
|
|
20
|
+
return { html: out, sheets, head };
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
shareStyles,
|
|
24
|
+
styleName
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Helpers for a page drawn on the server with Lit's server renderer.\n *\n * Lit writes each element's styles into every declarative shadow root it draws, as a `<style>`.\n * A page with thirteen buttons carries the button's styles thirteen times, which made the\n * weareimpakt.com home page about 630 KB of HTML, three quarters of it repeated styles.\n *\n * `shareStyles` takes the drawn page and moves each distinct style into a file of its own, named\n * by a hash of its text, and puts a `<link rel=\"stylesheet\">` to that file where the `<style>`\n * was. Every shadow root that shows the same element links to the same file, so the browser\n * fetches and parses it once and shares it, and the page carries a short line in its place.\n *\n * The page is still whole without script: a stylesheet link works in a declarative shadow root\n * as it does in the head. Hydration still works: Lit's hydration reads the markers after the\n * styles, and keeps whatever stands before them. A browser holds back drawing what follows a\n * stylesheet link in the body until the sheet has loaded, so nothing shows unstyled; the\n * preload links in `head` start every sheet loading before the body is read, so that wait is short.\n *\n * Nothing here needs a DOM, so a build script can import it in Node.\n */\n\n/** What `shareStyles` gives back. */\nexport interface SharedStyles {\n /** The page, with each shadow root's `<style>` replaced by a link. */\n html: string;\n /** The style files to write beside the page: file name → CSS. */\n sheets: Map<string, string>;\n /** Preload links for the files this page uses, in the order the page first uses them, for its `<head>`. */\n head: string;\n}\n\nexport interface ShareStylesOptions {\n /** The address the page links each file at, from its file name, such as `name => '/atomic-ui/0.13.0/styles/' + name`. */\n href: (file: string) => string;\n}\n\n/** A shadow root as Lit's server renderer opens it, followed by its styles. */\nconst SHADOW_STYLE = /(<template\\s+shadowroot(?:mode)?=\"(?:open|closed)\"[^>]*>)<style>([\\s\\S]*?)<\\/style>/g;\n\n/** A short, stable name for a style's text: FNV-1a, 64 bits, in base 36. Not for security, only to tell styles apart. */\nexport function styleName(cssText: string): string {\n let hash = 0xcbf29ce484222325n;\n for (let i = 0; i < cssText.length; i += 1) {\n hash ^= BigInt(cssText.charCodeAt(i));\n hash = (hash * 0x100000001b3n) & 0xffffffffffffffffn;\n }\n return `${hash.toString(36).padStart(13, '0')}.css`;\n}\n\nconst attr = (value: string) => value.replace(/&/g, '&').replace(/\"/g, '"');\n\n/**\n * Move every declarative shadow root's styles into shared files.\n *\n * The same text always gets the same file name, so files can be cached for good and shared by\n * every page of a site, and two builds of the same version write the same files.\n */\nexport function shareStyles(html: string, options: ShareStylesOptions): SharedStyles {\n const sheets = new Map<string, string>();\n const out = html.replace(SHADOW_STYLE, (_match, open: string, cssText: string) => {\n const name = styleName(cssText);\n if (!sheets.has(name)) sheets.set(name, cssText);\n return `${open}<link rel=\"stylesheet\" href=\"${attr(options.href(name))}\">`;\n });\n const head = [...sheets.keys()].map((name) => `<link rel=\"preload\" as=\"style\" href=\"${attr(options.href(name))}\">`).join('');\n return { html: out, sheets, head };\n}\n"],"mappings":";AAqCA,IAAM,eAAe;AAGd,SAAS,UAAU,SAAyB;AACjD,MAAI,OAAO;AACX,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,GAAG;AAC1C,YAAQ,OAAO,QAAQ,WAAW,CAAC,CAAC;AACpC,WAAQ,OAAO,iBAAkB;AAAA,EACnC;AACA,SAAO,GAAG,KAAK,SAAS,EAAE,EAAE,SAAS,IAAI,GAAG,CAAC;AAC/C;AAEA,IAAM,OAAO,CAAC,UAAkB,MAAM,QAAQ,MAAM,OAAO,EAAE,QAAQ,MAAM,QAAQ;AAQ5E,SAAS,YAAY,MAAc,SAA2C;AACnF,QAAM,SAAS,oBAAI,IAAoB;AACvC,QAAM,MAAM,KAAK,QAAQ,cAAc,CAAC,QAAQ,MAAc,YAAoB;AAChF,UAAM,OAAO,UAAU,OAAO;AAC9B,QAAI,CAAC,OAAO,IAAI,IAAI,EAAG,QAAO,IAAI,MAAM,OAAO;AAC/C,WAAO,GAAG,IAAI,gCAAgC,KAAK,QAAQ,KAAK,IAAI,CAAC,CAAC;AAAA,EACxE,CAAC;AACD,QAAM,OAAO,CAAC,GAAG,OAAO,KAAK,CAAC,EAAE,IAAI,CAAC,SAAS,wCAAwC,KAAK,QAAQ,KAAK,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;AAC3H,SAAO,EAAE,MAAM,KAAK,QAAQ,KAAK;AACnC;","names":[]}
|