@wtfalch/design 0.10.1 → 0.10.2

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,4 +1,4 @@
1
- export default function Checkbox({ label, hint, meta, checked, defaultChecked, onChange, name, value, disabled, className, }: {
1
+ export default function Checkbox({ label, hint, meta, checked, defaultChecked, onChange, name, value, disabled, tile, className, }: {
2
2
  label: React.ReactNode;
3
3
  /** What choosing it means, or what it costs. Under the name. `hint`, the
4
4
  * word `Toggle`, `Slider` and `Field` use for the same line; it was `why`. */
@@ -17,5 +17,15 @@ export default function Checkbox({ label, hint, meta, checked, defaultChecked, o
17
17
  * which is rarely the word a Server Action wants to read. */
18
18
  value?: string;
19
19
  disabled?: boolean;
20
+ /** In a grid of tiles rather than a run of full-width rows.
21
+ *
22
+ * The tick is positioned at the top right, and in a full-width row the
23
+ * label never reaches it. In a tile it runs underneath, so the body needs
24
+ * the room reserved. This was a `.choice-tiles .choice-body` rule, which
25
+ * meant the package styling its own component through a class the caller
26
+ * had to know to write on the container -- and there is no such container
27
+ * component, so the class was only ever a private name in a consumer's
28
+ * markup. A prop says the same thing and belongs to the component. */
29
+ tile?: boolean;
20
30
  className?: string;
21
31
  }): import("react").JSX.Element;
@@ -38,14 +38,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
38
  * neither) for one the form reads at submit.
39
39
  */
40
40
  import { Checkbox as AriaCheckbox } from 'react-aria-components';
41
- export default function Checkbox({ label, hint, meta, checked, defaultChecked, onChange, name, value, disabled, className, }) {
41
+ export default function Checkbox({ label, hint, meta, checked, defaultChecked, onChange, name, value, disabled, tile, className, }) {
42
42
  /* React Aria's `Checkbox` is the `<label>`. It keeps the real input in the
43
43
  markup and visually hidden -- exactly the arrangement this component
44
44
  already had by hand -- and stamps `data-selected`, `data-focus-visible`
45
45
  and `data-disabled` on the row. The ring and the tick are still drawn by
46
46
  the row's `::after` and `::before`; `checkbox.css` now reads the state off
47
47
  those attributes instead of `:has(input:checked)`. */
48
- return (_jsx(AriaCheckbox, { className: `choice${className ? ` ${className}` : ''}`,
48
+ return (_jsx(AriaCheckbox, { className: `choice${tile ? ' choice-tile' : ''}${className ? ` ${className}` : ''}`,
49
49
  /* `undefined` is what makes React Aria leave the box uncontrolled, so
50
50
  the controlled and uncontrolled cases are the same call: pass both and
51
51
  let whichever was given decide. Passing `isSelected={false}` here
@@ -1552,10 +1552,6 @@ input:active, textarea:active, select:active { transform: none; }
1552
1552
  40% { opacity: 1; transform: translateY(-3px); }
1553
1553
  }
1554
1554
 
1555
- /* The top bar carries the title, the views and the way into settings. Nothing
1556
- that belongs to a conversation lives here any more, so it can breathe. */
1557
- .topbar .ctl-grow { flex: 1; min-width: 0; }
1558
-
1559
1555
  @keyframes listening-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
1560
1556
 
1561
1557
  /* table ---------------------------------------------------------------- */
@@ -1824,23 +1820,6 @@ input:active, textarea:active, select:active { transform: none; }
1824
1820
  border-color: var(--bad);
1825
1821
  }
1826
1822
 
1827
- /* Three fields on one line, and their inputs on one line too.
1828
-
1829
- `Field` puts the description *above* the control, which is the house rule and
1830
- right -- but only `Arguments` has one here, so as a flex row the other two
1831
- inputs floated a description's height above it and the row read as broken.
1832
- Aligned to the end instead: the labels sit where their text needs them and
1833
- the three boxes share a baseline, which is the edge the eye actually follows.
1834
-
1835
- A grid rather than flex, so `Arguments` gets the room it needs by declaration
1836
- instead of by an inline pixel width on each of its neighbours. */
1837
- .mcp-local .field-row {
1838
- display: grid;
1839
- grid-template-columns: 1fr 1fr 2fr;
1840
- align-items: end;
1841
- gap: var(--space-3);
1842
- }
1843
-
1844
1823
  /* How an applet's polling is going, said the same way on every tile. Muted
1845
1824
  when it is going fine -- this is a fact you glance at, not one you are being
1846
1825
  told. */
@@ -3023,11 +3002,6 @@ input[type='radio']:active:not(:disabled) {
3023
3002
  width: min(760px, 100%);
3024
3003
  }
3025
3004
 
3026
- /* Settings is wider than the others: the rail carries group headings with a
3027
- hint each and indented tabs under them, and a pane beside it that draws
3028
- cards with a control on the right -- 760 gave one or the other room. */
3029
- .modal.modal-settings { width: min(880px, 100%); }
3030
-
3031
3005
  .modal {
3032
3006
  /* The window, less the backdrop's padding at each end -- `--space-15` is 60px
3033
3007
  and there are two of them, above and below.
@@ -3462,25 +3436,12 @@ input[type='range'].slider:disabled::-moz-range-thumb { opacity: 0; }
3462
3436
  /* A run of checkboxes is one choice, not several settings that happen to be
3463
3437
  adjacent. Tight enough that the group reads as a block -- at the spacing a
3464
3438
  form field wants, four tools look like four unrelated questions. */
3465
- /* The same choice, laid out as tiles instead of a column.
3466
-
3467
- Four short names down the full width of a card is four wide bands for four
3468
- words -- the row is sized by the card, not by anything in it, so `Read` gets
3469
- the same 1000px as a sentence would. As tiles they are sized by their
3470
- content and the group reads as one set of four rather than a stack of four
3471
- settings.
3472
-
3473
- `auto-fit` with a floor rather than a fixed four: the pane is a modal that
3474
- narrows with the window, and four columns of 40px is worse than two of 160.
3475
- The floor is the width at which a two-word name still fits on one line. */
3476
- .choice-tiles {
3477
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
3478
- gap: var(--space-2);
3479
- }
3480
-
3481
3439
  /* Room for the tick, which is absolutely positioned at the top right. In a
3482
- full-width row the text never reached it; in a tile it would run underneath. */
3483
- .choice-tiles .choice-body { padding-right: var(--space-6); }
3440
+ full-width row the text never reaches it; in a tile it would run underneath.
3441
+ `tile` is a prop on the component now: this was keyed on a `.choice-tiles`
3442
+ container that no component renders, so the class only ever existed in a
3443
+ consumer's markup and the package was styling itself through it. */
3444
+ .choice-tile .choice-body { padding-right: var(--space-6); }
3484
3445
 
3485
3446
  /* The floor is 220px and not 150px because of what four items do at the widths
3486
3447
  in between. The settings pane gives this group 514px: at a 150px floor that
package/dist/tf.css CHANGED
@@ -1822,10 +1822,6 @@ input:active, textarea:active, select:active { transform: none; }
1822
1822
  40% { opacity: 1; transform: translateY(-3px); }
1823
1823
  }
1824
1824
 
1825
- /* The top bar carries the title, the views and the way into settings. Nothing
1826
- that belongs to a conversation lives here any more, so it can breathe. */
1827
- .topbar .ctl-grow { flex: 1; min-width: 0; }
1828
-
1829
1825
  @keyframes listening-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
1830
1826
 
1831
1827
  /* table ---------------------------------------------------------------- */
@@ -2094,23 +2090,6 @@ input:active, textarea:active, select:active { transform: none; }
2094
2090
  border-color: var(--bad);
2095
2091
  }
2096
2092
 
2097
- /* Three fields on one line, and their inputs on one line too.
2098
-
2099
- `Field` puts the description *above* the control, which is the house rule and
2100
- right -- but only `Arguments` has one here, so as a flex row the other two
2101
- inputs floated a description's height above it and the row read as broken.
2102
- Aligned to the end instead: the labels sit where their text needs them and
2103
- the three boxes share a baseline, which is the edge the eye actually follows.
2104
-
2105
- A grid rather than flex, so `Arguments` gets the room it needs by declaration
2106
- instead of by an inline pixel width on each of its neighbours. */
2107
- .mcp-local .field-row {
2108
- display: grid;
2109
- grid-template-columns: 1fr 1fr 2fr;
2110
- align-items: end;
2111
- gap: var(--space-3);
2112
- }
2113
-
2114
2093
  /* How an applet's polling is going, said the same way on every tile. Muted
2115
2094
  when it is going fine -- this is a fact you glance at, not one you are being
2116
2095
  told. */
@@ -3293,11 +3272,6 @@ input[type='radio']:active:not(:disabled) {
3293
3272
  width: min(760px, 100%);
3294
3273
  }
3295
3274
 
3296
- /* Settings is wider than the others: the rail carries group headings with a
3297
- hint each and indented tabs under them, and a pane beside it that draws
3298
- cards with a control on the right -- 760 gave one or the other room. */
3299
- .modal.modal-settings { width: min(880px, 100%); }
3300
-
3301
3275
  .modal {
3302
3276
  /* The window, less the backdrop's padding at each end -- `--space-15` is 60px
3303
3277
  and there are two of them, above and below.
@@ -3732,25 +3706,12 @@ input[type='range'].slider:disabled::-moz-range-thumb { opacity: 0; }
3732
3706
  /* A run of checkboxes is one choice, not several settings that happen to be
3733
3707
  adjacent. Tight enough that the group reads as a block -- at the spacing a
3734
3708
  form field wants, four tools look like four unrelated questions. */
3735
- /* The same choice, laid out as tiles instead of a column.
3736
-
3737
- Four short names down the full width of a card is four wide bands for four
3738
- words -- the row is sized by the card, not by anything in it, so `Read` gets
3739
- the same 1000px as a sentence would. As tiles they are sized by their
3740
- content and the group reads as one set of four rather than a stack of four
3741
- settings.
3742
-
3743
- `auto-fit` with a floor rather than a fixed four: the pane is a modal that
3744
- narrows with the window, and four columns of 40px is worse than two of 160.
3745
- The floor is the width at which a two-word name still fits on one line. */
3746
- .choice-tiles {
3747
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
3748
- gap: var(--space-2);
3749
- }
3750
-
3751
3709
  /* Room for the tick, which is absolutely positioned at the top right. In a
3752
- full-width row the text never reached it; in a tile it would run underneath. */
3753
- .choice-tiles .choice-body { padding-right: var(--space-6); }
3710
+ full-width row the text never reaches it; in a tile it would run underneath.
3711
+ `tile` is a prop on the component now: this was keyed on a `.choice-tiles`
3712
+ container that no component renders, so the class only ever existed in a
3713
+ consumer's markup and the package was styling itself through it. */
3714
+ .choice-tile .choice-body { padding-right: var(--space-6); }
3754
3715
 
3755
3716
  /* The floor is 220px and not 150px because of what four items do at the widths
3756
3717
  in between. The settings pane gives this group 514px: at a 150px floor that
package/dist/valet.css CHANGED
@@ -1826,10 +1826,6 @@ input:active, textarea:active, select:active { transform: none; }
1826
1826
  40% { opacity: 1; transform: translateY(-3px); }
1827
1827
  }
1828
1828
 
1829
- /* The top bar carries the title, the views and the way into settings. Nothing
1830
- that belongs to a conversation lives here any more, so it can breathe. */
1831
- .topbar .ctl-grow { flex: 1; min-width: 0; }
1832
-
1833
1829
  @keyframes listening-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
1834
1830
 
1835
1831
  /* table ---------------------------------------------------------------- */
@@ -2098,23 +2094,6 @@ input:active, textarea:active, select:active { transform: none; }
2098
2094
  border-color: var(--bad);
2099
2095
  }
2100
2096
 
2101
- /* Three fields on one line, and their inputs on one line too.
2102
-
2103
- `Field` puts the description *above* the control, which is the house rule and
2104
- right -- but only `Arguments` has one here, so as a flex row the other two
2105
- inputs floated a description's height above it and the row read as broken.
2106
- Aligned to the end instead: the labels sit where their text needs them and
2107
- the three boxes share a baseline, which is the edge the eye actually follows.
2108
-
2109
- A grid rather than flex, so `Arguments` gets the room it needs by declaration
2110
- instead of by an inline pixel width on each of its neighbours. */
2111
- .mcp-local .field-row {
2112
- display: grid;
2113
- grid-template-columns: 1fr 1fr 2fr;
2114
- align-items: end;
2115
- gap: var(--space-3);
2116
- }
2117
-
2118
2097
  /* How an applet's polling is going, said the same way on every tile. Muted
2119
2098
  when it is going fine -- this is a fact you glance at, not one you are being
2120
2099
  told. */
@@ -3297,11 +3276,6 @@ input[type='radio']:active:not(:disabled) {
3297
3276
  width: min(760px, 100%);
3298
3277
  }
3299
3278
 
3300
- /* Settings is wider than the others: the rail carries group headings with a
3301
- hint each and indented tabs under them, and a pane beside it that draws
3302
- cards with a control on the right -- 760 gave one or the other room. */
3303
- .modal.modal-settings { width: min(880px, 100%); }
3304
-
3305
3279
  .modal {
3306
3280
  /* The window, less the backdrop's padding at each end -- `--space-15` is 60px
3307
3281
  and there are two of them, above and below.
@@ -3736,25 +3710,12 @@ input[type='range'].slider:disabled::-moz-range-thumb { opacity: 0; }
3736
3710
  /* A run of checkboxes is one choice, not several settings that happen to be
3737
3711
  adjacent. Tight enough that the group reads as a block -- at the spacing a
3738
3712
  form field wants, four tools look like four unrelated questions. */
3739
- /* The same choice, laid out as tiles instead of a column.
3740
-
3741
- Four short names down the full width of a card is four wide bands for four
3742
- words -- the row is sized by the card, not by anything in it, so `Read` gets
3743
- the same 1000px as a sentence would. As tiles they are sized by their
3744
- content and the group reads as one set of four rather than a stack of four
3745
- settings.
3746
-
3747
- `auto-fit` with a floor rather than a fixed four: the pane is a modal that
3748
- narrows with the window, and four columns of 40px is worse than two of 160.
3749
- The floor is the width at which a two-word name still fits on one line. */
3750
- .choice-tiles {
3751
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
3752
- gap: var(--space-2);
3753
- }
3754
-
3755
3713
  /* Room for the tick, which is absolutely positioned at the top right. In a
3756
- full-width row the text never reached it; in a tile it would run underneath. */
3757
- .choice-tiles .choice-body { padding-right: var(--space-6); }
3714
+ full-width row the text never reaches it; in a tile it would run underneath.
3715
+ `tile` is a prop on the component now: this was keyed on a `.choice-tiles`
3716
+ container that no component renders, so the class only ever existed in a
3717
+ consumer's markup and the package was styling itself through it. */
3718
+ .choice-tile .choice-body { padding-right: var(--space-6); }
3758
3719
 
3759
3720
  /* The floor is 220px and not 150px because of what four items do at the widths
3760
3721
  in between. The settings pane gives this group 514px: at a 150px floor that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/design",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "wtfalch's design system: themeable components on a fixed token vocabulary.",
5
5
  "keywords": [
6
6
  "design-system",