@sharadox/graphical-user-interface-web-library 0.0.0-stage → 0.1.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/LICENCA.md +76 -0
- package/LICENSE.md +76 -0
- package/NOTICE.md +3 -0
- package/README.md +151 -2
- package/distribution/box/index.d.ts +14 -0
- package/distribution/box/index.d.ts.map +1 -0
- package/distribution/box/index.js +49 -0
- package/distribution/box/index.js.map +1 -0
- package/distribution/box/index.module.css +1 -0
- package/distribution/box/index.module.scss +102 -0
- package/distribution/box/type.d.ts +51 -0
- package/distribution/box/type.d.ts.map +1 -0
- package/distribution/box/type.js +2 -0
- package/distribution/box/type.js.map +1 -0
- package/distribution/box-axis/index.d.ts +24 -0
- package/distribution/box-axis/index.d.ts.map +1 -0
- package/distribution/box-axis/index.js +114 -0
- package/distribution/box-axis/index.js.map +1 -0
- package/distribution/box-axis/type.d.ts +15 -0
- package/distribution/box-axis/type.d.ts.map +1 -0
- package/distribution/box-axis/type.js +2 -0
- package/distribution/box-axis/type.js.map +1 -0
- package/distribution/button/index.d.ts +15 -0
- package/distribution/button/index.d.ts.map +1 -0
- package/distribution/button/index.js +42 -0
- package/distribution/button/index.js.map +1 -0
- package/distribution/button/type.d.ts +37 -0
- package/distribution/button/type.d.ts.map +1 -0
- package/distribution/button/type.js +2 -0
- package/distribution/button/type.js.map +1 -0
- package/distribution/button-axis/index.d.ts +13 -0
- package/distribution/button-axis/index.d.ts.map +1 -0
- package/distribution/button-axis/index.js +13 -0
- package/distribution/button-axis/index.js.map +1 -0
- package/distribution/choice/index.d.ts +11 -0
- package/distribution/choice/index.d.ts.map +1 -0
- package/distribution/choice/index.js +35 -0
- package/distribution/choice/index.js.map +1 -0
- package/distribution/choice/type.d.ts +19 -0
- package/distribution/choice/type.d.ts.map +1 -0
- package/distribution/choice/type.js +2 -0
- package/distribution/choice/type.js.map +1 -0
- package/distribution/interface-configuration/index.d.ts +23 -0
- package/distribution/interface-configuration/index.d.ts.map +1 -0
- package/distribution/interface-configuration/index.js +160 -0
- package/distribution/interface-configuration/index.js.map +1 -0
- package/distribution/interface-configuration/type.d.ts +83 -0
- package/distribution/interface-configuration/type.d.ts.map +1 -0
- package/distribution/interface-configuration/type.js +2 -0
- package/distribution/interface-configuration/type.js.map +1 -0
- package/distribution/interface-style/index.d.ts +11 -0
- package/distribution/interface-style/index.d.ts.map +1 -0
- package/distribution/interface-style/index.js +14 -0
- package/distribution/interface-style/index.js.map +1 -0
- package/distribution/interface-style/type.d.ts +6 -0
- package/distribution/interface-style/type.d.ts.map +1 -0
- package/distribution/interface-style/type.js +2 -0
- package/distribution/interface-style/type.js.map +1 -0
- package/distribution/interface-styles/index.d.ts +13 -0
- package/distribution/interface-styles/index.d.ts.map +1 -0
- package/distribution/interface-styles/index.js +37 -0
- package/distribution/interface-styles/index.js.map +1 -0
- package/distribution/responsive/index.d.ts +10 -0
- package/distribution/responsive/index.d.ts.map +1 -0
- package/distribution/responsive/index.js +23 -0
- package/distribution/responsive/index.js.map +1 -0
- package/distribution/responsive/type.d.ts +12 -0
- package/distribution/responsive/type.d.ts.map +1 -0
- package/distribution/responsive/type.js +2 -0
- package/distribution/responsive/type.js.map +1 -0
- package/distribution/spinner/index.d.ts +11 -0
- package/distribution/spinner/index.d.ts.map +1 -0
- package/distribution/spinner/index.js +16 -0
- package/distribution/spinner/index.js.map +1 -0
- package/distribution/spinner/index.module.css +1 -0
- package/distribution/spinner/index.module.scss +41 -0
- package/distribution/spinner/type.d.ts +4 -0
- package/distribution/spinner/type.d.ts.map +1 -0
- package/distribution/spinner/type.js +2 -0
- package/distribution/spinner/type.js.map +1 -0
- package/distribution/style-sheet/index.d.ts +18 -0
- package/distribution/style-sheet/index.d.ts.map +1 -0
- package/distribution/style-sheet/index.js +166 -0
- package/distribution/style-sheet/index.js.map +1 -0
- package/distribution/style-switch/index.d.ts +10 -0
- package/distribution/style-switch/index.d.ts.map +1 -0
- package/distribution/style-switch/index.js +16 -0
- package/distribution/style-switch/index.js.map +1 -0
- package/distribution/style-switch/type.d.ts +15 -0
- package/distribution/style-switch/type.d.ts.map +1 -0
- package/distribution/style-switch/type.js +2 -0
- package/distribution/style-switch/type.js.map +1 -0
- package/package.json +102 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useStyle } from "@sharadox/style-web-library/use-style";
|
|
4
|
+
import { Choice } from "@sharadox/graphical-user-interface-web-library/choice";
|
|
5
|
+
/**
|
|
6
|
+
* A switch for one style group (color, corner, line…): a `Choice` of its options, the chosen one filled. The choice
|
|
7
|
+
* applies to the whole page at once and is remembered.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <StyleSwitch configuration={STYLES} group="color" label="Color" labels={{ system: "Inherit", white: "White", black: "Black" }} />
|
|
11
|
+
*/
|
|
12
|
+
export function StyleSwitch({ configuration, group, label, labels = {}, size, className }) {
|
|
13
|
+
const { choice, choices, choose } = useStyle(configuration, group);
|
|
14
|
+
return (_jsx(Choice, { label: label, options: choices.map((entry) => ({ value: entry.name, label: labels[entry.name] ?? entry.name })), value: choice, onChange: choose, size: size, className: className }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/style-switch/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uDAAuD,CAAC;AAG/E;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAyB;IAC9G,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACnE,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,EACjG,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StyleConfiguration } from "@sharadox/style-web-library/definition/type";
|
|
2
|
+
import type { Responsive } from "@sharadox/graphical-user-interface-web-library/responsive/type";
|
|
3
|
+
export interface StyleSwitchProperties {
|
|
4
|
+
/** The styles (`interfaceStyles(INTERFACE)`). */
|
|
5
|
+
configuration: StyleConfiguration;
|
|
6
|
+
/** The group it switches: `color`, `corner`, `line`. */
|
|
7
|
+
group: string;
|
|
8
|
+
/** The switch's name for assistive technology ("Color"). */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Each choice's words (`system` is the device's: "Inherit"); a choice without one shows its name. */
|
|
11
|
+
labels?: Readonly<Record<string, string>>;
|
|
12
|
+
size?: Responsive<string>;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/style-switch/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gEAAgE,CAAC;AAEjG,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,aAAa,EAAE,kBAAkB,CAAC;IAClC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,sGAAsG;IACtG,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/style-switch/type.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/graphical-user-interface-web-library",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "One generic, accessible, fully configurable component library: every interface piece in every variant, color, corner, line, size and state, styled from a single source of truth that each brand configures.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "SEE LICENSE IN LICENCA.md",
|
|
7
|
+
"author": "Sharadox <contact@sharadox.com>",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./*/type": {
|
|
11
|
+
"sharadox-source": "./source/*/type.ts",
|
|
12
|
+
"types": "./distribution/*/type.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./*": {
|
|
15
|
+
"sharadox-source": [
|
|
16
|
+
"./source/*/index.ts",
|
|
17
|
+
"./source/*/index.tsx"
|
|
18
|
+
],
|
|
19
|
+
"types": "./distribution/*/index.d.ts",
|
|
20
|
+
"default": "./distribution/*/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"distribution",
|
|
25
|
+
"LICENCA.md",
|
|
26
|
+
"LICENSE.md",
|
|
27
|
+
"NOTICE.md"
|
|
28
|
+
],
|
|
29
|
+
"sideEffects": [
|
|
30
|
+
"**/*.css"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=26"
|
|
34
|
+
},
|
|
35
|
+
"packageManager": "pnpm@10.34.9",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"next": ">=16",
|
|
41
|
+
"react": ">=19"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"react": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "library-build",
|
|
50
|
+
"lint": "eslint --max-warnings=0 .",
|
|
51
|
+
"format": "prettier --write .",
|
|
52
|
+
"format:check": "prettier --check .",
|
|
53
|
+
"type-check": "tsc --noEmit",
|
|
54
|
+
"test:unit": "vitest run --coverage",
|
|
55
|
+
"test:benchmark": "vitest bench --run --passWithNoTests",
|
|
56
|
+
"documentation": "typedoc",
|
|
57
|
+
"verify": "turbo run format:check lint type-check test:unit test:benchmark build",
|
|
58
|
+
"prepare": "turborepo-configuration library && (husky || true)"
|
|
59
|
+
},
|
|
60
|
+
"lint-staged": {
|
|
61
|
+
"*.{ts,tsx,js,mjs,cjs}": [
|
|
62
|
+
"prettier --write",
|
|
63
|
+
"eslint --fix --max-warnings=0"
|
|
64
|
+
],
|
|
65
|
+
"*.{json,md,yml,yaml,scss}": "prettier --write"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@sharadox/icon-web-library": "0.7.0-development.36",
|
|
69
|
+
"@sharadox/style-web-library": "^0.3.1",
|
|
70
|
+
"@sharadox/web-library": "^0.11.1"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@sharadox/es-lint-configuration-web-library": "^0.1.3",
|
|
74
|
+
"@sharadox/library-build-web-library": "^0.2.1",
|
|
75
|
+
"@sharadox/prettier-configuration-web-library": "^0.1.2",
|
|
76
|
+
"@sharadox/turborepo-configuration-web-library": "^0.1.4",
|
|
77
|
+
"@sharadox/type-script-configuration-web-library": "^0.2.3",
|
|
78
|
+
"@sharadox/vitest-configuration-web-library": "^0.2.1",
|
|
79
|
+
"@testing-library/dom": "^10.4.2",
|
|
80
|
+
"@testing-library/react": "^16.3.3",
|
|
81
|
+
"@types/node": "^26.6.6",
|
|
82
|
+
"@types/react": "^19.3.0",
|
|
83
|
+
"@types/react-dom": "^19.3.0",
|
|
84
|
+
"@vitest/coverage-v8": "^5.1.1",
|
|
85
|
+
"eslint": "9.39.5",
|
|
86
|
+
"happy-dom": "^21.0.4",
|
|
87
|
+
"husky": "^9.1.7",
|
|
88
|
+
"lint-staged": "^17.6.2",
|
|
89
|
+
"next": "16.4.5",
|
|
90
|
+
"prettier": "^3.10.1",
|
|
91
|
+
"react": "^19.3.1",
|
|
92
|
+
"react-dom": "^19.3.1",
|
|
93
|
+
"sass": "^1.108.2",
|
|
94
|
+
"turbo": "^2.11.13",
|
|
95
|
+
"typedoc": "^0.28.20",
|
|
96
|
+
"typescript": "6.0.3",
|
|
97
|
+
"vitest": "^5.1.1"
|
|
98
|
+
},
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "git+https://github.com/Sharadox/graphical-user-interface-web-library.git"
|
|
102
|
+
},
|
|
103
|
+
"homepage": "https://github.com/Sharadox/graphical-user-interface-web-library#readme"
|
|
104
|
+
}
|