@canonical/react-ds-global-form 0.37.0 → 0.38.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.
Files changed (43) hide show
  1. package/README.md +40 -0
  2. package/dist/esm/density.css +320 -302
  3. package/dist/esm/docs/examples/density-examples.css +19 -14
  4. package/dist/esm/index.css +361 -335
  5. package/dist/esm/lib/_work_in_progress/DensityTestbed/baseline-system.css +71 -64
  6. package/dist/esm/lib/_work_in_progress/DensityTestbed/density.testbed.css +127 -123
  7. package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +73 -54
  8. package/dist/esm/lib/common/Wrapper/styles.css +35 -31
  9. package/dist/esm/lib/component/ChoicesField/common/Option/Option.js +4 -1
  10. package/dist/esm/lib/component/ChoicesField/common/Option/Option.js.map +1 -1
  11. package/dist/esm/lib/component/ChoicesField/styles.css +195 -163
  12. package/dist/esm/lib/component/RangeField/common/RangeControl/styles.css +39 -35
  13. package/dist/esm/lib/component/RichChoicesField/styles.css +93 -89
  14. package/dist/esm/lib/subcomponent/CheckboxInput/styles.css +115 -111
  15. package/dist/esm/lib/subcomponent/ColorInput/styles.css +177 -173
  16. package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js.map +1 -1
  17. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/styles.css +33 -29
  18. package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/styles.css +21 -17
  19. package/dist/esm/lib/subcomponent/ComboboxInput/styles.css +59 -55
  20. package/dist/esm/lib/subcomponent/DateInput/styles.css +23 -19
  21. package/dist/esm/lib/subcomponent/DateTimeInput/styles.css +24 -20
  22. package/dist/esm/lib/subcomponent/Field/Description/styles.css +9 -5
  23. package/dist/esm/lib/subcomponent/Field/Error/styles.css +9 -5
  24. package/dist/esm/lib/subcomponent/Field/Label/Label.js +2 -2
  25. package/dist/esm/lib/subcomponent/Field/Label/Label.js.map +1 -1
  26. package/dist/esm/lib/subcomponent/Field/Label/styles.css +25 -21
  27. package/dist/esm/lib/subcomponent/FileUploadInput/styles.css +125 -119
  28. package/dist/esm/lib/subcomponent/NumberInput/styles.css +32 -28
  29. package/dist/esm/lib/subcomponent/PasswordInput/styles.css +58 -54
  30. package/dist/esm/lib/subcomponent/PhoneInput/styles.css +53 -49
  31. package/dist/esm/lib/subcomponent/RadioInput/styles.css +70 -66
  32. package/dist/esm/lib/subcomponent/RangeInput/styles.css +74 -70
  33. package/dist/esm/lib/subcomponent/RatingInput/styles.css +132 -128
  34. package/dist/esm/lib/subcomponent/SelectInput/styles.css +44 -40
  35. package/dist/esm/lib/subcomponent/SwitchInput/styles.css +90 -86
  36. package/dist/esm/lib/subcomponent/TextInput/styles.css +30 -26
  37. package/dist/esm/lib/subcomponent/TextareaInput/styles.css +14 -10
  38. package/dist/esm/lib/subcomponent/TimeInput/styles.css +19 -15
  39. package/dist/esm/lib/utils/middleware/addRESTValidation.js +1 -1
  40. package/dist/esm/lib/utils/middleware/addRESTValidation.js.map +1 -1
  41. package/dist/types/lib/component/ChoicesField/common/Option/Option.d.ts.map +1 -1
  42. package/dist/types/lib/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +1 -1
  43. package/package.json +17 -16
@@ -1,27 +1,31 @@
1
1
  /* Date — native input wrapper with shared chrome.
2
2
  * The .chrome class provides border, padding, focus, and state styles
3
3
  * from index.css's .ds.input.chrome rule. Component-specific overrides below.
4
+ *
5
+ * Layer: ds.components.global (@canonical/styles README, "Cascade layers").
4
6
  */
5
7
 
