@sharadox/graphical-user-interface-web-library 0.2.0-fields.7 → 0.2.0-fields.9

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.
@@ -1 +1 @@
1
- :where(.switch){display:inline-flex;align-items:center;gap:var(--scale-8);margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}:where(.switch):disabled{cursor:default}:where(.switch):focus-visible{outline:none}:where(.switch):focus-visible>:where(.track){outline:var(--focus-thickness) solid var(--current-color);outline-offset:var(--focus-offset)}:where(.track){justify-content:start;inline-size:calc(var(--current-minimum-size)*2);min-inline-size:calc(var(--current-minimum-size)*2);padding:var(--line-thickness)}:where(.track)>*{flex:none}:where(.knob){display:flex;justify-content:center;align-items:center;inline-size:calc(var(--current-minimum-size) - 4*var(--line-thickness));block-size:calc(var(--current-minimum-size) - 4*var(--line-thickness));border-radius:var(--corner-radius);background:currentcolor;font-size:.6em;transition:transform var(--duration) var(--easing)}:where(.knob)>*{color:var(--current-color)}:where(.switch[data-checked]) :where(.knob){transform:translateX(calc(var(--current-minimum-size)))}:where(.switch[data-checked]:dir(rtl)) :where(.knob){transform:translateX(calc(var(--current-minimum-size) * -1))}:where(.label){font-size:var(--current-font-size)}
1
+ :where(.switch){display:inline-flex;align-items:center;gap:var(--scale-8);margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}:where(.switch):disabled{cursor:default}:where(.switch):focus-visible{outline:none}:where(.switch):focus-visible>:where(.track){outline:var(--focus-thickness) solid var(--current-color);outline-offset:var(--focus-offset)}:where(.switch) .track{justify-content:start;inline-size:calc(var(--current-minimum-size)*2);min-inline-size:calc(var(--current-minimum-size)*2);padding:var(--line-thickness)}:where(.track)>*{flex:none}:where(.knob){display:flex;justify-content:center;align-items:center;inline-size:calc(var(--current-minimum-size) - 4*var(--line-thickness));block-size:calc(var(--current-minimum-size) - 4*var(--line-thickness));border-radius:var(--corner-radius);background:currentcolor;font-size:.6em;transition:transform var(--duration) var(--easing)}:where(.knob)>*{color:var(--current-color)}:where(.switch[data-checked]) :where(.knob){transform:translateX(calc(var(--current-minimum-size)))}:where(.switch[data-checked]:dir(rtl)) :where(.knob){transform:translateX(calc(var(--current-minimum-size) * -1))}:where(.label){font-size:var(--current-font-size)}
@@ -25,8 +25,9 @@
25
25
  }
26
26
  }
27
27
 
