@sharadox/graphical-user-interface-web-library 0.1.0 → 0.2.0-development.16

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.
Files changed (117) hide show
  1. package/README.md +28 -0
  2. package/distribution/avatar/index.d.ts +20 -0
  3. package/distribution/avatar/index.d.ts.map +1 -0
  4. package/distribution/avatar/index.js +35 -0
  5. package/distribution/avatar/index.js.map +1 -0
  6. package/distribution/avatar/index.module.css +1 -0
  7. package/distribution/avatar/index.module.scss +16 -0
  8. package/distribution/avatar/type.d.ts +9 -0
  9. package/distribution/avatar/type.d.ts.map +1 -0
  10. package/distribution/avatar/type.js +2 -0
  11. package/distribution/avatar/type.js.map +1 -0
  12. package/distribution/badge/index.d.ts +10 -0
  13. package/distribution/badge/index.d.ts.map +1 -0
  14. package/distribution/badge/index.js +15 -0
  15. package/distribution/badge/index.js.map +1 -0
  16. package/distribution/badge/index.module.css +1 -0
  17. package/distribution/badge/index.module.scss +7 -0
  18. package/distribution/badge/type.d.ts +4 -0
  19. package/distribution/badge/type.d.ts.map +1 -0
  20. package/distribution/badge/type.js +2 -0
  21. package/distribution/badge/type.js.map +1 -0
  22. package/distribution/box/index.d.ts.map +1 -1
  23. package/distribution/box/index.js +5 -2
  24. package/distribution/box/index.js.map +1 -1
  25. package/distribution/box/index.module.css +1 -1
  26. package/distribution/box/index.module.scss +28 -0
  27. package/distribution/box/type.d.ts +5 -0
  28. package/distribution/box/type.d.ts.map +1 -1
  29. package/distribution/card/index.d.ts +11 -0
  30. package/distribution/card/index.d.ts.map +1 -0
  31. package/distribution/card/index.js +18 -0
  32. package/distribution/card/index.js.map +1 -0
  33. package/distribution/card/index.module.css +1 -0
  34. package/distribution/card/index.module.scss +22 -0
  35. package/distribution/card/type.d.ts +15 -0
  36. package/distribution/card/type.d.ts.map +1 -0
  37. package/distribution/card/type.js +2 -0
  38. package/distribution/card/type.js.map +1 -0
  39. package/distribution/checkbox/index.d.ts +10 -0
  40. package/distribution/checkbox/index.d.ts.map +1 -0
  41. package/distribution/checkbox/index.js +21 -0
  42. package/distribution/checkbox/index.js.map +1 -0
  43. package/distribution/checkbox/type.d.ts +9 -0
  44. package/distribution/checkbox/type.d.ts.map +1 -0
  45. package/distribution/checkbox/type.js +2 -0
  46. package/distribution/checkbox/type.js.map +1 -0
  47. package/distribution/field/index.d.ts +11 -0
  48. package/distribution/field/index.d.ts.map +1 -0
  49. package/distribution/field/index.js +26 -0
  50. package/distribution/field/index.js.map +1 -0
  51. package/distribution/field/index.module.css +1 -0
  52. package/distribution/field/index.module.scss +21 -0
  53. package/distribution/field/type.d.ts +23 -0
  54. package/distribution/field/type.d.ts.map +1 -0
  55. package/distribution/field/type.js +2 -0
  56. package/distribution/field/type.js.map +1 -0
  57. package/distribution/radio-group/index.d.ts +11 -0
  58. package/distribution/radio-group/index.d.ts.map +1 -0
  59. package/distribution/radio-group/index.js +27 -0
  60. package/distribution/radio-group/index.js.map +1 -0
  61. package/distribution/radio-group/index.module.css +1 -0
  62. package/distribution/radio-group/index.module.scss +10 -0
  63. package/distribution/radio-group/type.d.ts +25 -0
  64. package/distribution/radio-group/type.d.ts.map +1 -0
  65. package/distribution/radio-group/type.js +2 -0
  66. package/distribution/radio-group/type.js.map +1 -0
  67. package/distribution/separator/index.d.ts +11 -0
  68. package/distribution/separator/index.d.ts.map +1 -0
  69. package/distribution/separator/index.js +16 -0
  70. package/distribution/separator/index.js.map +1 -0
  71. package/distribution/separator/index.module.css +1 -0
  72. package/distribution/separator/index.module.scss +12 -0
  73. package/distribution/separator/type.d.ts +7 -0
  74. package/distribution/separator/type.d.ts.map +1 -0
  75. package/distribution/separator/type.js +2 -0
  76. package/distribution/separator/type.js.map +1 -0
  77. package/distribution/switch/index.d.ts +11 -0
  78. package/distribution/switch/index.d.ts.map +1 -0
  79. package/distribution/switch/index.js +44 -0
  80. package/distribution/switch/index.js.map +1 -0
  81. package/distribution/switch/index.module.css +1 -0
  82. package/distribution/switch/index.module.scss +70 -0
  83. package/distribution/switch/type.d.ts +20 -0
  84. package/distribution/switch/type.d.ts.map +1 -0
  85. package/distribution/switch/type.js +2 -0
  86. package/distribution/switch/type.js.map +1 -0
  87. package/distribution/text-field/index.d.ts +13 -0
  88. package/distribution/text-field/index.d.ts.map +1 -0
  89. package/distribution/text-field/index.js +21 -0
  90. package/distribution/text-field/index.js.map +1 -0
  91. package/distribution/text-field/index.module.css +1 -0
  92. package/distribution/text-field/index.module.scss +42 -0
  93. package/distribution/text-field/type.d.ts +27 -0
  94. package/distribution/text-field/type.d.ts.map +1 -0
  95. package/distribution/text-field/type.js +2 -0
  96. package/distribution/text-field/type.js.map +1 -0
  97. package/distribution/toggle-mark/index.d.ts +11 -0
  98. package/distribution/toggle-mark/index.d.ts.map +1 -0
  99. package/distribution/toggle-mark/index.js +18 -0
  100. package/distribution/toggle-mark/index.js.map +1 -0
  101. package/distribution/toggle-mark/index.module.css +1 -0
  102. package/distribution/toggle-mark/index.module.scss +57 -0
  103. package/distribution/toggle-mark/type.d.ts +13 -0
  104. package/distribution/toggle-mark/type.d.ts.map +1 -0
  105. package/distribution/toggle-mark/type.js +2 -0
  106. package/distribution/toggle-mark/type.js.map +1 -0
  107. package/distribution/wrapper/index.d.ts +10 -0
  108. package/distribution/wrapper/index.d.ts.map +1 -0
  109. package/distribution/wrapper/index.js +15 -0
  110. package/distribution/wrapper/index.js.map +1 -0
  111. package/distribution/wrapper/index.module.css +1 -0
  112. package/distribution/wrapper/index.module.scss +8 -0
  113. package/distribution/wrapper/type.d.ts +4 -0
  114. package/distribution/wrapper/type.d.ts.map +1 -0
  115. package/distribution/wrapper/type.js +2 -0
  116. package/distribution/wrapper/type.js.map +1 -0
  117. package/package.json +15 -16
