jbx 2.13.0 → 2.15.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/README.md CHANGED
@@ -4,9 +4,11 @@ The little component toolkit behind the tools on [javier.xyz](https://javier.xyz
4
4
  components with a class each, one stylesheet, no runtime dependencies.
5
5
 
6
6
  ```
7
- npm i jbx
7
+ pnpm add jbx
8
8
  ```
9
9
 
10
+ React is a peer dependency (`17`, `18` or `19`), so it uses whichever copy you already have.
11
+
10
12
  ## Styles
11
13
 
12
14
  Either import the stylesheet and set your own accent color:
@@ -27,7 +29,14 @@ Or let the `JBX` component do both:
27
29
  <JBX accent="#f1c40f" />
28
30
  ```
29
31
 
30
- `JBX` has no hooks and no dependencies, so it renders inside a React server component too.
32
+ `JBX` has no hooks and no dependencies, so it renders inside a React server component too. So does
33
+ every component except `Input`, which holds the state behind `onValueChange` and is marked
34
+ `'use client'`.
35
+
36
+ Two more variables are worth knowing about. `--control-height` is how tall a `Button`, `Input` or
37
+ `Range` stands on its own; `--control-height-compact` is what one shrinks to inside a `Tabs` row,
38
+ where it matches the line box of the text beside it so the row is no taller than a row of plain
39
+ tabs.
31
40
 
32
41
  ## Use
33
42
 
@@ -46,6 +55,32 @@ function App() {
46
55
  }
47
56
  ```
48
57
 
58
+ ## Components
59
+
60
+ Layout: `Container`, `Inline`, `Stack`, `Box`, `Space`.
61
+
62
+ Type: `MainHeader`, `HeaderH1`--`HeaderH4`, `Text`, `SmallText`, `A`, `Ul`, `Li`, `Bullet`, `HR`.
63
+
64
+ Controls: `Button`, `Input`, `Range`, `Checkbox`, `Tabs` with `Tab`, `Dropzone`.
65
+
66
+ Code: `CodeSnippet`, `CodeTextarea`.
67
+
68
+ Plus `JBX` for the stylesheet, `MoreExperiments` for the footer that links the other tools, and
69
+ `Component` and `space` for building your own.
70
+
71
+ ## Number inputs
72
+
73
+ `Input` is a plain controlled input until you hand it `onValueChange`, which switches it to numbers
74
+ and takes over the awkward part: it holds what was typed and only calls you back once that parses
75
+ and lands inside `min`/`max`. A half typed value never reaches your state, so nothing downstream
76
+ jumps around mid-keystroke, and blurring a field you left half typed restores the live value.
77
+
78
+ ```jsx
79
+ <Input value={seconds} onValueChange={secondsSet} min={0.2} max={60} step="0.5" />
80
+ ```
81
+
82
+ `value` and `onChange` on their own behave exactly as they always did.
83
+
49
84
  ## Spacing
50
85
 
51
86
  Everything is measured in units of `--size` (16px, 14px on smaller screens). `<Space h={2} />`,
@@ -69,9 +104,11 @@ const Sprite = Component(
69
104
  ## Develop
70
105
 
71
106
  ```
72
- npm run dev # rebuild on change
73
- npm run typecheck
74
- npm test # renders every export, fails on any React warning
107
+ pnpm dev # serve the interactive preview at localhost:3008/jbx
108
+ pnpm dev:lib # rebuild the published library on change
109
+ pnpm preview:build # make a production build of the preview
110
+ pnpm typecheck
111
+ pnpm test # renders every export, fails on any React warning
75
112
  ```
76
113
 
77
114
  ## Publish
@@ -80,11 +117,11 @@ New versions are published to npm automatically when they reach `main`. A push w
80
117
  version is already on npm succeeds without publishing again.
81
118
 
82
119
  1. Add the release notes to `CHANGELOG.md`.
83
- 2. Run `npm version minor --no-git-tag-version` to update `package.json`.
84
- 3. Run `npm test`.
120
+ 2. Run `pnpm version minor --no-git-tag-version` to update `package.json`.
121
+ 3. Run `pnpm test`.
85
122
  4. Commit the changes and push them to `main`.
86
123
  5. Confirm the **Publish package** workflow succeeds, then check the version with
87
- `npm view jbx version`.
124
+ `pnpm view jbx version`.
88
125
 
89
126
  Publishing uses npm trusted publishing through GitHub Actions. It does not require an
90
127
  npm token in the repository.
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> & {
3
+ value?: string | number | readonly string[];
4
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
5
+ /**
6
+ * Opt in to number handling. `value` is a number, and this is called with a
7
+ * number -- but only once what was typed parses and lands inside `min`/`max`,
8
+ * so a half typed value stays on screen without ever reaching the caller.
9
+ * Implies `type="number"`.
10
+ */
11
+ onValueChange?: (value: number) => void;
12
+ };
13
+ /**
14
+ * A text input, and -- with `onValueChange` -- a number input that only commits
15
+ * what parses:
16
+ *
17
+ * <Input value={seconds} onValueChange={secondsSet} min={0.2} max={60} />
18
+ *
19
+ * Without `onValueChange` this is a plain controlled input and the caller owns
20
+ * `value` and `onChange` as usual.
21
+ */
22
+ export declare function Input({ value, onChange, onValueChange, onBlur, type, min, max, ...props }: InputProps): React.JSX.Element;
23
+ export {};
24
+ //# sourceMappingURL=Input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,KAAK,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC1F,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAMF;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,MAAM,EACN,IAAI,EACJ,GAAG,EACH,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,qBA0DZ"}
@@ -0,0 +1,54 @@
1
+ 'use client';
2
+ import React, { useState } from 'react';
3
+ import { Component } from '../primitives.js';
4
+ const InputBase = Component(`jbx-input`, {}, { element: 'input' });
5
+ function toNumber(value) {
6
+ return typeof value === 'number' ? value : Number(value);
7
+ }
8
+ /**
9
+ * A text input, and -- with `onValueChange` -- a number input that only commits
10
+ * what parses:
11
+ *
12
+ * <Input value={seconds} onValueChange={secondsSet} min={0.2} max={60} />
13
+ *
14
+ * Without `onValueChange` this is a plain controlled input and the caller owns
15
+ * `value` and `onChange` as usual.
16
+ */
17
+ export function Input({ value, onChange, onValueChange, onBlur, type, min, max, ...props }) {
18
+ // Hooks run either way; only the returned tree branches.
19
+ const [draft, draftSet] = useState(() => String(value ?? ''));
20
+ const [lastValue, lastValueSet] = useState(value);
21
+ if (!onValueChange) {
22
+ return (React.createElement(InputBase, { ...props, type: type, min: min, max: max, value: value, onChange: onChange, onBlur: onBlur }));
23
+ }
24
+ if (value !== lastValue) {
25
+ lastValueSet(value);
26
+ // `2.50` parses to the value we already hold -- adopting `String(value)`
27
+ // here would eat the trailing zero out from under the caret mid-typing.
28
+ if (Number(draft) !== toNumber(value))
29
+ draftSet(String(value ?? ''));
30
+ }
31
+ function draftChange(event) {
32
+ const next = event.target.value;
33
+ draftSet(next);
34
+ onChange?.(event);
35
+ const parsed = Number(next);
36
+ if (next.trim() === '' || !Number.isFinite(parsed))
37
+ return;
38
+ if (min !== undefined && parsed < toNumber(min))
39
+ return;
40
+ if (max !== undefined && parsed > toNumber(max))
41
+ return;
42
+ onValueChange(parsed);
43
+ }
44
+ // Leaving a half typed value behind is how a field ends up showing something
45
+ // the rest of the page never agreed to. Snap back to the live value on the
46
+ // way out.
47
+ function draftBlur(event) {
48
+ if (Number(draft) !== toNumber(value))
49
+ draftSet(String(value ?? ''));
50
+ onBlur?.(event);
51
+ }
52
+ return (React.createElement(InputBase, { ...props, type: type ?? 'number', min: min, max: max, value: draft, onChange: draftChange, onBlur: draftBlur }));
53
+ }
54
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE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AAM,CAAC,KAAK,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;QAElB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO;QAC3D,IAAI,GAAG,KAAK,SAAS,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO;QACxD,IAAI,GAAG,KAAK,SAAS,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO;QAExD,aAAc,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,6EAA6E;IAC7E,2EAA2E;IAC3E,WAAW;IACX,SAAS,SAAS,CAAC,KAAyC;QAC1D,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC;YAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QACrE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,OACJ,KAAK,EACT,IAAI,EAAE,IAAI,IAAI,QAAQ,EACtB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,SAAS,GACjB,CACH,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 17px;\n --radius-small: 2px;\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fcfcfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings: 'wdth' 107, 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: calc(var(--size) * 2.5);\n transition: top 0.1s, left 0.1s, box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '\u2197';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition: top 0.3s, right 0.3s, color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #ecf0f1;\n z-index: -1;\n transition: transform 0.2s, opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: 16px;\n}\na.jbx-a::before {\n border-radius: 8px;\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: calc(var(--size) * 2.5);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #bdc3c780;\n height: var(--size);\n border-radius: 0;\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: 0;\n border: none;\n border-top: 2px solid #ecf0f1;\n}\n";
1
+ export declare const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n corner-shape: squircle;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 15px;\n --font-family-monospace:\n ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;\n --radius-small: 1px;\n --radius-big: 15px;\n /* Every interactive control is this tall, so a button, an input and a range\n standing next to each other line up. */\n --control-height: calc(var(--size) * 2.5);\n /* What a control shrinks to inside a tab row, where it has to match the line\n box of the tab's text (`.jbx-text` is `line-height: 1.4`) rather than stand\n on its own -- a row holding one is then exactly as tall as one that doesn't. */\n --control-height-compact: calc(var(--font-size) * 1.4);\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea,\nbutton {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fdfdfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings:\n 'wdth' 107,\n 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n border-radius: var(--radius-small);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--radius-small);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--radius-big);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: var(--control-height);\n transition:\n top 0.1s,\n left 0.1s,\n box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n.jbx-button:disabled {\n cursor: default;\n color: #999;\n background-color: #f4f4f4;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n.jbx-button:disabled:active {\n top: 0;\n left: 0;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '\u2197';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition:\n top 0.3s,\n right 0.3s,\n color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #eee;\n z-index: -1;\n transition:\n transform 0.2s,\n opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: var(--radius-small);\n}\na.jbx-a::before {\n border-radius: var(--radius-small);\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-tabs--tab {\n border-radius: var(--radius-small);\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: var(--control-height);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow:\n inset rgba(0, 0, 0, 0.04) 3px 3px 0,\n inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n/* Chrome hides the stepper until hover and takes its width out of the content\n box, so the value slides sideways as the pointer enters. Keep it painted. */\n.jbx-input[type='number']::-webkit-inner-spin-button,\n.jbx-input[type='number']::-webkit-outer-spin-button {\n opacity: 1;\n}\n\n/* A control inside a tab row sizes to the row, not to itself: it matches the\n line box of the text beside it, so a row holding a field is exactly as tall\n as one that only holds tabs. `flex: none` because `.jbx-input` stretches,\n which is right for a field that owns its row and wrong for one sitting\n between two bits of text. */\n.jbx-tabs .jbx-input,\n.jbx-tabs .jbx-button {\n flex: none;\n height: var(--control-height-compact);\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n border-radius: var(--radius-big);\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #c0c0c080;\n height: var(--size);\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-track {\n background-color: #c0c0c080;\n border-radius: var(--radius-small);\n height: var(--size);\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: var(--radius-small);\n border: none;\n border-top: 2px solid #eee;\n}\n";
2
2
  //# sourceMappingURL=css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/generated/css.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,GAAG,unNAAknN,CAAC"}
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/generated/css.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,GAAG,ukRAAkkR,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/build-css.mjs from src/style.css. Do not edit.
2
- export const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 17px;\n --radius-small: 2px;\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fcfcfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings: 'wdth' 107, 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: calc(var(--size) * 2.5);\n transition: top 0.1s, left 0.1s, box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '↗';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition: top 0.3s, right 0.3s, color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #ecf0f1;\n z-index: -1;\n transition: transform 0.2s, opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: 16px;\n}\na.jbx-a::before {\n border-radius: 8px;\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: calc(var(--size) * 2.5);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #bdc3c780;\n height: var(--size);\n border-radius: 0;\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: 0;\n border: none;\n border-top: 2px solid #ecf0f1;\n}\n";
2
+ export const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n corner-shape: squircle;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 15px;\n --font-family-monospace:\n ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;\n --radius-small: 1px;\n --radius-big: 15px;\n /* Every interactive control is this tall, so a button, an input and a range\n standing next to each other line up. */\n --control-height: calc(var(--size) * 2.5);\n /* What a control shrinks to inside a tab row, where it has to match the line\n box of the tab's text (`.jbx-text` is `line-height: 1.4`) rather than stand\n on its own -- a row holding one is then exactly as tall as one that doesn't. */\n --control-height-compact: calc(var(--font-size) * 1.4);\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea,\nbutton {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fdfdfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings:\n 'wdth' 107,\n 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n border-radius: var(--radius-small);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--radius-small);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--radius-big);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: var(--control-height);\n transition:\n top 0.1s,\n left 0.1s,\n box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n.jbx-button:disabled {\n cursor: default;\n color: #999;\n background-color: #f4f4f4;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n.jbx-button:disabled:active {\n top: 0;\n left: 0;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '↗';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition:\n top 0.3s,\n right 0.3s,\n color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #eee;\n z-index: -1;\n transition:\n transform 0.2s,\n opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: var(--radius-small);\n}\na.jbx-a::before {\n border-radius: var(--radius-small);\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-tabs--tab {\n border-radius: var(--radius-small);\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: var(--control-height);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow:\n inset rgba(0, 0, 0, 0.04) 3px 3px 0,\n inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n/* Chrome hides the stepper until hover and takes its width out of the content\n box, so the value slides sideways as the pointer enters. Keep it painted. */\n.jbx-input[type='number']::-webkit-inner-spin-button,\n.jbx-input[type='number']::-webkit-outer-spin-button {\n opacity: 1;\n}\n\n/* A control inside a tab row sizes to the row, not to itself: it matches the\n line box of the text beside it, so a row holding a field is exactly as tall\n as one that only holds tabs. `flex: none` because `.jbx-input` stretches,\n which is right for a field that owns its row and wrong for one sitting\n between two bits of text. */\n.jbx-tabs .jbx-input,\n.jbx-tabs .jbx-button {\n flex: none;\n height: var(--control-height-compact);\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n border-radius: var(--radius-big);\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #c0c0c080;\n height: var(--size);\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-track {\n background-color: #c0c0c080;\n border-radius: var(--radius-small);\n height: var(--size);\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: var(--radius-small);\n border: none;\n border-top: 2px solid #eee;\n}\n";
3
3
  //# sourceMappingURL=css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","sourceRoot":"","sources":["../../src/generated/css.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,GAAG,GAAG,+mNAA+mN,CAAC"}
1
+ {"version":3,"file":"css.js","sourceRoot":"","sources":["../../src/generated/css.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,GAAG,GAAG,+jRAA+jR,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export * from './primitives.js';
2
2
  export { space } from './spacing.js';
3
3
  export { JBX } from './JBX.js';
4
4
  export { Box } from './components/Layout.js';
5
+ export { Input } from './components/Input.js';
5
6
  export { MoreExperiments } from './components/MoreExperiments.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
package/dist/index.js CHANGED
@@ -2,5 +2,6 @@ export * from './primitives.js';
2
2
  export { space } from './spacing.js';
3
3
  export { JBX } from './JBX.js';
4
4
  export { Box } from './components/Layout.js';
5
+ export { Input } from './components/Input.js';
5
6
  export { MoreExperiments } from './components/MoreExperiments.js';
6
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
package/dist/main.css CHANGED
@@ -5,13 +5,24 @@ html {
5
5
  *:before,
6
6
  *:after {
7
7
  box-sizing: inherit;
8
+ corner-shape: squircle;
8
9
  }
9
10
 
10
11
  :root {
11
12
  --size: 16px;
12
13
  --font-size: 16px;
13
- --font-size-small: 17px;
14
- --radius-small: 2px;
14
+ --font-size-small: 15px;
15
+ --font-family-monospace:
16
+ ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
17
+ --radius-small: 1px;
18
+ --radius-big: 15px;
19
+ /* Every interactive control is this tall, so a button, an input and a range
20
+ standing next to each other line up. */
21
+ --control-height: calc(var(--size) * 2.5);
22
+ /* What a control shrinks to inside a tab row, where it has to match the line
23
+ box of the tab's text (`.jbx-text` is `line-height: 1.4`) rather than stand
24
+ on its own -- a row holding one is then exactly as tall as one that doesn't. */
25
+ --control-height-compact: calc(var(--font-size) * 1.4);
15
26
  }
16
27
 
17
28
  @media screen and (max-width: 1200px) {
@@ -41,12 +52,13 @@ body {
41
52
 
42
53
  body,
43
54
  input,
44
- textarea {
55
+ textarea,
56
+ button {
45
57
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
46
58
  }
47
59
 
48
60
  body {
49
- background: #fcfcfd;
61
+ background: #fdfdfd;
50
62
  color: #000;
51
63
  }
52
64
 
@@ -61,7 +73,9 @@ h4 {
61
73
  color: var(--base-font-color-bright);
62
74
  }
63
75
  h1 {
64
- font-variation-settings: 'wdth' 107, 'wght' 650;
76
+ font-variation-settings:
77
+ 'wdth' 107,
78
+ 'wght' 650;
65
79
  font-weight: 650;
66
80
  }
67
81
 
@@ -73,6 +87,7 @@ b {
73
87
  .jbx-main-h1 {
74
88
  display: inline-block;
75
89
  background-color: var(--accent-color);
90
+ border-radius: var(--radius-small);
76
91
  font-size: calc(var(--font-size) * 2);
77
92
  padding: 8px;
78
93
  }
@@ -102,15 +117,15 @@ body,
102
117
  }
103
118
 
104
119
  .jbx-code-snippet {
105
- border-radius: var(--size);
106
- font-family: monaco, monospace;
120
+ border-radius: var(--radius-small);
121
+ font-family: var(--font-family-monospace);
107
122
  border: none;
108
123
  width: 100%;
109
124
  font-size: calc(var(--size) - 3px);
110
125
  line-height: 1.33;
111
126
  padding: var(--size) calc(var(--size) * 1.2);
112
- background: #ecf0f1;
113
- color: #34495e;
127
+ background: #eee;
128
+ color: #444;
114
129
  resize: none;
115
130
  }
116
131
  .jbx-code-snippet:focus {
@@ -118,15 +133,15 @@ body,
118
133
  }
119
134
 
120
135
  .jbx-code-area {
121
- border-radius: var(--size);
122
- font-family: monaco, monospace;
136
+ border-radius: var(--radius-big);
137
+ font-family: var(--font-family-monospace);
123
138
  border: none;
124
139
  width: 100%;
125
140
  font-size: calc(var(--size) - 3px);
126
141
  line-height: 1.33;
127
142
  padding: var(--size) calc(var(--size) * 1.2);
128
- background: #ecf0f1;
129
- color: #34495e;
143
+ background: #eee;
144
+ color: #444;
130
145
  resize: none;
131
146
  min-height: 120px;
132
147
  }
@@ -145,14 +160,28 @@ body,
145
160
  box-shadow: 3px 3px 0 #ccc;
146
161
  padding: 0 calc(var(--size) / 2);
147
162
  border: none;
148
- height: calc(var(--size) * 2.5);
149
- transition: top 0.1s, left 0.1s, box-shadow 0.05s;
163
+ height: var(--control-height);
164
+ transition:
165
+ top 0.1s,
166
+ left 0.1s,
167
+ box-shadow 0.05s;
150
168
  }
151
169
  .jbx-button:active {
152
170
  top: 1px;
153
171
  left: 1px;
154
172
  box-shadow: 1px 1px 0 #ccc;
155
173
  }
174
+ .jbx-button:disabled {
175
+ cursor: default;
176
+ color: #999;
177
+ background-color: #f4f4f4;
178
+ box-shadow: 1px 1px 0 #e0e0e0;
179
+ }
180
+ .jbx-button:disabled:active {
181
+ top: 0;
182
+ left: 0;
183
+ box-shadow: 1px 1px 0 #e0e0e0;
184
+ }
156
185
 
157
186
  /* LINKS */
158
187
  .jbx-a {
@@ -169,7 +198,10 @@ body,
169
198
  position: relative;
170
199
  top: -1px;
171
200
  right: -1px;
172
- transition: top 0.3s, right 0.3s, color 0.3s;
201
+ transition:
202
+ top 0.3s,
203
+ right 0.3s,
204
+ color 0.3s;
173
205
  }
174
206
  .jbx-a:hover,
175
207
  .jbx-block-link:hover .jbx-a {
@@ -195,9 +227,11 @@ a.jbx-a::before,
195
227
  content: '';
196
228
  display: block;
197
229
  position: absolute;
198
- background-color: #ecf0f1;
230
+ background-color: #eee;
199
231
  z-index: -1;
200
- transition: transform 0.2s, opacity 0.2s;
232
+ transition:
233
+ transform 0.2s,
234
+ opacity 0.2s;
201
235
  transform: scale(0.98) translatey(4px);
202
236
  opacity: 0;
203
237
  top: -4px;
@@ -206,10 +240,10 @@ a.jbx-a::before,
206
240
  bottom: -4px;
207
241
  }
208
242
  .jbx-block-link::before {
209
- border-radius: 16px;
243
+ border-radius: var(--radius-small);
210
244
  }
211
245
  a.jbx-a::before {
212
- border-radius: 8px;
246
+ border-radius: var(--radius-small);
213
247
  }
214
248
  a.jbx-a:hover::before,
215
249
  .jbx-block-link:hover::before {
@@ -255,6 +289,10 @@ a.jbx-a:hover::before,
255
289
  line-height: 1.4;
256
290
  }
257
291
 
292
+ .jbx-tabs--tab {
293
+ border-radius: var(--radius-small);
294
+ }
295
+
258
296
  .jbx-input {
259
297
  color: #777;
260
298
  -webkit-text-fill-color: #777;
@@ -264,10 +302,30 @@ a.jbx-a:hover::before,
264
302
  appearance: none;
265
303
  border: none;
266
304
  border-radius: var(--radius-small);
267
- height: calc(var(--size) * 2.5);
305
+ height: var(--control-height);
268
306
  background-color: #eee;
269
307
  padding: 0 calc(var(--size) * 0.5);
270
- box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
308
+ box-shadow:
309
+ inset rgba(0, 0, 0, 0.04) 3px 3px 0,
310
+ inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
311
+ }
312
+
313
+ /* Chrome hides the stepper until hover and takes its width out of the content
314
+ box, so the value slides sideways as the pointer enters. Keep it painted. */
315
+ .jbx-input[type='number']::-webkit-inner-spin-button,
316
+ .jbx-input[type='number']::-webkit-outer-spin-button {
317
+ opacity: 1;
318
+ }
319
+
320
+ /* A control inside a tab row sizes to the row, not to itself: it matches the
321
+ line box of the text beside it, so a row holding a field is exactly as tall
322
+ as one that only holds tabs. `flex: none` because `.jbx-input` stretches,
323
+ which is right for a field that owns its row and wrong for one sitting
324
+ between two bits of text. */
325
+ .jbx-tabs .jbx-input,
326
+ .jbx-tabs .jbx-button {
327
+ flex: none;
328
+ height: var(--control-height-compact);
271
329
  }
272
330
 
273
331
  .jbx-dropzone {
@@ -280,6 +338,7 @@ a.jbx-a:hover::before,
280
338
  justify-content: center;
281
339
  flex-direction: column;
282
340
  border: 2px dashed #000;
341
+ border-radius: var(--radius-big);
283
342
  color: #000;
284
343
  padding: 0;
285
344
  cursor: pointer;
@@ -305,9 +364,8 @@ a.jbx-a:hover::before,
305
364
  flex: 1;
306
365
  width: 100%;
307
366
  appearance: none;
308
- background-color: #bdc3c780;
367
+ background-color: #c0c0c080;
309
368
  height: var(--size);
310
- border-radius: 0;
311
369
  border-radius: var(--radius-small);
312
370
  }
313
371
 
@@ -315,7 +373,6 @@ a.jbx-a:hover::before,
315
373
  -webkit-appearance: none;
316
374
  appearance: none;
317
375
  box-shadow: none;
318
- border-radius: 0;
319
376
  height: calc(var(--size) * 2);
320
377
  width: var(--size);
321
378
  background-color: #000;
@@ -325,7 +382,6 @@ a.jbx-a:hover::before,
325
382
  .jbx-range::-moz-range-thumb {
326
383
  appearance: none;
327
384
  box-shadow: none;
328
- border-radius: 0;
329
385
  height: calc(var(--size) * 2);
330
386
  width: var(--size);
331
387
  background-color: #000;
@@ -334,6 +390,12 @@ a.jbx-a:hover::before,
334
390
  }
335
391
  .jbx-range::-webkit-slider-runnable-track {
336
392
  appearance: none;
393
+ border-radius: var(--radius-small);
394
+ }
395
+ .jbx-range::-moz-range-track {
396
+ background-color: #c0c0c080;
397
+ border-radius: var(--radius-small);
398
+ height: var(--size);
337
399
  }
338
400
  .jbx-range:focus {
339
401
  outline: none;
@@ -363,7 +425,7 @@ a.jbx-a:hover::before,
363
425
  .jbx-hr {
364
426
  margin: calc(var(--size) * 2) auto;
365
427
  width: 38.2%;
366
- border-radius: 0;
428
+ border-radius: var(--radius-small);
367
429
  border: none;
368
- border-top: 2px solid #ecf0f1;
430
+ border-top: 2px solid #eee;
369
431
  }
@@ -33,10 +33,6 @@ export declare const Button: (props: React.ButtonHTMLAttributes<HTMLButtonElemen
33
33
  children?: ReactNode;
34
34
  style?: CSSProperties;
35
35
  }) => React.JSX.Element;
36
- export declare const Input: (props: React.InputHTMLAttributes<HTMLInputElement> & {
37
- children?: ReactNode;
38
- style?: CSSProperties;
39
- }) => React.JSX.Element;
40
36
  export declare const Range: (props: React.InputHTMLAttributes<HTMLInputElement> & {
41
37
  children?: ReactNode;
42
38
  style?: CSSProperties;
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../src/primitives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAA0D,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpG,KAAK,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAErD,KAAK,eAAe,GAAG;IACrB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI,aAAa,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,CAAC;AAEpE,wBAAgB,SAAS,CAAC,CAAC,EACzB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,WAAW,CAAC,CAAC,CAAM,EAC7B,MAAM,GAAE,eAAoB,GAC3B,CAAC,KAAK,EAAE,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAA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O,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,qBAuCA;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,qBAMlD"}
@@ -20,7 +20,6 @@ export const Container = Component(`jbx-container`);
20
20
  export const Text = Component(`jbx-text`);
21
21
  export const SmallText = Component(`jbx-small-text`);
22
22
  export const Button = Component(`jbx-button`, {}, { element: 'button' });
23
- export const Input = Component(`jbx-input`, {}, { element: 'input' });
24
23
  export const Range = Component(`jbx-range`, {}, {
25
24
  element: 'input',
26
25
  props: {
@@ -57,9 +56,10 @@ export const Li = Component(`jbx-li`, {
57
56
  }, { element: 'li' });
58
57
  export const Tabs = Component(`jbx-tabs`);
59
58
  export const Tab = Component(`jbx-tabs--tab`, ({ info, active }) => ({
59
+ borderRadius: BASE_RADIUS,
60
60
  userSelect: 'none',
61
61
  cursor: 'pointer',
62
- backgroundColor: active ? '#000' : info ? '#fff' : '#ecf0f1',
62
+ backgroundColor: active ? '#000' : info ? '#fff' : '#eee',
63
63
  color: active ? '#fff' : '#000',
64
64
  padding: space(0.5),
65
65
  paddingLeft: info ? 0 : space(0.5)
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../src/primitives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AAkBpG,MAAM,UAAU,SAAS,CACvB,SAAiB,EACjB,WAA2B,EAAE,EAC7B,SAA0B,EAAE;IAE5B,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAElE,OAAO,SAAS,aAAa,CAAC,EAC5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D,oBAAC,cAAc,IAAC,SAAS,EAAE,OAAO;YAChC,6BACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EACjC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE;gBAE9E,8BAAM,CAAC,EAAC,iBAAiB,GAAG,CACxB,CACS;QACjB,oBAAC,KAAK,IAAC,CAAC,EAAE,GAAG,GAAI;QACjB,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,IAAG,KAAK,CAAQ,CAC5C,CACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAqB;IACjD,OAAO,CACL,6BAAK,SAAS,EAAC,sBAAsB;QACnC,6BAAK,SAAS,EAAC,YAAY,IAAE,KAAK,CAAO,CACrC,CACP,CAAC;AACJ,CAAC"}
package/dist/spacing.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { CSSProperties } from 'react';
5
5
  * the stylesheet does.
6
6
  */
7
7
  export declare function space(n: number): string;
8
- export declare const BASE_RADIUS = "calc(var(--size) / 3)";
8
+ export declare const BASE_RADIUS = "var(--radius-small)";
9
9
  export type SpacingProps = {
10
10
  /** Vertical margin, in spacing units. */
11
11
  v?: number;
@@ -17,6 +17,6 @@ export type SpacingProps = {
17
17
  padding?: number | number[];
18
18
  };
19
19
  /** Keys `spacingPropsToStyle` consumes, so they can be kept off the DOM. */
20
- export declare const SPACING_PROPS: readonly ["v", "h", "gap", "padding"];
20
+ export declare const SPACING_PROPS: readonly ['v', 'h', 'gap', 'padding'];
21
21
  export declare function spacingPropsToStyle({ v, h, gap, padding }: SpacingProps): CSSProperties;
22
22
  //# sourceMappingURL=spacing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../src/spacing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED,eAAO,MAAM,WAAW,0BAA0B,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG;IACzB,yCAAyC;IACzC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,uCAAwC,CAAC;AAEnE,wBAAgB,mBAAmB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,aAAa,CAevF"}
1
+ {"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../src/spacing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED,eAAO,MAAM,WAAW,wBAAwB,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG;IACzB,yCAAyC;IACzC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,YAAI,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,CAAU,CAAC;AAEnE,wBAAgB,mBAAmB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,aAAa,CAevF"}
package/dist/spacing.js CHANGED
@@ -6,7 +6,7 @@
6
6
  export function space(n) {
7
7
  return `calc(var(--size) * ${n})`;
8
8
  }
9
- export const BASE_RADIUS = `calc(var(--size) / 3)`;
9
+ export const BASE_RADIUS = `var(--radius-small)`;
10
10
  /** Keys `spacingPropsToStyle` consumes, so they can be kept off the DOM. */
11
11
  export const SPACING_PROPS = ['v', 'h', 'gap', 'padding'];
12
12
  export function spacingPropsToStyle({ v, h, gap, padding }) {
@@ -1 +1 @@
1
- {"version":3,"file":"spacing.js","sourceRoot":"","sources":["../src/spacing.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,CAAS;IAC7B,OAAO,sBAAsB,CAAC,GAAG,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAanD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,CAAU,CAAC;AAEnE,MAAM,UAAU,mBAAmB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAgB;IACtE,OAAO;QACL,UAAU,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAClD,WAAW,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAA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AE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACjD,YAAY,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,GAAG,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QAC/C,OAAO,EACL,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,OAAO,CAAC;iBACN,IAAI,EAAE;iBACN,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBAC5B,IAAI,CAAC,GAAG,CAAC;KACnB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,24 @@
1
1
  {
2
2
  "name": "jbx",
3
- "version": "2.13.0",
3
+ "version": "2.15.0",
4
+ "description": "The little component toolkit behind the tools on javier.xyz. Plain components with a class each, one stylesheet, no runtime dependencies.",
5
+ "keywords": [
6
+ "react",
7
+ "components",
8
+ "ui",
9
+ "css",
10
+ "design-system"
11
+ ],
12
+ "packageManager": "pnpm@11.21.0",
4
13
  "author": "hi@javier.xyz",
5
14
  "license": "Unlicensed",
15
+ "homepage": "https://github.com/javierbyte/jbx#readme",
6
16
  "repository": {
7
17
  "type": "git",
8
- "url": "https://github.com/javierbyte/jbx.git"
18
+ "url": "git+https://github.com/javierbyte/jbx.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/javierbyte/jbx/issues"
9
22
  },
10
23
  "type": "module",
11
24
  "sideEffects": [
@@ -32,24 +45,29 @@
32
45
  },
33
46
  "scripts": {
34
47
  "css": "node ./scripts/build-css.mjs",
35
- "prebuild": "npm run css",
48
+ "prebuild": "pnpm run css",
36
49
  "build": "tsc -p tsconfig.build.json",
37
- "dev": "npm run css && tsc -p tsconfig.build.json --watch",
38
- "pretypecheck": "npm run css",
50
+ "dev": "pnpm run css && next dev --webpack -p 3008",
51
+ "dev:lib": "pnpm run css && tsc -p tsconfig.build.json --watch",
52
+ "preview:build": "pnpm run css && next build --webpack",
53
+ "pretypecheck": "pnpm run css",
39
54
  "typecheck": "tsc --noEmit",
40
- "pretest": "npm run build",
55
+ "pretest": "pnpm run build",
41
56
  "test": "node ./scripts/smoke.mjs",
42
- "prepublishOnly": "npm run typecheck && npm test"
57
+ "prepublishOnly": "pnpm run typecheck && pnpm test"
43
58
  },
44
59
  "peerDependencies": {
45
60
  "react": "^17 || ^18 || ^19"
46
61
  },
47
62
  "devDependencies": {
63
+ "@next/third-parties": "^16.3.2",
64
+ "@types/node": "^26.2.0",
48
65
  "@types/react": "^19.2.18",
49
- "@types/react-dom": "^19.2.3",
66
+ "@types/react-dom": "^19.2.4",
67
+ "next": "^16.3.2",
50
68
  "react": "^19.2.8",
51
69
  "react-dom": "^19.2.8",
52
- "typescript": "^5.9.3"
70
+ "typescript": "^7.0.2"
53
71
  },
54
72
  "publishConfig": {
55
73
  "access": "public"
@@ -0,0 +1,104 @@
1
+ 'use client';
2
+
3
+ import React, { useState } from 'react';
4
+ import { Component } from '../primitives.js';
5
+
6
+ const InputBase = Component<React.InputHTMLAttributes<HTMLInputElement>>(
7
+ `jbx-input`,
8
+ {},
9
+ { element: 'input' }
10
+ );
11
+
12
+ type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> & {
13
+ value?: string | number | readonly string[];
14
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
15
+ /**
16
+ * Opt in to number handling. `value` is a number, and this is called with a
17
+ * number -- but only once what was typed parses and lands inside `min`/`max`,
18
+ * so a half typed value stays on screen without ever reaching the caller.
19
+ * Implies `type="number"`.
20
+ */
21
+ onValueChange?: (value: number) => void;
22
+ };
23
+
24
+ function toNumber(value: InputProps['value']): number {
25
+ return typeof value === 'number' ? value : Number(value);
26
+ }
27
+
28
+ /**
29
+ * A text input, and -- with `onValueChange` -- a number input that only commits
30
+ * what parses:
31
+ *
32
+ * <Input value={seconds} onValueChange={secondsSet} min={0.2} max={60} />
33
+ *
34
+ * Without `onValueChange` this is a plain controlled input and the caller owns
35
+ * `value` and `onChange` as usual.
36
+ */
37
+ export function Input({
38
+ value,
39
+ onChange,
40
+ onValueChange,
41
+ onBlur,
42
+ type,
43
+ min,
44
+ max,
45
+ ...props
46
+ }: InputProps) {
47
+ // Hooks run either way; only the returned tree branches.
48
+ const [draft, draftSet] = useState(() => String(value ?? ''));
49
+ const [lastValue, lastValueSet] = useState(value);
50
+
51
+ if (!onValueChange) {
52
+ return (
53
+ <InputBase
54
+ {...props}
55
+ type={type}
56
+ min={min}
57
+ max={max}
58
+ value={value}
59
+ onChange={onChange}
60
+ onBlur={onBlur}
61
+ />
62
+ );
63
+ }
64
+
65
+ if (value !== lastValue) {
66
+ lastValueSet(value);
67
+ // `2.50` parses to the value we already hold -- adopting `String(value)`
68
+ // here would eat the trailing zero out from under the caret mid-typing.
69
+ if (Number(draft) !== toNumber(value)) draftSet(String(value ?? ''));
70
+ }
71
+
72
+ function draftChange(event: React.ChangeEvent<HTMLInputElement>) {
73
+ const next = event.target.value;
74
+ draftSet(next);
75
+ onChange?.(event);
76
+
77
+ const parsed = Number(next);
78
+ if (next.trim() === '' || !Number.isFinite(parsed)) return;
79
+ if (min !== undefined && parsed < toNumber(min)) return;
80
+ if (max !== undefined && parsed > toNumber(max)) return;
81
+
82
+ onValueChange!(parsed);
83
+ }
84
+
85
+ // Leaving a half typed value behind is how a field ends up showing something
86
+ // the rest of the page never agreed to. Snap back to the live value on the
87
+ // way out.
88
+ function draftBlur(event: React.FocusEvent<HTMLInputElement>) {
89
+ if (Number(draft) !== toNumber(value)) draftSet(String(value ?? ''));
90
+ onBlur?.(event);
91
+ }
92
+
93
+ return (
94
+ <InputBase
95
+ {...props}
96
+ type={type ?? 'number'}
97
+ min={min}
98
+ max={max}
99
+ value={draft}
100
+ onChange={draftChange}
101
+ onBlur={draftBlur}
102
+ />
103
+ );
104
+ }
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/build-css.mjs from src/style.css. Do not edit.
2
- export const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 17px;\n --radius-small: 2px;\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fcfcfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings: 'wdth' 107, 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--size);\n font-family: monaco, monospace;\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #ecf0f1;\n color: #34495e;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: calc(var(--size) * 2.5);\n transition: top 0.1s, left 0.1s, box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '↗';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition: top 0.3s, right 0.3s, color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #ecf0f1;\n z-index: -1;\n transition: transform 0.2s, opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: 16px;\n}\na.jbx-a::before {\n border-radius: 8px;\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: calc(var(--size) * 2.5);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #bdc3c780;\n height: var(--size);\n border-radius: 0;\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n border-radius: 0;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: 0;\n border: none;\n border-top: 2px solid #ecf0f1;\n}\n";
2
+ export const CSS = "html {\n box-sizing: border-box;\n}\n*,\n*:before,\n*:after {\n box-sizing: inherit;\n corner-shape: squircle;\n}\n\n:root {\n --size: 16px;\n --font-size: 16px;\n --font-size-small: 15px;\n --font-family-monospace:\n ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;\n --radius-small: 1px;\n --radius-big: 15px;\n /* Every interactive control is this tall, so a button, an input and a range\n standing next to each other line up. */\n --control-height: calc(var(--size) * 2.5);\n /* What a control shrinks to inside a tab row, where it has to match the line\n box of the tab's text (`.jbx-text` is `line-height: 1.4`) rather than stand\n on its own -- a row holding one is then exactly as tall as one that doesn't. */\n --control-height-compact: calc(var(--font-size) * 1.4);\n}\n\n@media screen and (max-width: 1200px) {\n :root {\n --font-size: 18px;\n --font-size-small: 16px;\n --size: 14px;\n }\n}\n\n@media screen and (max-width: 600px) {\n :root {\n --font-size: 16px;\n --font-size-small: 14px;\n }\n}\n\n* {\n padding: 0;\n margin: 0;\n position: relative;\n}\n\nbody {\n touch-action: pan-y;\n}\n\nbody,\ninput,\ntextarea,\nbutton {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n}\n\nbody {\n background: #fdfdfd;\n color: #000;\n}\n\nh1,\nh2,\nh3,\nh4 {\n line-height: 1;\n padding: 0;\n font-variation-settings: 'wght' 600;\n font-weight: 600;\n color: var(--base-font-color-bright);\n}\nh1 {\n font-variation-settings:\n 'wdth' 107,\n 'wght' 650;\n font-weight: 650;\n}\n\nstrong,\nb {\n font-weight: 500;\n}\n\n.jbx-main-h1 {\n display: inline-block;\n background-color: var(--accent-color);\n border-radius: var(--radius-small);\n font-size: calc(var(--font-size) * 2);\n padding: 8px;\n}\n\n.jbx-h1 {\n font-size: calc(var(--font-size) * 2);\n font-weight: 700;\n}\n.jbx-h2 {\n font-size: calc(var(--font-size) * 1.25);\n}\n.jbx-h3 {\n font-size: calc(var(--font-size) * 1.125);\n}\n.jbx-h4 {\n font-size: var(--font-size-small);\n text-transform: uppercase;\n}\n\n/* base text */\nhtml,\nbody,\n.jbx-button,\n.jbx-input {\n font-size: var(--font-size);\n line-height: 1;\n}\n\n.jbx-code-snippet {\n border-radius: var(--radius-small);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n}\n.jbx-code-snippet:focus {\n outline: none;\n}\n\n.jbx-code-area {\n border-radius: var(--radius-big);\n font-family: var(--font-family-monospace);\n border: none;\n width: 100%;\n font-size: calc(var(--size) - 3px);\n line-height: 1.33;\n padding: var(--size) calc(var(--size) * 1.2);\n background: #eee;\n color: #444;\n resize: none;\n min-height: 120px;\n}\n.jbx-code-area:focus {\n outline: none;\n}\n\n.jbx-button {\n color: #000;\n border-radius: var(--radius-small);\n appearance: none;\n user-select: none;\n cursor: pointer;\n display: inline-block;\n background-color: #eee;\n box-shadow: 3px 3px 0 #ccc;\n padding: 0 calc(var(--size) / 2);\n border: none;\n height: var(--control-height);\n transition:\n top 0.1s,\n left 0.1s,\n box-shadow 0.05s;\n}\n.jbx-button:active {\n top: 1px;\n left: 1px;\n box-shadow: 1px 1px 0 #ccc;\n}\n.jbx-button:disabled {\n cursor: default;\n color: #999;\n background-color: #f4f4f4;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n.jbx-button:disabled:active {\n top: 0;\n left: 0;\n box-shadow: 1px 1px 0 #e0e0e0;\n}\n\n/* LINKS */\n.jbx-a {\n cursor: pointer;\n color: #000;\n box-shadow: #0002 0 2px 0;\n font-weight: 500;\n text-decoration: none;\n}\n.jbx-a::after {\n content: '↗';\n color: #0004;\n font-size: var(--font-size-small);\n position: relative;\n top: -1px;\n right: -1px;\n transition:\n top 0.3s,\n right 0.3s,\n color 0.3s;\n}\n.jbx-a:hover,\n.jbx-block-link:hover .jbx-a {\n box-shadow: var(--accent-color) 0 2px 0;\n}\n.jbx-a:hover::after,\n.jbx-block-link:hover .jbx-a::after {\n top: -3px;\n right: -3px;\n color: var(--accent-color);\n}\n\n.jbx-block-link {\n min-width: 300px;\n flex: 1;\n text-decoration: none;\n color: #000;\n display: inline-block;\n padding: var(--size);\n}\na.jbx-a::before,\n.jbx-block-link::before {\n content: '';\n display: block;\n position: absolute;\n background-color: #eee;\n z-index: -1;\n transition:\n transform 0.2s,\n opacity 0.2s;\n transform: scale(0.98) translatey(4px);\n opacity: 0;\n top: -4px;\n left: -6px;\n right: -6px;\n bottom: -4px;\n}\n.jbx-block-link::before {\n border-radius: var(--radius-small);\n}\na.jbx-a::before {\n border-radius: var(--radius-small);\n}\na.jbx-a:hover::before,\n.jbx-block-link:hover::before {\n transform: scale(1) translatey(0);\n opacity: 1;\n}\n\n.jbx-a {\n display: inline-block;\n}\n\n/* /LINKS */\n\n.jbx-small-text {\n font-size: var(--font-size-small);\n}\n\n.jbx-container {\n max-width: 1080px;\n margin: 0 auto;\n padding: calc(var(--size) * 2.5) calc(var(--size) * 1.5) calc(var(--size) * 4);\n}\n\n.jbx-box {\n flex: 1;\n}\n\n.jbx-inline {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n}\n\n.jbx-stack {\n flex: 1;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.jbx-text {\n line-height: 1.4;\n}\n\n.jbx-tabs--tab {\n border-radius: var(--radius-small);\n}\n\n.jbx-input {\n color: #777;\n -webkit-text-fill-color: #777;\n opacity: 1;\n flex: 1;\n display: block;\n appearance: none;\n border: none;\n border-radius: var(--radius-small);\n height: var(--control-height);\n background-color: #eee;\n padding: 0 calc(var(--size) * 0.5);\n box-shadow:\n inset rgba(0, 0, 0, 0.04) 3px 3px 0,\n inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;\n}\n\n/* Chrome hides the stepper until hover and takes its width out of the content\n box, so the value slides sideways as the pointer enters. Keep it painted. */\n.jbx-input[type='number']::-webkit-inner-spin-button,\n.jbx-input[type='number']::-webkit-outer-spin-button {\n opacity: 1;\n}\n\n/* A control inside a tab row sizes to the row, not to itself: it matches the\n line box of the text beside it, so a row holding a field is exactly as tall\n as one that only holds tabs. `flex: none` because `.jbx-input` stretches,\n which is right for a field that owns its row and wrong for one sitting\n between two bits of text. */\n.jbx-tabs .jbx-input,\n.jbx-tabs .jbx-button {\n flex: none;\n height: var(--control-height-compact);\n}\n\n.jbx-dropzone {\n height: 120px;\n flex: 1;\n display: flex;\n text-align: center;\n align-items: center;\n align-content: center;\n justify-content: center;\n flex-direction: column;\n border: 2px dashed #000;\n border-radius: var(--radius-big);\n color: #000;\n padding: 0;\n cursor: pointer;\n}\n.jbx-dropzone:hover {\n border-color: #999;\n}\n.jbx-dropzone span {\n width: 100%;\n cursor: pointer;\n}\n.jbx-dropzone input {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n opacity: 0;\n cursor: pointer;\n}\n\n.jbx-range {\n flex: 1;\n width: 100%;\n appearance: none;\n background-color: #c0c0c080;\n height: var(--size);\n border-radius: var(--radius-small);\n}\n\n.jbx-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-thumb {\n appearance: none;\n box-shadow: none;\n height: calc(var(--size) * 2);\n width: var(--size);\n background-color: #000;\n border: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-webkit-slider-runnable-track {\n appearance: none;\n border-radius: var(--radius-small);\n}\n.jbx-range::-moz-range-track {\n background-color: #c0c0c080;\n border-radius: var(--radius-small);\n height: var(--size);\n}\n.jbx-range:focus {\n outline: none;\n}\n\n.jbx-bullet-container {\n display: inline-block;\n margin: -8px 4px -8px 0;\n}\n\n.jbx-bullet {\n border: 1px solid #0001;\n color: #000;\n background-color: #0001;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: calc(var(--font-size-small) - 3px);\n height: calc(var(--size) * 1.25);\n width: calc(var(--size) * 1.25);\n border-radius: 100%;\n top: -2px;\n margin-right: 2px;\n}\n\n.jbx-hr {\n margin: calc(var(--size) * 2) auto;\n width: 38.2%;\n border-radius: var(--radius-small);\n border: none;\n border-top: 2px solid #eee;\n}\n";
package/src/index.tsx CHANGED
@@ -3,4 +3,5 @@ export * from './primitives.js';
3
3
  export { space } from './spacing.js';
4
4
  export { JBX } from './JBX.js';
5
5
  export { Box } from './components/Layout.js';
6
+ export { Input } from './components/Input.js';
6
7
  export { MoreExperiments } from './components/MoreExperiments.js';
@@ -65,12 +65,6 @@ export const Button = Component<React.ButtonHTMLAttributes<HTMLButtonElement>>(
65
65
  { element: 'button' }
66
66
  );
67
67
 
68
- export const Input = Component<React.InputHTMLAttributes<HTMLInputElement>>(
69
- `jbx-input`,
70
- {},
71
- { element: 'input' }
72
- );
73
-
74
68
  export const Range = Component<React.InputHTMLAttributes<HTMLInputElement>>(
75
69
  `jbx-range`,
76
70
  {},
@@ -149,9 +143,10 @@ type TabProps = DivProps & { info?: boolean; active?: boolean };
149
143
  export const Tab = Component<TabProps>(
150
144
  `jbx-tabs--tab`,
151
145
  ({ info, active }) => ({
146
+ borderRadius: BASE_RADIUS,
152
147
  userSelect: 'none',
153
148
  cursor: 'pointer',
154
- backgroundColor: active ? '#000' : info ? '#fff' : '#ecf0f1',
149
+ backgroundColor: active ? '#000' : info ? '#fff' : '#eee',
155
150
  color: active ? '#fff' : '#000',
156
151
  padding: space(0.5),
157
152
  paddingLeft: info ? 0 : space(0.5)
@@ -244,4 +239,3 @@ export function Bullet({ value }: { value: number }) {
244
239
  </div>
245
240
  );
246
241
  }
247
-
package/src/spacing.ts CHANGED
@@ -9,7 +9,7 @@ export function space(n: number): string {
9
9
  return `calc(var(--size) * ${n})`;
10
10
  }
11
11
 
12
- export const BASE_RADIUS = `calc(var(--size) / 3)`;
12
+ export const BASE_RADIUS = `var(--radius-small)`;
13
13
 
14
14
  export type SpacingProps = {
15
15
  /** Vertical margin, in spacing units. */
package/src/style.css CHANGED
@@ -5,13 +5,24 @@ html {
5
5
  *:before,
6
6
  *:after {
7
7
  box-sizing: inherit;
8
+ corner-shape: squircle;
8
9
  }
9
10
 
10
11
  :root {
11
12
  --size: 16px;
12
13
  --font-size: 16px;
13
- --font-size-small: 17px;
14
- --radius-small: 2px;
14
+ --font-size-small: 15px;
15
+ --font-family-monospace:
16
+ ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
17
+ --radius-small: 1px;
18
+ --radius-big: 15px;
19
+ /* Every interactive control is this tall, so a button, an input and a range
20
+ standing next to each other line up. */
21
+ --control-height: calc(var(--size) * 2.5);
22
+ /* What a control shrinks to inside a tab row, where it has to match the line
23
+ box of the tab's text (`.jbx-text` is `line-height: 1.4`) rather than stand
24
+ on its own -- a row holding one is then exactly as tall as one that doesn't. */
25
+ --control-height-compact: calc(var(--font-size) * 1.4);
15
26
  }
16
27
 
17
28
  @media screen and (max-width: 1200px) {
@@ -41,12 +52,13 @@ body {
41
52
 
42
53
  body,
43
54
  input,
44
- textarea {
55
+ textarea,
56
+ button {
45
57
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
46
58
  }
47
59
 
48
60
  body {
49
- background: #fcfcfd;
61
+ background: #fdfdfd;
50
62
  color: #000;
51
63
  }
52
64
 
@@ -61,7 +73,9 @@ h4 {
61
73
  color: var(--base-font-color-bright);
62
74
  }
63
75
  h1 {
64
- font-variation-settings: 'wdth' 107, 'wght' 650;
76
+ font-variation-settings:
77
+ 'wdth' 107,
78
+ 'wght' 650;
65
79
  font-weight: 650;
66
80
  }
67
81
 
@@ -73,6 +87,7 @@ b {
73
87
  .jbx-main-h1 {
74
88
  display: inline-block;
75
89
  background-color: var(--accent-color);
90
+ border-radius: var(--radius-small);
76
91
  font-size: calc(var(--font-size) * 2);
77
92
  padding: 8px;
78
93
  }
@@ -102,15 +117,15 @@ body,
102
117
  }
103
118
 
104
119
  .jbx-code-snippet {
105
- border-radius: var(--size);
106
- font-family: monaco, monospace;
120
+ border-radius: var(--radius-small);
121
+ font-family: var(--font-family-monospace);
107
122
  border: none;
108
123
  width: 100%;
109
124
  font-size: calc(var(--size) - 3px);
110
125
  line-height: 1.33;
111
126
  padding: var(--size) calc(var(--size) * 1.2);
112
- background: #ecf0f1;
113
- color: #34495e;
127
+ background: #eee;
128
+ color: #444;
114
129
  resize: none;
115
130
  }
116
131
  .jbx-code-snippet:focus {
@@ -118,15 +133,15 @@ body,
118
133
  }
119
134
 
120
135
  .jbx-code-area {
121
- border-radius: var(--size);
122
- font-family: monaco, monospace;
136
+ border-radius: var(--radius-big);
137
+ font-family: var(--font-family-monospace);
123
138
  border: none;
124
139
  width: 100%;
125
140
  font-size: calc(var(--size) - 3px);
126
141
  line-height: 1.33;
127
142
  padding: var(--size) calc(var(--size) * 1.2);
128
- background: #ecf0f1;
129
- color: #34495e;
143
+ background: #eee;
144
+ color: #444;
130
145
  resize: none;
131
146
  min-height: 120px;
132
147
  }
@@ -145,14 +160,28 @@ body,
145
160
  box-shadow: 3px 3px 0 #ccc;
146
161
  padding: 0 calc(var(--size) / 2);
147
162
  border: none;
148
- height: calc(var(--size) * 2.5);
149
- transition: top 0.1s, left 0.1s, box-shadow 0.05s;
163
+ height: var(--control-height);
164
+ transition:
165
+ top 0.1s,
166
+ left 0.1s,
167
+ box-shadow 0.05s;
150
168
  }
151
169
  .jbx-button:active {
152
170
  top: 1px;
153
171
  left: 1px;
154
172
  box-shadow: 1px 1px 0 #ccc;
155
173
  }
174
+ .jbx-button:disabled {
175
+ cursor: default;
176
+ color: #999;
177
+ background-color: #f4f4f4;
178
+ box-shadow: 1px 1px 0 #e0e0e0;
179
+ }
180
+ .jbx-button:disabled:active {
181
+ top: 0;
182
+ left: 0;
183
+ box-shadow: 1px 1px 0 #e0e0e0;
184
+ }
156
185
 
157
186
  /* LINKS */
158
187
  .jbx-a {
@@ -169,7 +198,10 @@ body,
169
198
  position: relative;
170
199
  top: -1px;
171
200
  right: -1px;
172
- transition: top 0.3s, right 0.3s, color 0.3s;
201
+ transition:
202
+ top 0.3s,
203
+ right 0.3s,
204
+ color 0.3s;
173
205
  }
174
206
  .jbx-a:hover,
175
207
  .jbx-block-link:hover .jbx-a {
@@ -195,9 +227,11 @@ a.jbx-a::before,
195
227
  content: '';
196
228
  display: block;
197
229
  position: absolute;
198
- background-color: #ecf0f1;
230
+ background-color: #eee;
199
231
  z-index: -1;
200
- transition: transform 0.2s, opacity 0.2s;
232
+ transition:
233
+ transform 0.2s,
234
+ opacity 0.2s;
201
235
  transform: scale(0.98) translatey(4px);
202
236
  opacity: 0;
203
237
  top: -4px;
@@ -206,10 +240,10 @@ a.jbx-a::before,
206
240
  bottom: -4px;
207
241
  }
208
242
  .jbx-block-link::before {
209
- border-radius: 16px;
243
+ border-radius: var(--radius-small);
210
244
  }
211
245
  a.jbx-a::before {
212
- border-radius: 8px;
246
+ border-radius: var(--radius-small);
213
247
  }
214
248
  a.jbx-a:hover::before,
215
249
  .jbx-block-link:hover::before {
@@ -255,6 +289,10 @@ a.jbx-a:hover::before,
255
289
  line-height: 1.4;
256
290
  }
257
291
 
292
+ .jbx-tabs--tab {
293
+ border-radius: var(--radius-small);
294
+ }
295
+
258
296
  .jbx-input {
259
297
  color: #777;
260
298
  -webkit-text-fill-color: #777;
@@ -264,10 +302,30 @@ a.jbx-a:hover::before,
264
302
  appearance: none;
265
303
  border: none;
266
304
  border-radius: var(--radius-small);
267
- height: calc(var(--size) * 2.5);
305
+ height: var(--control-height);
268
306
  background-color: #eee;
269
307
  padding: 0 calc(var(--size) * 0.5);
270
- box-shadow: inset rgba(0, 0, 0, 0.04) 3px 3px 0, inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
308
+ box-shadow:
309
+ inset rgba(0, 0, 0, 0.04) 3px 3px 0,
310
+ inset rgba(0, 0, 0, 0.03) 0.5px 0.5px 0;
311
+ }
312
+
313
+ /* Chrome hides the stepper until hover and takes its width out of the content
314
+ box, so the value slides sideways as the pointer enters. Keep it painted. */
315
+ .jbx-input[type='number']::-webkit-inner-spin-button,
316
+ .jbx-input[type='number']::-webkit-outer-spin-button {
317
+ opacity: 1;
318
+ }
319
+
320
+ /* A control inside a tab row sizes to the row, not to itself: it matches the
321
+ line box of the text beside it, so a row holding a field is exactly as tall
322
+ as one that only holds tabs. `flex: none` because `.jbx-input` stretches,
323
+ which is right for a field that owns its row and wrong for one sitting
324
+ between two bits of text. */
325
+ .jbx-tabs .jbx-input,
326
+ .jbx-tabs .jbx-button {
327
+ flex: none;
328
+ height: var(--control-height-compact);
271
329
  }
272
330
 
273
331
  .jbx-dropzone {
@@ -280,6 +338,7 @@ a.jbx-a:hover::before,
280
338
  justify-content: center;
281
339
  flex-direction: column;
282
340
  border: 2px dashed #000;
341
+ border-radius: var(--radius-big);
283
342
  color: #000;
284
343
  padding: 0;
285
344
  cursor: pointer;
@@ -305,9 +364,8 @@ a.jbx-a:hover::before,
305
364
  flex: 1;
306
365
  width: 100%;
307
366
  appearance: none;
308
- background-color: #bdc3c780;
367
+ background-color: #c0c0c080;
309
368
  height: var(--size);
310
- border-radius: 0;
311
369
  border-radius: var(--radius-small);
312
370
  }
313
371
 
@@ -315,7 +373,6 @@ a.jbx-a:hover::before,
315
373
  -webkit-appearance: none;
316
374
  appearance: none;
317
375
  box-shadow: none;
318
- border-radius: 0;
319
376
  height: calc(var(--size) * 2);
320
377
  width: var(--size);
321
378
  background-color: #000;
@@ -325,7 +382,6 @@ a.jbx-a:hover::before,
325
382
  .jbx-range::-moz-range-thumb {
326
383
  appearance: none;
327
384
  box-shadow: none;
328
- border-radius: 0;
329
385
  height: calc(var(--size) * 2);
330
386
  width: var(--size);
331
387
  background-color: #000;
@@ -334,6 +390,12 @@ a.jbx-a:hover::before,
334
390
  }
335
391
  .jbx-range::-webkit-slider-runnable-track {
336
392
  appearance: none;
393
+ border-radius: var(--radius-small);
394
+ }
395
+ .jbx-range::-moz-range-track {
396
+ background-color: #c0c0c080;
397
+ border-radius: var(--radius-small);
398
+ height: var(--size);
337
399
  }
338
400
  .jbx-range:focus {
339
401
  outline: none;
@@ -363,7 +425,7 @@ a.jbx-a:hover::before,
363
425
  .jbx-hr {
364
426
  margin: calc(var(--size) * 2) auto;
365
427
  width: 38.2%;
366
- border-radius: 0;
428
+ border-radius: var(--radius-small);
367
429
  border: none;
368
- border-top: 2px solid #ecf0f1;
430
+ border-top: 2px solid #eee;
369
431
  }