@nearform/quantum 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -2
- package/dist/assets/build/open-source.icon.js +1 -1
- package/dist/assets/build/open-source.icon.js.map +1 -1
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/NativeSelect/index.d.ts +23 -0
- package/dist/components/NativeSelect/index.js +98 -0
- package/dist/components/NativeSelect/index.js.map +1 -0
- package/dist/components/Select/index.d.ts +1 -4
- package/dist/components/Select/index.js +2 -67
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/triggerVariants.d.ts +9 -0
- package/dist/components/Select/triggerVariants.js +76 -0
- package/dist/components/Select/triggerVariants.js.map +1 -0
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/Spinner/index.js.map +1 -1
- package/dist/components/ThemeToggle/index.d.ts +1 -1
- package/dist/components/ThemeToggle/index.js +6 -8
- package/dist/components/ThemeToggle/index.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/esm/assets/build/open-source.icon.js +1 -1
- package/dist/esm/assets/build/open-source.icon.js.map +1 -1
- package/dist/esm/components/Accordion/index.js +1 -1
- package/dist/esm/components/Accordion/index.js.map +1 -1
- package/dist/esm/components/NativeSelect/index.d.ts +23 -0
- package/dist/esm/components/NativeSelect/index.js +62 -0
- package/dist/esm/components/NativeSelect/index.js.map +1 -0
- package/dist/esm/components/Select/index.d.ts +1 -4
- package/dist/esm/components/Select/index.js +1 -66
- package/dist/esm/components/Select/index.js.map +1 -1
- package/dist/esm/components/Select/triggerVariants.d.ts +9 -0
- package/dist/esm/components/Select/triggerVariants.js +73 -0
- package/dist/esm/components/Select/triggerVariants.js.map +1 -0
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/Spinner/index.js.map +1 -1
- package/dist/esm/components/ThemeToggle/index.d.ts +1 -1
- package/dist/esm/components/ThemeToggle/index.js +1 -3
- package/dist/esm/components/ThemeToggle/index.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/theme-init.d.ts +23 -0
- package/dist/esm/theme-init.js +24 -0
- package/dist/esm/theme-init.js.map +1 -0
- package/dist/esm/theme.d.ts +6 -0
- package/dist/esm/theme.js +7 -1
- package/dist/esm/theme.js.map +1 -1
- package/dist/global.css +18 -1
- package/dist/theme-init.d.ts +23 -0
- package/dist/theme-init.js +27 -0
- package/dist/theme-init.js.map +1 -0
- package/dist/theme.js +7 -1
- package/dist/theme.js.map +1 -1
- package/package.json +12 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme a page should open in, applied before it first paints.
|
|
3
|
+
*
|
|
4
|
+
* `ThemeToggle` reads and writes the same key, but it runs after React has
|
|
5
|
+
* rendered, so a page that waits for it shows the light theme for a frame
|
|
6
|
+
* before switching. `themeInitScript` closes that gap: inline it in the page's
|
|
7
|
+
* `<head>`, ahead of the stylesheet, and the `.dark` class is set first.
|
|
8
|
+
*
|
|
9
|
+
* It lives here rather than beside `ThemeToggle`, with no imports, so that it
|
|
10
|
+
* can be loaded on its own as `@nearform/quantum/theme-init`, from a build
|
|
11
|
+
* config that injects it into a static `index.html` (Vite's
|
|
12
|
+
* `transformIndexHtml`, for one) without loading React or any component.
|
|
13
|
+
*/
|
|
14
|
+
/** The `localStorage` key that holds the chosen theme, `'light'` or `'dark'`. */
|
|
15
|
+
export declare const THEME_STORAGE_KEY = "theme";
|
|
16
|
+
/** The media query for the operating system's dark preference. */
|
|
17
|
+
export declare const DARK_SCHEME_QUERY = "(prefers-color-scheme: dark)";
|
|
18
|
+
/**
|
|
19
|
+
* The script to inline, as a string. A stored choice wins; otherwise it follows
|
|
20
|
+
* the operating system. It never throws: storage can be blocked and
|
|
21
|
+
* `matchMedia` can be missing, and the page then opens light.
|
|
22
|
+
*/
|
|
23
|
+
export declare const themeInitScript = "(function(){try{var t=localStorage.getItem('theme');document.documentElement.classList.toggle('dark',t==='dark'||(t!=='light'&&matchMedia('(prefers-color-scheme: dark)').matches))}catch(e){}})()";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The theme a page should open in, applied before it first paints.
|
|
4
|
+
*
|
|
5
|
+
* `ThemeToggle` reads and writes the same key, but it runs after React has
|
|
6
|
+
* rendered, so a page that waits for it shows the light theme for a frame
|
|
7
|
+
* before switching. `themeInitScript` closes that gap: inline it in the page's
|
|
8
|
+
* `<head>`, ahead of the stylesheet, and the `.dark` class is set first.
|
|
9
|
+
*
|
|
10
|
+
* It lives here rather than beside `ThemeToggle`, with no imports, so that it
|
|
11
|
+
* can be loaded on its own as `@nearform/quantum/theme-init`, from a build
|
|
12
|
+
* config that injects it into a static `index.html` (Vite's
|
|
13
|
+
* `transformIndexHtml`, for one) without loading React or any component.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.themeInitScript = exports.DARK_SCHEME_QUERY = exports.THEME_STORAGE_KEY = void 0;
|
|
17
|
+
/** The `localStorage` key that holds the chosen theme, `'light'` or `'dark'`. */
|
|
18
|
+
exports.THEME_STORAGE_KEY = 'theme';
|
|
19
|
+
/** The media query for the operating system's dark preference. */
|
|
20
|
+
exports.DARK_SCHEME_QUERY = '(prefers-color-scheme: dark)';
|
|
21
|
+
/**
|
|
22
|
+
* The script to inline, as a string. A stored choice wins; otherwise it follows
|
|
23
|
+
* the operating system. It never throws: storage can be blocked and
|
|
24
|
+
* `matchMedia` can be missing, and the page then opens light.
|
|
25
|
+
*/
|
|
26
|
+
exports.themeInitScript = `(function(){try{var t=localStorage.getItem('${exports.THEME_STORAGE_KEY}');document.documentElement.classList.toggle('dark',t==='dark'||(t!=='light'&&matchMedia('${exports.DARK_SCHEME_QUERY}').matches))}catch(e){}})()`;
|
|
27
|
+
//# sourceMappingURL=theme-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-init.js","sourceRoot":"","sources":["../src/theme-init.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,iFAAiF;AACpE,QAAA,iBAAiB,GAAG,OAAO,CAAA;AAExC,kEAAkE;AACrD,QAAA,iBAAiB,GAAG,8BAA8B,CAAA;AAE/D;;;;GAIG;AACU,QAAA,eAAe,GAAG,+CAA+C,QAAA,iBAAiB,6FAA6F,QAAA,iBAAiB,6BAA6B,CAAA"}
|
package/dist/theme.js
CHANGED
|
@@ -43,7 +43,13 @@ exports.default = {
|
|
|
43
43
|
none: '0px 0px'
|
|
44
44
|
},
|
|
45
45
|
fontFamily: {
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* We name the typeface but do not ship it: see "Loading the typeface" in
|
|
48
|
+
* the README. `'Inter Variable'` is the family `@fontsource-variable/inter`
|
|
49
|
+
* registers, the usual way to self-host it, so loading that package is
|
|
50
|
+
* enough on its own. Google Fonts and a local install register `'Inter'`.
|
|
51
|
+
*/
|
|
52
|
+
sans: ["'Inter'", "'Inter Variable'", ...defaultTheme_1.default.fontFamily.sans]
|
|
47
53
|
},
|
|
48
54
|
strokeWidth: {
|
|
49
55
|
0: '0px',
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":";;;;;AAAA,4EAAmD;AACnD,qEAA8C;AAC9C,iEAAsC;AAEtC;;;;;;;;;;;;;;;;;;;GAmBG;kBACY;IACb,MAAM,EAAN,kBAAM;IACN,SAAS,EAAE;QACT,EAAE,EAAE,qCAAqC;QACzC,OAAO,EAAE,sCAAsC;QAC/C,EAAE,EAAE,sCAAsC;QAC1C,EAAE,EAAE,qCAAqC;QACzC,EAAE,EAAE,wCAAwC;QAC5C,KAAK,EAAE,yCAAyC;QAChD,IAAI,EAAE,kCAAkC;QACxC,GAAG,EAAE,kCAAkC;QACvC,KAAK,EAAE,mCAAmC;QAC1C,UAAU,EACR,6EAA6E;QAC/E,YAAY,EAAE,yBAAyB;QACvC,IAAI,EAAE,SAAS;KAChB;IACD,UAAU,EAAE;QACV,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,sBAAY,CAAC,UAAU,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":";;;;;AAAA,4EAAmD;AACnD,qEAA8C;AAC9C,iEAAsC;AAEtC;;;;;;;;;;;;;;;;;;;GAmBG;kBACY;IACb,MAAM,EAAN,kBAAM;IACN,SAAS,EAAE;QACT,EAAE,EAAE,qCAAqC;QACzC,OAAO,EAAE,sCAAsC;QAC/C,EAAE,EAAE,sCAAsC;QAC1C,EAAE,EAAE,qCAAqC;QACzC,EAAE,EAAE,wCAAwC;QAC5C,KAAK,EAAE,yCAAyC;QAChD,IAAI,EAAE,kCAAkC;QACxC,GAAG,EAAE,kCAAkC;QACvC,KAAK,EAAE,mCAAmC;QAC1C,UAAU,EACR,6EAA6E;QAC/E,YAAY,EAAE,yBAAyB;QACvC,IAAI,EAAE,SAAS;KAChB;IACD,UAAU,EAAE;QACV;;;;;WAKG;QACH,IAAI,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG,sBAAY,CAAC,UAAU,CAAC,IAAI,CAAC;KACvE;IACD,WAAW,EAAE;QACX,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;KACT;IACD,MAAM,EAAE;QACN,SAAS,EAAE,kBAAU,CAAC,SAAS;QAC/B,SAAS,EAAE,kBAAU,CAAC,SAAS;KAChC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nearform/quantum",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Component library based on the Quantum Design System",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
"import": "./dist/esm/tailwind-plugin.js",
|
|
24
24
|
"require": "./dist/tailwind-plugin.js"
|
|
25
25
|
},
|
|
26
|
+
"./theme-init": {
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./dist/esm/theme-init.d.ts",
|
|
29
|
+
"default": "./dist/esm/theme-init.js"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./dist/theme-init.d.ts",
|
|
33
|
+
"default": "./dist/theme-init.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
26
36
|
"./global.css": "./dist/global.css"
|
|
27
37
|
},
|
|
28
38
|
"scripts": {
|
|
@@ -53,7 +63,7 @@
|
|
|
53
63
|
"bugs": {
|
|
54
64
|
"url": "https://github.com/nearform/quantum/issues"
|
|
55
65
|
},
|
|
56
|
-
"homepage": "https://github.
|
|
66
|
+
"homepage": "https://nearform.github.io/quantum/",
|
|
57
67
|
"lint-staged": {
|
|
58
68
|
"*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}": [
|
|
59
69
|
"oxlint --fix",
|