6
- .ds.input.date {
7
- /* This element IS the text-bearing leaf, so it carries the inline padding
8
- * (`.ds.input.chrome` provides only the block padding). */
9
- padding-inline: var(--form-input-padding-inline);
8
+ @layer ds.components.global {
9
+ .ds.input.date {
10
+ /* This element IS the text-bearing leaf, so it carries the inline padding
11
+ * (`.ds.input.chrome` provides only the block padding). */
12
+ padding-inline: var(--form-input-padding-inline);
10
13
 
11
- /* Suppress native calendar picker inconsistencies across browsers */
12
- &::-webkit-inner-spin-button {
13
- display: none;
14
- }
14
+ /* Suppress native calendar picker inconsistencies across browsers */
15
+ &::-webkit-inner-spin-button {
16
+ display: none;
17
+ }
15
18
 
16
- /* NOTE (design review) — two native-<input type="date"> limits parked for Diana:
17
- * 1. "Suggested" format text → muted: NOT implementable in pure CSS. No
18
- * placeholder attribute (so `:placeholder-shown` never matches), and
19
- * `::-webkit-datetime-edit` colours the whole edit region — mask AND typed
20
- * value — with no empty-state selector, and Firefox ignores it. Needs a
21
- * custom (non-native) control or a JS empty-state hook.
22
- * 2. Calendar indicator → pragma icon: no calendar glyph exists in
23
- * @canonical/ds-assets to mask onto `::-webkit-calendar-picker-indicator`,
24
- * and that pseudo-element is WebKit/Chromium-only (Firefox draws its own,
25
- * unstyleable). Needs a new ds-assets glyph + Chrome/Safari-only styling, or
26
- * a custom control. */
19
+ /* NOTE (design review) — two native-<input type="date"> limits parked for Diana:
20
+ * 1. "Suggested" format text → muted: NOT implementable in pure CSS. No
21
+ * placeholder attribute (so `:placeholder-shown` never matches), and
22
+ * `::-webkit-datetime-edit` colours the whole edit region — mask AND typed
23
+ * value — with no empty-state selector, and Firefox ignores it. Needs a
24
+ * custom (non-native) control or a JS empty-state hook.
25
+ * 2. Calendar indicator → pragma icon: no calendar glyph exists in
26
+ * @canonical/ds-assets to mask onto `::-webkit-calendar-picker-indicator`,
27
+ * and that pseudo-element is WebKit/Chromium-only (Firefox draws its own,
28
+ * unstyleable). Needs a new ds-assets glyph + Chrome/Safari-only styling, or
29
+ * a custom control. */
30
+ }
27
31
  }
@@ -1,28 +1,32 @@
1
1
  /* DateTime — native input wrapper with shared chrome.
2
2
  * The .chrome class provides border, padding, focus, and state styles
3
3
  * from index.css's .ds.input.chrome rule. Component-specific overrides below.
4
+ *
5
+ * Layer: ds.components.global (@canonical/styles README, "Cascade layers").
4
6
  */
5
7
 
6
- .ds.input.datetime {
7
- /* This element IS the text-bearing leaf, so it carries the inline padding
8
- * (`.ds.input.chrome` provides only the block padding). */
9
- padding-inline: var(--form-input-padding-inline);
8
+ @layer ds.components.global {
9
+ .ds.input.datetime {
10
+ /* This element IS the text-bearing leaf, so it carries the inline padding
11
+ * (`.ds.input.chrome` provides only the block padding). */
12
+ padding-inline: var(--form-input-padding-inline);
10
13
 
11
- /* Suppress native calendar/clock picker inconsistencies across browsers */
12
- &::-webkit-inner-spin-button {
13
- display: none;
14
- }
14
+ /* Suppress native calendar/clock picker inconsistencies across browsers */
15
+ &::-webkit-inner-spin-button {
16
+ display: none;
17
+ }
15
18
 
16
- /* NOTE (design review) — two native-<input type="datetime-local"> limits
17
- * parked for Diana:
18
- * 1. "Suggested" format text → muted: NOT implementable in pure CSS. No
19
- * placeholder attribute (so `:placeholder-shown` never matches), and
20
- * `::-webkit-datetime-edit` colours the whole edit region — mask AND typed
21
- * value — with no empty-state selector, and Firefox ignores it. Needs a
22
- * custom (non-native) control or a JS empty-state hook.
23
- * 2. Calendar/clock indicator → pragma icon: no calendar/clock glyph exists in
24
- * @canonical/ds-assets to mask onto `::-webkit-calendar-picker-indicator`,
25
- * and that pseudo-element is WebKit/Chromium-only (Firefox draws its own,
26
- * unstyleable). Needs a new ds-assets glyph + Chrome/Safari-only styling, or
27
- * a custom control. */
19
+ /* NOTE (design review) — two native-<input type="datetime-local"> limits
20
+ * parked for Diana:
21
+ * 1. "Suggested" format text → muted: NOT implementable in pure CSS. No
22
+ * placeholder attribute (so `:placeholder-shown` never matches), and
23
+ * `::-webkit-datetime-edit` colours the whole edit region — mask AND typed
24
+ * value — with no empty-state selector, and Firefox ignores it. Needs a
25
+ * custom (non-native) control or a JS empty-state hook.
26
+ * 2. Calendar/clock indicator → pragma icon: no calendar/clock glyph exists in
27
+ * @canonical/ds-assets to mask onto `::-webkit-calendar-picker-indicator`,
28
+ * and that pseudo-element is WebKit/Chromium-only (Firefox draws its own,
29
+ * unstyleable). Needs a new ds-assets glyph + Chrome/Safari-only styling, or
30
+ * a custom control. */
31
+ }
28
32
  }
@@ -1,6 +1,10 @@
1
- .ds.field-description {
2
- color: var(--form-description-color);
3
- /* Align to the field edge like the label (no side padding by default), not
4
- * to the input's inner padding. Overridable via the shared variable. */
5
- padding-inline: var(--form-label-padding-inline, 0);
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ .ds.field-description {
5
+ color: var(--form-description-color);
6
+ /* Align to the field edge like the label (no side padding by default), not
7
+ * to the input's inner padding. Overridable via the shared variable. */
8
+ padding-inline: var(--form-label-padding-inline, 0);
9
+ }
6
10
  }
@@ -1,6 +1,10 @@
1
- .ds.field-error {
2
- color: var(--form-error-color);
3
- /* Align to the field edge like the label (no side padding by default), not
4
- * to the input's inner padding. Overridable via the shared variable. */
5
- padding-inline: var(--form-label-padding-inline, 0);
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
+
3
+ @layer ds.components.global {
4
+ .ds.field-error {
5
+ color: var(--form-error-color);
6
+ /* Align to the field edge like the label (no side padding by default), not
7
+ * to the input's inner padding. Overridable via the shared variable. */
8
+ padding-inline: var(--form-label-padding-inline, 0);
9
+ }
6
10
  }
@@ -13,10 +13,10 @@ const defaultMessages = {
13
13
  */
14
14
  const Label = ({ id, children, className, style, name, isOptional, requiredIndicator = "required", messages = defaultMessages, htmlFor, tag: Element = "label", }) => {
15
15
  // "required" mode marks the required fields, "optional" marks the optional
16
- // ones. The required marker (default "*") is drawn as a CSS `::before`
16
+ // ones. The required marker (default "*") is drawn as a CSS `::after`
17
17
  // pseudo-element keyed off `data-required`, NOT as text: that keeps it out of
18
18
  // the label's accessible name (a screen reader would otherwise announce
19
- // "asterisk Email" \u2014 the required state is conveyed by `aria-required` on the
19
+ // "Email asterisk" — the required state is conveyed by `aria-required` on the
20
20
  // input instead). The "(optional)" suffix IS real text, since it's
21
21
  // informational and belongs in the accessible name.
22
22
  const markRequired = requiredIndicator === "required" && !isOptional;
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Label/Label.tsx"],"names":[],"mappings":";AAGA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C,iDAAiD;AACjD,MAAM,eAAe,GAAG;IACtB,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,GAAG,UAAU,EAC9B,QAAQ,GAAG,eAAe,EAC1B,OAAO,EACP,GAAG,EAAE,OAAO,GAAG,OAAO,GACX,EAAsB,EAAE;IACnC,2EAA2E;IAC3E,uEAAuE;IACvE,8EAA8E;IAC9E,wEAAwE;IACxE,mFAAmF;IACnF,mEAAmE;IACnE,oDAAoD;IACpD,MAAM,YAAY,GAAG,iBAAiB,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC;IACrE,MAAM,kBAAkB,GAAG,iBAAiB,KAAK,UAAU,IAAI,UAAU,CAAC;IAE1E,OAAO,CACL,MAAC,OAAO,IACN,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,mBACnC,YAAY,IAAI,SAAS,EACxC,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,QAAQ,IAAI,IAAI,EAChB,kBAAkB,IAAI,CACrB,gBAAM,SAAS,EAAC,UAAU,mBAAI,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAC3D,IACO,CACX,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/Field/Label/Label.tsx"],"names":[],"mappings":";AAGA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAE/C,iDAAiD;AACjD,MAAM,eAAe,GAAG;IACtB,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,GAAG,UAAU,EAC9B,QAAQ,GAAG,eAAe,EAC1B,OAAO,EACP,GAAG,EAAE,OAAO,GAAG,OAAO,GACX,EAAsB,EAAE;IACnC,2EAA2E;IAC3E,sEAAsE;IACtE,8EAA8E;IAC9E,wEAAwE;IACxE,8EAA8E;IAC9E,mEAAmE;IACnE,oDAAoD;IACpD,MAAM,YAAY,GAAG,iBAAiB,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC;IACrE,MAAM,kBAAkB,GAAG,iBAAiB,KAAK,UAAU,IAAI,UAAU,CAAC;IAE1E,OAAO,CACL,MAAC,OAAO,IACN,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,mBACnC,YAAY,IAAI,SAAS,EACxC,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,QAAQ,IAAI,IAAI,EAChB,kBAAkB,IAAI,CACrB,gBAAM,SAAS,EAAC,UAAU,mBAAI,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAC3D,IACO,CACX,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,eAAe,KAAK,CAAC"}
@@ -1,25 +1,29 @@
1
- .ds.field-label {
2
- font-weight: var(--form-label-font-weight, normal);
3
- color: var(--form-label-color);
4
- /* No side padding by default — the label aligns to the field edge, not the
5
- * input's inner padding. Overridable via the variable. */
6
- padding-inline: var(--form-label-padding-inline, 0);
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
7
2
 
8
- /* Required marker. Drawn as a pseudo-element (NOT label text) so it never
9
- * enters the accessible name — a screen reader announces the field's required
10
- * state from `aria-required` on the input, not an "asterisk". The marker glyph
11
- * and the gap after it are themeable; the gap stands in for the requested
12
- * non-breaking space and, being a margin, never wraps away from the label.
13
- * Inherits the label colour by default (overridable via the variable). */
14
- &[data-required]::before {
15
- content: var(--form-required-marker, "*");
16
- margin-inline-end: var(--form-required-marker-gap, 0.25ch);
17
- color: var(--form-required-marker-color, var(--form-label-color));
18
- }
3
+ @layer ds.components.global {
4
+ .ds.field-label {
5
+ font-weight: var(--form-label-font-weight, normal);
6
+ color: var(--form-label-color);
7
+ /* No side padding by default — the label aligns to the field edge, not the
8
+ * input's inner padding. Overridable via the variable. */
9
+ padding-inline: var(--form-label-padding-inline, 0);
10
+
11
+ /* Required marker. Drawn as a pseudo-element (NOT label text) so it never
12
+ * enters the accessible name — a screen reader announces the field's required
13
+ * state from `aria-required` on the input, not an "asterisk". The marker glyph
14
+ * and the gap after it are themeable; the gap stands in for the requested
15
+ * non-breaking space and, being a margin, never wraps away from the label.
16
+ * Inherits the label colour by default (overridable via the variable). */
17
+ &[data-required]::after {
18
+ content: var(--form-required-marker, "*");
19
+ margin-inline-end: var(--form-required-marker-gap, 0.25ch);
20
+ color: var(--form-required-marker-color, var(--form-label-color));
21
+ }
19
22
 
20
- /* The "(optional)" suffix is a muted hint, visually subordinate to the label
21
- * — distinguished by colour (the label now uses regular paragraph weight too). */
22
- & > .optional {
23
- color: var(--color-text-muted);
23
+ /* The "(optional)" suffix is a muted hint, visually subordinate to the label
24
+ * — distinguished by colour (the label now uses regular paragraph weight too). */
25
+ & > .optional {
26
+ color: var(--color-text-muted);
27
+ }
24
28
  }
25
29
  }
@@ -1,138 +1,144 @@
1
- .ds.input.file-upload {
2
- display: flex;
3
- flex-direction: column;
4
- gap: var(--form-group-gap);
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
5
2
 
6
- & > .drop-zone {
3
+ @layer ds.components.global {
4
+ .ds.input.file-upload {
7
5
  display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- box-sizing: border-box;
11
- min-height: calc(var(--dimension-400) * 4); /* 128px */
12
- /* Compensate padding for border so total stays on baseline grid */
13
- padding: calc(
14
- var(--form-input-padding-block) -
15
- var(--form-input-border-width)
16
- )
17
- var(--form-input-padding-inline);
18
- border: var(--form-input-border-width) dashed var(--form-input-border-color);
19
- border-radius: var(--form-input-border-radius);
20
- background-color: var(--form-input-background);
21
- color: var(--color-text-muted);
22
- cursor: pointer;
23
- transition:
24
- border-color 150ms ease,
25
- background-color 150ms ease;
26
-
27
- & > input[type="file"] {
28
- position: absolute;
29
- width: 1px;
30
- height: 1px;
31
- overflow: hidden;
32
- clip: rect(0, 0, 0, 0);
33
- white-space: nowrap;
34
- border: 0;
35
- }
6
+ flex-direction: column;
7
+ gap: var(--form-group-gap);
36
8
 
37
- &:hover:not(:disabled) {
38
- background-color: var(
39
- --hover--color-foreground-input,
40
- var(--color-foreground-input-hover)
41
- );
9
+ & > .drop-zone {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ box-sizing: border-box;
14
+ min-height: calc(var(--dimension-400) * 4); /* 128px */
15
+ /* Compensate padding for border so total stays on baseline grid */
16
+ padding: calc(
17
+ var(--form-input-padding-block) -
18
+ var(--form-input-border-width)
19
+ )
20
+ var(--form-input-padding-inline);
21
+ border: var(--form-input-border-width) dashed
22
+ var(--form-input-border-color);
23
+ border-radius: var(--form-input-border-radius);
24
+ background-color: var(--form-input-background);
25
+ color: var(--color-text-muted);
26
+ cursor: pointer;
27
+ transition:
28
+ border-color var(--motion-duration-fast) ease,
29
+ background-color var(--motion-duration-fast) ease;
30
+
31
+ & > input[type="file"] {
32
+ position: absolute;
33
+ width: 1px;
34
+ height: 1px;
35
+ overflow: hidden;
36
+ clip: rect(0, 0, 0, 0);
37
+ white-space: nowrap;
38
+ border: 0;
39
+ }
40
+
41
+ &:hover:not(:disabled) {
42
+ background-color: var(
43
+ --hover--color-foreground-input,
44
+ var(--color-foreground-input-hover)
45
+ );
46
+ }
47
+
48
+ &:focus-visible {
49
+ outline: none;
50
+ border-color: var(--form-input-border-color-focus);
51
+ box-shadow: 0 0 0 1px var(--form-focus-ring-color);
52
+ }
53
+
54
+ &.drag-over {
55
+ border-color: var(--form-input-border-color-focus);
56
+ background-color: var(
57
+ --hover--color-foreground-input,
58
+ var(--color-foreground-input-hover)
59
+ );
60
+ }
61
+
62
+ &:disabled {
63
+ background-color: var(--form-input-background-disabled);
64
+ color: var(--form-input-color-disabled);
65
+ cursor: not-allowed;
66
+ }
42
67
  }
43
68
 
44
- &:focus-visible {
45
- outline: none;
46
- border-color: var(--form-input-border-color-focus);
47
- box-shadow: 0 0 0 1px var(--form-focus-ring-color);
69
+ & > .file-list {
70
+ list-style: none;
71
+ margin: 0;
72
+ padding: 0;
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: var(--form-group-gap);
48
76
  }
49
77
 
50
- &.drag-over {
51
- border-color: var(--form-input-border-color-focus);
52
- background-color: var(
53
- --hover--color-foreground-input,
54
- var(--color-foreground-input-hover)
55
- );
78
+ & > .file-list > .file-item {
79
+ display: flex;
80
+ align-items: baseline;
81
+ gap: var(--form-field-inline-gap);
82
+ box-sizing: border-box;
83
+ height: var(--form-input-height);
84
+ padding-block: 0;
85
+ padding-inline: var(--form-input-padding-inline);
86
+ border: var(--form-input-border-width) solid
87
+ var(--form-input-border-color);
88
+ border-radius: var(--form-input-border-radius);
89
+ background-color: var(--form-input-background);
56
90
  }
57
91
 
58
- &:disabled {
59
- background-color: var(--form-input-background-disabled);
60
- color: var(--form-input-color-disabled);
61
- cursor: not-allowed;
92
+ & > .file-list > .file-item > .file-preview {
93
+ width: var(--dimension-400); /* 32px */
94
+ height: var(--dimension-400); /* 32px */
95
+ object-fit: cover;
96
+ border-radius: var(--form-input-border-radius);
97
+ flex-shrink: 0;
62
98
  }
63
- }
64
-
65
- & > .file-list {
66
- list-style: none;
67
- margin: 0;
68
- padding: 0;
69
- display: flex;
70
- flex-direction: column;
71
- gap: var(--form-group-gap);
72
- }
73
-
74
- & > .file-list > .file-item {
75
- display: flex;
76
- align-items: baseline;
77
- gap: var(--form-field-inline-gap);
78
- box-sizing: border-box;
79
- height: var(--form-input-height);
80
- padding-block: 0;
81
- padding-inline: var(--form-input-padding-inline);
82
- border: var(--form-input-border-width) solid var(--form-input-border-color);
83
- border-radius: var(--form-input-border-radius);
84
- background-color: var(--form-input-background);
85
- }
86
99
 
87
- & > .file-list > .file-item > .file-preview {
88
- width: var(--dimension-400); /* 32px */
89
- height: var(--dimension-400); /* 32px */
90
- object-fit: cover;
91
- border-radius: var(--form-input-border-radius);
92
- flex-shrink: 0;
93
- }
94
-
95
- & > .file-list > .file-item > .file-name {
96
- flex: 1;
97
- min-width: 0;
98
- overflow: hidden;
99
- text-overflow: ellipsis;
100
- white-space: nowrap;
101
- }
102
-
103
- & > .file-list > .file-item > .file-size {
104
- color: var(--color-text-muted);
105
- white-space: nowrap;
106
- }
107
-
108
- & > .file-list > .file-item > .file-remove {
109
- appearance: none;
110
- border: none;
111
- background: none;
112
- color: var(--color-text-muted);
113
- cursor: pointer;
114
- padding: 0 0.25rem;
100
+ & > .file-list > .file-item > .file-name {
101
+ flex: 1;
102
+ min-width: 0;
103
+ overflow: hidden;
104
+ text-overflow: ellipsis;
105
+ white-space: nowrap;
106
+ }
115
107
 
116
- &:hover {
117
- color: var(--color-text);
108
+ & > .file-list > .file-item > .file-size {
109
+ color: var(--color-text-muted);
110
+ white-space: nowrap;
118
111
  }
119
112
 
120
- /* biome-ignore lint/style/noDescendingSpecificity: :disabled follows :hover by
121
- interaction-state order; both target the same element and reordering would
122
- change the cascade for no visual gain. */
123
- &:disabled {
124
- cursor: not-allowed;
125
- opacity: 0.5;
113
+ & > .file-list > .file-item > .file-remove {
114
+ appearance: none;
115
+ border: none;
116
+ background: none;
117
+ color: var(--color-text-muted);
118
+ cursor: pointer;
119
+ padding: 0 0.25rem;
120
+
121
+ &:hover {
122
+ color: var(--color-text);
123
+ }
124
+
125
+ /* biome-ignore lint/style/noDescendingSpecificity: :disabled follows :hover by
126
+ interaction-state order; both target the same element and reordering would
127
+ change the cascade for no visual gain. */
128
+ &:disabled {
129
+ cursor: not-allowed;
130
+ opacity: 0.5;
131
+ }
126
132
  }
127
133
  }
128
- }
129
134
 
130
- /* Danger state */
131
- .danger > .payload .ds.input.file-upload > .drop-zone {
132
- border-color: var(--form-input-border-color-error);
133
- }
135
+ /* Danger state */
136
+ .danger > .payload .ds.input.file-upload > .drop-zone {
137
+ border-color: var(--form-input-border-color-error);
138
+ }
134
139
 
135
- .danger > .payload .ds.input.file-upload > .drop-zone:focus-visible {
136
- border-color: var(--form-focus-ring-color-error);
137
- box-shadow: 0 0 0 1px var(--form-focus-ring-color-error);
140
+ .danger > .payload .ds.input.file-upload > .drop-zone:focus-visible {
141
+ border-color: var(--form-focus-ring-color-error);
142
+ box-shadow: 0 0 0 1px var(--form-focus-ring-color-error);
143
+ }
138
144
  }
@@ -1,33 +1,37 @@
1
- /* Generated by @canonical/summon-component:react v0.1.0 */
1
+ /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
2
 
3
- /* Native numeric entry with shared input chrome and optional prefix/suffix
4
- * slots for units. Mirrors the text input. */
5
- .ds.input.number {
6
- direction: inherit;
7
- display: flex;
8
- align-items: stretch;
9
- position: relative;
10
- padding: 0;
3
+ @layer ds.components.global {
4
+ /* Generated by @canonical/summon-component:react v0.1.0 */
11
5
 
12
- & > input {
13
- flex: 1;
14
- min-width: 0;
15
- border: none;
16
- background: transparent;
17
- color: inherit;
18
- font-family: inherit;
19
- outline: none;
20
- /* Baseline engine provides font-size, line-height, padding via `.p` */
21
- padding-inline: var(--form-input-padding-inline);
22
- }
23
-
24
- & > .prefix,
25
- & > .suffix {
6
+ /* Native numeric entry with shared input chrome and optional prefix/suffix
7
+ * slots for units. Mirrors the text input. */
8
+ .ds.input.number {
9
+ direction: inherit;
26
10
  display: flex;
27
- align-items: center;
28
- padding-inline: var(--form-field-inline-gap);
29
- color: var(--color-text-muted);
30
- white-space: nowrap;
31
- user-select: none;
11
+ align-items: stretch;
12
+ position: relative;
13
+ padding: 0;
14
+
15
+ & > input {
16
+ flex: 1;
17
+ min-width: 0;
18
+ border: none;
19
+ background: transparent;
20
+ color: inherit;
21
+ font-family: inherit;
22
+ outline: none;
23
+ /* Baseline engine provides font-size, line-height, padding via `.p` */
24
+ padding-inline: var(--form-input-padding-inline);
25
+ }
26
+
27
+ & > .prefix,
28
+ & > .suffix {
29
+ display: flex;
30
+ align-items: center;
31
+ padding-inline: var(--form-field-inline-gap);
32
+ color: var(--color-text-muted);
33
+ white-space: nowrap;
34
+ user-select: none;
35
+ }
32
36
  }
33
37
  }