@@ -0,0 +1,57 @@
1
+ :where(.toggle) {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ gap: var(--scale-8);
5
+ cursor: pointer;
6
+ text-align: start;
7
+ }
8
+
9
+ :where(.control) {
10
+ position: relative;
11
+ display: inline-flex;
12
+ flex: none;
13
+ }
14
+
15
+ // The real input, invisible, over the drawn mark: it takes the clicks, the keyboard and the form.
16
+ :where(.native) {
17
+ position: absolute;
18
+ z-index: 1;
19
+ inset: 0;
20
+ margin: 0;
21
+ opacity: 0;
22
+ cursor: inherit;
23
+
24
+ &:disabled {
25
+ cursor: default;
26
+ }
27
+ }
28
+
29
+ :where(.toggle:has(.native:disabled)) {
30
+ cursor: default;
31
+ }
32
+
33
+ :where(.native:focus-visible + .mark) {
34
+ outline: var(--focus-thickness) solid var(--current-color);
35
+ outline-offset: var(--focus-offset);
36
+ }
37
+
38
+ // The check (or dot) grows in when checked and shrinks away when not.
39
+ :where(.mark) > * > :where(svg, .dot) {
40
+ transform: scale(0);
41
+ transition: transform var(--duration) var(--easing);
42
+ }
43
+
44
+ :where(.toggle[data-checked] .mark) > * > :where(svg, .dot) {
45
+ transform: scale(1);
46
+ }
47
+
48
+ :where(.dot) {
49
+ inline-size: 0.5em;
50
+ block-size: 0.5em;
51
+ border-radius: var(--corner-radius);
52
+ background: currentcolor;
53
+ }
54
+
55
+ :where(.label) {
56
+ font-size: var(--current-font-size);
57
+ }
@@ -0,0 +1,13 @@
1
+ import type { InputHTMLAttributes, ReactNode } from "react";
2
+ import type { BoxLook, BoxState } from "@sharadox/graphical-user-interface-web-library/box/type";
3
+ /** A checkbox's or a radio's mark and label. */
4
+ export interface ToggleMarkProperties extends Pick<BoxLook, "color" | "colorStyle" | "corner" | "line" | "size">, Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "size" | "type" | "onChange" | "checked" | "defaultChecked"> {
5
+ type: "checkbox" | "radio";
6
+ label: ReactNode;
7
+ /** Whether it is checked (the owner keeps the state). */
8
+ checked: boolean;
9
+ onChange: (checked: boolean) => void;
10
+ /** Forces a state (for the design system). */
11
+ state?: BoxState;
12
+ }
13
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/toggle-mark/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AAEjG,gDAAgD;AAChD,MAAM,WAAW,oBACf,SACE,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC,EAClE,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;IACpH,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/toggle-mark/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { WrapperProperties } from "@sharadox/graphical-user-interface-web-library/wrapper/type";
2
+ /**
3
+ * The page's width: a box as wide as its container up to `--wrapper-width` (1280), centered, with
4
+ * `--wrapper-padding` (16) on each side, so content never touches the screen's edges. Any element and box look.
5
+ *
6
+ * @example
7
+ * <Wrapper as="main" direction="top-to-bottom" gap={64}>…</Wrapper>
8
+ */
9
+ export declare function Wrapper({ className, ...box }: WrapperProperties): import("react").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/wrapper/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAE,EAAE,iBAAiB,+BAE/D"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { classNames } from "@sharadox/web-library/class-name";
3
+ import { Box } from "@sharadox/graphical-user-interface-web-library/box";
4
+ import styles from "./index.module.css";
5
+ /**
6
+ * The page's width: a box as wide as its container up to `--wrapper-width` (1280), centered, with
7
+ * `--wrapper-padding` (16) on each side, so content never touches the screen's edges. Any element and box look.
8
+ *
9
+ * @example
10
+ * <Wrapper as="main" direction="top-to-bottom" gap={64}>…</Wrapper>
11
+ */
12
+ export function Wrapper({ className, ...box }) {
13
+ return _jsx(Box, { ...box, "data-wrapper": "", className: classNames(styles.wrapper, className) });
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/wrapper/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AAEzE,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,EAAqB;IAC9D,OAAO,KAAC,GAAG,OAAK,GAAG,kBAAe,EAAE,EAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAI,CAAC;AAC5F,CAAC"}
@@ -0,0 +1 @@
1
+ .wrapper{box-sizing:border-box;inline-size:100%;max-inline-size:calc(var(--wrapper-width) + 2*var(--wrapper-padding));margin-inline:auto;padding-inline:var(--wrapper-padding)}
@@ -0,0 +1,8 @@
1
+ // A plain class, so its width and padding beat the box's own (zero-weight) values.
2
+ .wrapper {
3
+ box-sizing: border-box;
4
+ inline-size: 100%;
5
+ max-inline-size: calc(var(--wrapper-width) + 2 * var(--wrapper-padding));
6
+ margin-inline: auto;
7
+ padding-inline: var(--wrapper-padding);
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { BoxProperties } from "@sharadox/graphical-user-interface-web-library/box/type";
2
+ /** A wrapper takes everything a box does. */
3
+ export type WrapperProperties = BoxProperties;
4
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/wrapper/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAE7F,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../source/wrapper/type.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharadox/graphical-user-interface-web-library",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-development.16",
4
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
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENCA.md",
@@ -32,7 +32,6 @@
32
32
  "engines": {
33
33
  "node": ">=26"
34
34
  },
35
- "packageManager": "pnpm@10.34.9",
36
35
  "publishConfig": {
37
36
  "access": "public"
38
37
  },
@@ -45,18 +44,6 @@
45
44
  "optional": true
46
45
  }
47
46
  },
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
47
  "lint-staged": {
61
48
  "*.{ts,tsx,js,mjs,cjs}": [
62
49
  "prettier --write",
@@ -85,6 +72,7 @@
85
72
  "eslint": "9.39.5",
86
73
  "happy-dom": "^21.0.4",
87
74
  "husky": "^9.1.7",
75
+ "lightningcss": "1.33.0",
88
76
  "lint-staged": "^17.6.2",
89
77
  "next": "16.4.5",
90
78
  "prettier": "^3.10.1",
@@ -100,5 +88,16 @@
100
88
  "type": "git",
101
89
  "url": "git+https://github.com/Sharadox/graphical-user-interface-web-library.git"
102
90
  },
103
- "homepage": "https://github.com/Sharadox/graphical-user-interface-web-library#readme"
104
- }
91
+ "homepage": "https://github.com/Sharadox/graphical-user-interface-web-library#readme",
92
+ "scripts": {
93
+ "build": "library-build",
94
+ "lint": "eslint --max-warnings=0 .",
95
+ "format": "prettier --write .",
96
+ "format:check": "prettier --check .",
97
+ "type-check": "tsc --noEmit",
98
+ "test:unit": "vitest run --coverage",
99
+ "test:benchmark": "vitest bench --run --passWithNoTests",
100
+ "documentation": "typedoc",
101
+ "verify": "turbo run format:check lint type-check test:unit test:benchmark build"
102
+ }
103
+ }