28
- // Twice as wide as high; the knob is a square of the track's inner height, gliding to the far end when on.
29
- :where(.track) {
28
+ // Twice as wide as high; the knob is a square of the track's inner height, gliding to the far end when on. Inside the
29
+ // switch, so these beat the box's own (zero-weight) size and padding whichever style sheet loads last.
30
+ :where(.switch) .track {
30
31
  justify-content: start;
31
32
  inline-size: calc(var(--current-minimum-size) * 2);
32
33
  min-inline-size: calc(var(--current-minimum-size) * 2);
@@ -16,6 +16,6 @@ import styles from "./index.module.css";
16
16
  export function TextField(properties) {
17
17
  const { label, hideLabel, hint, error, prefix, suffix, state, variant = "outlined", color, colorStyle, corner, line, size, className, multiline, id, ...control } = properties;
18
18
  const disabled = Boolean(control.disabled);
19
- return (_jsx(Field, { label: label, hideLabel: hideLabel, hint: hint, error: error, id: id, children: (attributes) => (_jsx(Box, { field: true, variant: variant, color: color ?? (error === undefined ? "middleground" : "error"), colorStyle: colorStyle, corner: corner, line: line, size: size, state: state ?? (disabled ? "disabled" : "enabled"), prefix: prefix, suffix: suffix, className: classNames(multiline && styles.multiline, className), ...(multiline && { "data-multiline": "" }), children: multiline ? (_jsx("textarea", { rows: 3, ...control, ...attributes, className: styles.control })) : (_jsx("input", { type: "text", ...control, ...attributes, className: styles.control })) })) }));
19
+ return (_jsx(Field, { label: label, hideLabel: hideLabel, hint: hint, error: error, id: id, children: (attributes) => (_jsx(Box, { field: true, variant: variant, color: color ?? (error === undefined ? "middleground" : "error"), colorStyle: colorStyle, corner: corner, line: line, size: size, state: state ?? (disabled ? "disabled" : "enabled"), prefix: prefix, suffix: suffix, className: classNames(styles.field, multiline && styles.multiline, className), ...(multiline && { "data-multiline": "" }), children: multiline ? (_jsx("textarea", { rows: 3, ...control, ...attributes, className: styles.control })) : (_jsx("input", { type: "text", ...control, ...attributes, className: styles.control })) })) }));
20
20
  }
21
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/text-field/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,oDAAoD,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,UAA+B;IACvD,MAAM,EACJ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,GAAG,UAAU,EACpB,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,SAAS,EACT,EAAE,EACF,GAAG,OAAO,EACX,GAAG,UAAU,CAAC;IACf,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,CACL,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,YACxE,CAAC,UAAU,EAAE,EAAE,CAAC,CACf,KAAC,GAAG,IACF,KAAK,QACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,EAChE,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,I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,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,YACxE,CAAC,UAAU,EAAE,EAAE,CAAC,CACf,KAAC,GAAG,IACF,KAAK,QACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,EAChE,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EACnD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,IAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,KACzE,CAAC,SAAS,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,YAE1C,SAAS,CAAC,CAAC,CAAC,CACX,mBACE,IAAI,EAAE,CAAC,KACF,OAAuD,KACxD,UAAU,EACd,SAAS,EAAE,MAAM,CAAC,OAAO,GACzB,CACH,CAAC,CAAC,CAAC,CACF,gBAAO,IAAI,EAAC,MAAM,KAAM,OAAkB,KAAM,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAC1F,GACG,CACP,GACK,CACT,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- :where(.control){box-sizing:border-box;inline-size:100%;min-inline-size:0;min-block-size:var(--section-minimum-size);margin:0;padding:0;border:0;outline:0;background:rgba(0,0,0,0);color:var(--current-hover-color);font:inherit;text-align:start}:where(.control)::placeholder{color:var(--current-color);opacity:.7}:where(.control):disabled{cursor:default}:where(textarea.control){min-block-size:calc(var(--section-minimum-size)*2);padding-block:var(--scale-8);resize:vertical}:where(.multiline){align-items:stretch}
1
+ :where(.control){box-sizing:border-box;inline-size:100%;min-inline-size:0;min-block-size:var(--section-minimum-size);margin:0;padding:0;border:0;outline:0;background:rgba(0,0,0,0);color:inherit;font:inherit;text-align:start}:where(.control)::placeholder{color:inherit;opacity:.6}:where(.control):disabled{cursor:default}:where(textarea.control){min-block-size:calc(var(--section-minimum-size)*2);padding-block:var(--scale-8);resize:vertical}:where(.multiline){align-items:stretch}:where(.field:not([data-variant=filled])) :where(.control){color:var(--current-hover-color)}
@@ -10,14 +10,14 @@
10
10
  border: 0;
11
11
  outline: 0;
12
12
  background: transparent;
13
- // The typed text is its color's hovered text: foreground for middleground, the color itself otherwise.
14
- color: var(--current-hover-color);
13
+ // The box's text color: the color's own on a fill (its "on" color), so it always reads.
14
+ color: inherit;
15
15
  font: inherit;
16
16
  text-align: start;
17
17
 
18
18
  &::placeholder {
19
- color: var(--current-color);
20
- opacity: 0.7;
19
+ color: inherit;
20
+ opacity: 0.6;
21
21
  }
22
22
 
23
23
  &:disabled {
@@ -35,3 +35,8 @@
35
35
  :where(.multiline) {
36
36
  align-items: stretch;
37
37
  }
38
+
39
+ // Not filled, the typed text is the color's hovered text: foreground in a middleground field, the color otherwise.
40
+ :where(.field:not([data-variant="filled"])) :where(.control) {
41
+ color: var(--current-hover-color);
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharadox/graphical-user-interface-web-library",
3
- "version": "0.2.0-fields.7",
3
+ "version": "0.2.0-fields.9",
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",