@mistriwork/ui 0.0.0 → 1.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -1
  3. package/dist/Avatar.d.ts +11 -0
  4. package/dist/Avatar.js +28 -0
  5. package/dist/Button.d.ts +36 -0
  6. package/dist/Button.js +22 -0
  7. package/dist/Carousel.d.ts +52 -0
  8. package/dist/Carousel.js +110 -0
  9. package/dist/Choices.d.ts +77 -0
  10. package/dist/Choices.js +88 -0
  11. package/dist/DateField.d.ts +66 -0
  12. package/dist/DateField.js +255 -0
  13. package/dist/Drawer.d.ts +33 -0
  14. package/dist/Drawer.js +12 -0
  15. package/dist/DropMenu.d.ts +59 -0
  16. package/dist/DropMenu.js +52 -0
  17. package/dist/Dropdown.d.ts +73 -0
  18. package/dist/Dropdown.js +85 -0
  19. package/dist/Field.d.ts +53 -0
  20. package/dist/Field.js +58 -0
  21. package/dist/FormParts.d.ts +68 -0
  22. package/dist/FormParts.js +53 -0
  23. package/dist/HeroBlocks.d.ts +37 -0
  24. package/dist/HeroBlocks.js +26 -0
  25. package/dist/Icon.d.ts +29 -0
  26. package/dist/Icon.js +78 -0
  27. package/dist/Modal.d.ts +48 -0
  28. package/dist/Modal.js +57 -0
  29. package/dist/Pagination.d.ts +33 -0
  30. package/dist/Pagination.js +25 -0
  31. package/dist/Popover.d.ts +21 -0
  32. package/dist/Popover.js +20 -0
  33. package/dist/Resizable.d.ts +48 -0
  34. package/dist/Resizable.js +122 -0
  35. package/dist/ScrollArea.d.ts +29 -0
  36. package/dist/ScrollArea.js +62 -0
  37. package/dist/Select.d.ts +26 -0
  38. package/dist/Select.js +20 -0
  39. package/dist/SensitiveField.d.ts +26 -0
  40. package/dist/SensitiveField.js +27 -0
  41. package/dist/Slider.d.ts +17 -0
  42. package/dist/Slider.js +10 -0
  43. package/dist/Switch.d.ts +28 -0
  44. package/dist/Switch.js +24 -0
  45. package/dist/Tabs.d.ts +25 -0
  46. package/dist/Tabs.js +5 -0
  47. package/dist/TextField.d.ts +44 -0
  48. package/dist/TextField.js +19 -0
  49. package/dist/Tooltip.d.ts +29 -0
  50. package/dist/Tooltip.js +39 -0
  51. package/dist/Typeahead.d.ts +63 -0
  52. package/dist/Typeahead.js +90 -0
  53. package/dist/fieldFrame.d.ts +37 -0
  54. package/dist/fieldFrame.js +16 -0
  55. package/dist/forms.css +192 -0
  56. package/dist/hero.css +23 -0
  57. package/dist/index.d.ts +38 -0
  58. package/dist/index.js +40 -0
  59. package/dist/internal/ComponentStyleScope.d.ts +1 -0
  60. package/dist/internal/ComponentStyleScope.js +4 -0
  61. package/dist/internal/anchor.d.ts +19 -0
  62. package/dist/internal/anchor.js +52 -0
  63. package/dist/internal/datePickerModel.d.ts +53 -0
  64. package/dist/internal/datePickerModel.js +175 -0
  65. package/dist/internal/popups.d.ts +13 -0
  66. package/dist/internal/popups.js +16 -0
  67. package/dist/internal/ruler.d.ts +37 -0
  68. package/dist/internal/ruler.js +55 -0
  69. package/dist/masks.d.ts +32 -0
  70. package/dist/masks.js +62 -0
  71. package/dist/preferences.css +26 -0
  72. package/dist/primitives.css +188 -0
  73. package/dist/standalone.css +413 -0
  74. package/dist/style.css +19 -0
  75. package/dist/tokens.css +233 -0
  76. package/mark.svg +1 -0
  77. package/package.json +85 -3
@@ -0,0 +1,233 @@
1
+ /* @mistriwork/ui's tokens: every colour, size, space, radius, shadow and time the primitives and the pages drawn with them
2
+ name. Unlayered here, so whoever takes them names the layer: style.css takes them into `@mistriwork/ui`, the kit's
3
+ stylesheet into its `base`. */
4
+ /* Light is the bare :root; dark is redefined twice — once for the
5
+ OS preference (guarded so an explicit light choice still wins) and once for
6
+ the explicit stamp. Nothing outside these blocks names a colour directly. */
7
+ :root {
8
+ /* Every text size is written over this (calc(12px * var(--type-k))): a
9
+ theme's type.base worn as base / 13px, so one setting grows the whole
10
+ scale together. 1 draws every size as written. */
11
+ --type-k: 1;
12
+ --ground: #fbfaf8;
13
+ --surface: #ffffff;
14
+ --raised: #f3f1ed;
15
+ --line: #e2ded6;
16
+ --line-strong: #cbc5b9;
17
+ /* A form control's edge: 3:1 on the field and on the ground it sits on
18
+ (WCAG 1.4.11), where the two hairlines above are 1.3 to 2:1. Only fields
19
+ wear it; sections, cards, tables and rules keep the quiet hairline. */
20
+ --line-control: #8d887f;
21
+ --ink: #24211c;
22
+ --ink-muted: #6d675d;
23
+ /* The faintest ink still clears 4.5:1 on every light ground. It was a
24
+ 50%-alpha grey that composited to about 1.6:1 — matrix headers, every
25
+ `null`, type hints and disabled sort headers were decoration to a
26
+ reader who needed them to be text. */
27
+ --ink-subtle: #736c65;
28
+ /* The ring's ink: the look's softer tint of its accent (`focus` in the palette), the accent where a palette
29
+ sets none. On :root, not body, so a look's inline value is the one every ring reads. */
30
+ --focus: var(--accent);
31
+ --accent: #1d6a5a;
32
+ /* The accent is a fill; the words drawn on it and the words drawn in it are the palette's `onAccent` and `accentInk`
33
+ where a theme names them or its accent would fail without. Unsaid they are the page's color and the accent itself,
34
+ as they were when the accent was both. An App's own accent is worn on body (appTheme.js), which writes them there. */
35
+ --on-accent: var(--ground);
36
+ --accent-ink: var(--accent);
37
+ /* Elevation and scrims, tokens rather than literals in every sheet, so
38
+ dark mode can deepen them: a 16% black shadow on a dark ground is no
39
+ shadow at all. */
40
+ --shadow-pop: 0 6px 20px rgb(0 0 0 / 0.16);
41
+ --shadow-panel: 0 10px 34px rgb(0 0 0 / 0.18);
42
+ --shadow-modal: 0 18px 50px rgb(0 0 0 / 0.24);
43
+ --scrim: rgb(0 0 0 / 0.28);
44
+ --scrim-light: rgb(0 0 0 / 0.14);
45
+ /* A photo is judged against dark whatever the page's theme, so the
46
+ lightbox's ground and ink are the same in both. */
47
+ --lightbox-ground: rgb(10 12 16 / 0.94);
48
+ --lightbox-ink: rgb(255 255 255 / 0.94);
49
+ --lightbox-line: rgb(255 255 255 / 0.22);
50
+ --accent-soft: #1d6a5a14;
51
+ --link: #17594c;
52
+ --status-warning: #9a4b12;
53
+ --status-critical: #a12d2d;
54
+ --status-info: #7a5cc0;
55
+ /* Success, independent of --accent: an app may theme its accent indigo,
56
+ and "good" must stay green there. */
57
+ --status-good: #1f7a46;
58
+ /* The code face, single-sourced: --mono is the data face and follows the
59
+ typography preference; --code is what code surfaces pin to. */
60
+ --code: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
61
+ --mono: var(--code);
62
+ --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
63
+ --radius: 6px;
64
+ /* A form control's own size, said once for every one of them (the field box, a listbox, a choice, a button's pair):
65
+ its fill, its height and the width of its edge. A theme sets them to draw a filled, taller or heavier field; the
66
+ defaults are the look they have always had. The corner is --field-radius, read where it is used, --radius unsaid. */
67
+ --field-fill: var(--surface);
68
+ --control-h: 34px;
69
+ --control-border-w: 1px;
70
+ /* A room's one content edge inside the pane's gutter: the crumb bar's
71
+ words, a list's controls and rows, a board's first lane, a calendar and a
72
+ record all start here, so nothing in a room starts a step off the rest. */
73
+ --room-inset: 14px;
74
+ /* The space scale (docs/design.md, Space and text): every padding, margin
75
+ and gap is a step of it or a semantic token over it. The steps from 16px
76
+ up are the layout's and move with a theme's rhythm (themeFamilies.css);
77
+ the small ones are a control's own and never do. */
78
+ --space-1: 2px;
79
+ --space-2: 4px;
80
+ --space-3: 8px;
81
+ --space-4: 12px;
82
+ --space-5: 16px;
83
+ --space-6: 24px;
84
+ --space-7: 32px;
85
+ --space-8: 48px;
86
+ /* The halves between the control steps: a button's, a field's and a chip's own padding sat at 6, 10 and 14px
87
+ long before the scale, and a control's size is not the page's air, so these never move with a theme's
88
+ rhythm either. The smallest, 3px, is a caption's gap over its value (the classic record form's label sits 3px
89
+ over its value: docs/design.md, Voice) and a compact control's block padding. */
90
+ --space-1h: 3px;
91
+ --space-2h: 6px;
92
+ --space-3h: 10px;
93
+ --space-4h: 14px;
94
+ /* The seam between a record's sections and a dashboard's rows: hierarchy
95
+ from space, not boxes. */
96
+ --section-seam: 40px;
97
+ /* Between a form's fields and a record's field columns: the 20px field gap that, with the seam, makes hierarchy
98
+ from space (docs/design.md, the refusal list). Named where it was a literal, it stands where the literal stood:
99
+ a theme's rhythm does not move it. */
100
+ --field-gap: 20px;
101
+ /* A list's row, drawn: 32px at compact, 40px at comfortable and 44px at
102
+ spacious or under a finger, whatever the density's zoom (density.js
103
+ sets data-density beside the zoom, before the first paint). A cell
104
+ taller than its row (two lines, an avatar) grows it. */
105
+ --row-h: 32px;
106
+ /* The text scale, each step over the theme's base like every size. */
107
+ --text-xs: calc(11px * var(--type-k));
108
+ --text-sm: calc(12px * var(--type-k));
109
+ --text-base: calc(13px * var(--type-k));
110
+ --text-md: calc(14px * var(--type-k));
111
+ --text-lg: calc(16px * var(--type-k));
112
+ --text-xl: calc(20px * var(--type-k));
113
+ /* Tracking by size, for the looks' type. Large type set at its natural
114
+ spacing reads as body text blown up, and small capitals set tight read
115
+ cramped: display type (24px and up) closes up, a title (17 to 23px) a
116
+ little, and capitals and small caps open out. Tuned by eye on the system
117
+ face, Helvetica and Iowan Old Style. */
118
+ --track-display: -0.022em;
119
+ --track-title: -0.012em;
120
+ --track-caps: 0.05em;
121
+ /* Three steps of heading: a list names itself, a record is named, a
122
+ landing announces. Each is set in the look's heading face at its heading
123
+ weight, which no look takes past 700 (themePresets.ts). */
124
+ --type-list-title: var(--text-xl);
125
+ /* Navigation and controls share a text role. Density changes their hit
126
+ area and spacing, not this scale. */
127
+ --type-ui: var(--text-base);
128
+ --icon-ui: 18px;
129
+ --type-record-title: calc(26px * var(--type-k));
130
+ --type-display: calc(clamp(32px, 1.25vw + 26px, 44px) * var(--type-k));
131
+ --heading-weight: 700;
132
+
133
+ /* Motion.
134
+
135
+ The built-in CSS easings are too weak to read as intentional, so the
136
+ curves are explicit. `ease-in` appears nowhere: it starts slow, delaying
137
+ the exact moment the user is watching, and an ease-out at 200ms feels
138
+ faster than an ease-in at 200ms.
139
+
140
+ Durations are short because this is a tool, not a presentation. A
141
+ dropdown at 160ms feels responsive; the same dropdown at 400ms feels
142
+ like it is thinking. Nothing here exceeds 220ms.
143
+
144
+ What is deliberately NOT animated: anything reached by keyboard, and
145
+ anything you see a hundred times a day. Arrowing through the table list
146
+ and paging through rows are instant, because animating a repeated action
147
+ makes the tool feel slower every single time. */
148
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
149
+ --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
150
+ /* A drawer or sheet that slides in from an edge: fast off the mark, a long settle (docs/design.md, Motion doctrine 14). */
151
+ --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
152
+ --t-press: 140ms;
153
+ --t-hover: 120ms;
154
+ --t-popover: 160ms;
155
+ --t-panel: 200ms;
156
+ --t-changed: 1200ms;
157
+ /* The hue of a row just changed (rule 11): a warm amber of its own, never the look's accent. Mono's accent is black
158
+ and Sage's a grey, so an accent tint came out as the grey of a selected row. One hue in every look, light and dark. */
159
+ --changed-hue: #e8a53c;
160
+ /* How much of it a changed row starts at, over the surface: a hue the eye catches across the room, not a fill.
161
+ Dark grounds take more, since the hue over a dark surface reads fainter at one share. */
162
+ --changed-mix: 18%;
163
+ }
164
+
165
+ :root[data-density='comfortable'] { --row-h: calc(40px / var(--density-zoom, 1)); }
166
+ :root[data-density='spacious'] { --row-h: calc(44px / var(--density-zoom, 1)); }
167
+ @media (pointer: coarse) {
168
+ :root, :root[data-density] { --row-h: calc(44px / var(--density-zoom, 1)); }
169
+ }
170
+
171
+ /* The browser draws its own controls — a checkbox, a radio, a date's
172
+ calendar, the window's scroll bar — in the scheme it is told. Untold, they
173
+ stayed white on every dark ground: a column of bright squares down a list. */
174
+ :root { color-scheme: light; }
175
+ @media (prefers-color-scheme: dark) {
176
+ :root:not([data-theme="light"]) { color-scheme: dark; }
177
+ }
178
+ :root[data-theme="dark"] { color-scheme: dark; }
179
+
180
+ @media (prefers-color-scheme: dark) {
181
+ :root:not([data-theme="light"]) {
182
+ --ground: #16181a;
183
+ --surface: #1c1f22;
184
+ --raised: #23272b;
185
+ --line: #2f343a;
186
+ --line-strong: #454c54;
187
+ --line-control: #6e7378;
188
+ --ink: #e4e2dd;
189
+ --ink-muted: #9aa0a6;
190
+ --ink-subtle: #979da4;
191
+ --accent: #5fc9ad;
192
+ --accent-soft: #5fc9ad1a;
193
+ --changed-mix: 22%;
194
+ --link: #6fd4b8;
195
+ /* A matrix's heaviest tint, where the ink still reads at 4.5:1 on this pale accent (theme.ts heatTop). */
196
+ --heat-top: 46%;
197
+ --status-warning: #e0a05c;
198
+ --status-critical: #e8756f;
199
+ --status-info: #b39ae8;
200
+ --status-good: #57b884;
201
+ --shadow-pop: 0 6px 20px rgb(0 0 0 / 0.5);
202
+ --shadow-panel: 0 10px 34px rgb(0 0 0 / 0.55);
203
+ --shadow-modal: 0 18px 50px rgb(0 0 0 / 0.65);
204
+ --scrim: rgb(0 0 0 / 0.55);
205
+ --scrim-light: rgb(0 0 0 / 0.35);
206
+ }
207
+ }
208
+
209
+ :root[data-theme="dark"] {
210
+ --ground: #16181a;
211
+ --surface: #1c1f22;
212
+ --raised: #23272b;
213
+ --line: #2f343a;
214
+ --line-strong: #454c54;
215
+ --line-control: #6e7378;
216
+ --ink: #e4e2dd;
217
+ --ink-muted: #9aa0a6;
218
+ --ink-subtle: #979da4;
219
+ --accent: #5fc9ad;
220
+ --accent-soft: #5fc9ad1a;
221
+ --changed-mix: 22%;
222
+ --link: #6fd4b8;
223
+ --heat-top: 46%;
224
+ --status-warning: #e0a05c;
225
+ --status-critical: #e8756f;
226
+ --status-info: #b39ae8;
227
+ --status-good: #57b884;
228
+ --shadow-pop: 0 6px 20px rgb(0 0 0 / 0.5);
229
+ --shadow-panel: 0 10px 34px rgb(0 0 0 / 0.55);
230
+ --shadow-modal: 0 18px 50px rgb(0 0 0 / 0.65);
231
+ --scrim: rgb(0 0 0 / 0.55);
232
+ --scrim-light: rgb(0 0 0 / 0.35);
233
+ }
package/mark.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><style>.i{fill:#1c1a17}.a{fill:#6b3fd4}@media (prefers-color-scheme:dark){.i{fill:#f2f0ec}.a{fill:#a88bff}}</style><path class="i" d="M2 4H26V18H22V10H18V28H12V10H8V28H2Z"/><rect class="a" x="20" y="20" width="10" height="8"/></svg>
package/package.json CHANGED
@@ -1,4 +1,86 @@
1
- { "name": "@mistriwork/ui", "version": "0.0.0",
2
- "description": "Reserved for mistri. The first release is coming soon.",
1
+ {
2
+ "name": "@mistriwork/ui",
3
+ "version": "1.0.0-rc.9",
4
+ "description": "The standalone React primitives both shells are drawn with: Modal, DropMenu, Dropdown, Typeahead, Button, Field, Icon and DateField over Base UI, Switch, Tabs, Drawer, Popover, Avatar, Pagination, Carousel, Resizable, ScrollArea and Tooltip, the form controls built on them (text, masked, money and sensitive boxes, listboxes, choices, slider, progress and action bar; Preview), the landing hero's blocks (badge, photo tiles, icon rows; Preview), their tokens and stylesheet, and the zoom-aware ruler their popups are placed by.",
5
+ "homepage": "https://mistriwork.dev",
6
+ "bugs": {
7
+ "url": "https://github.com/rbaljinder/mistri/issues"
8
+ },
3
9
  "license": "MIT",
4
- "repository": { "type": "git", "url": "git+https://github.com/rbaljinder/mistri.git" } }
10
+ "author": "Baljinder Randhawa",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/rbaljinder/mistri.git",
14
+ "directory": "packages/ui"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "mark.svg",
20
+ "LICENSE"
21
+ ],
22
+ "type": "module",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./Avatar.js": "./dist/Avatar.js",
29
+ "./Button.js": "./dist/Button.js",
30
+ "./Carousel.js": "./dist/Carousel.js",
31
+ "./Choices.js": "./dist/Choices.js",
32
+ "./internal/ComponentStyleScope.js": "./dist/internal/ComponentStyleScope.js",
33
+ "./DateField.js": "./dist/DateField.js",
34
+ "./DropMenu.js": "./dist/DropMenu.js",
35
+ "./Drawer.js": "./dist/Drawer.js",
36
+ "./Dropdown.js": "./dist/Dropdown.js",
37
+ "./Field.js": "./dist/Field.js",
38
+ "./FormParts.js": "./dist/FormParts.js",
39
+ "./HeroBlocks.js": "./dist/HeroBlocks.js",
40
+ "./Icon.js": "./dist/Icon.js",
41
+ "./Modal.js": "./dist/Modal.js",
42
+ "./Pagination.js": "./dist/Pagination.js",
43
+ "./Resizable.js": "./dist/Resizable.js",
44
+ "./ScrollArea.js": "./dist/ScrollArea.js",
45
+ "./Popover.js": "./dist/Popover.js",
46
+ "./Select.js": "./dist/Select.js",
47
+ "./SensitiveField.js": "./dist/SensitiveField.js",
48
+ "./Slider.js": "./dist/Slider.js",
49
+ "./TextField.js": "./dist/TextField.js",
50
+ "./Switch.js": "./dist/Switch.js",
51
+ "./Tabs.js": "./dist/Tabs.js",
52
+ "./Typeahead.js": "./dist/Typeahead.js",
53
+ "./Tooltip.js": "./dist/Tooltip.js",
54
+ "./internal/anchor.js": "./dist/internal/anchor.js",
55
+ "./internal/datePickerModel.js": "./dist/internal/datePickerModel.js",
56
+ "./forms.css": "./dist/forms.css",
57
+ "./hero.css": "./dist/hero.css",
58
+ "./preferences.css": "./dist/preferences.css",
59
+ "./internal/popups.js": "./dist/internal/popups.js",
60
+ "./primitives.css": "./dist/primitives.css",
61
+ "./standalone.css": "./dist/standalone.css",
62
+ "./internal/ruler.js": "./dist/internal/ruler.js",
63
+ "./style.css": "./dist/style.css",
64
+ "./tokens.css": "./dist/tokens.css",
65
+ "./package.json": "./package.json"
66
+ },
67
+ "peerDependencies": {
68
+ "@base-ui/react": "^1.8.0",
69
+ "react": "^19.2.0",
70
+ "react-dom": "^19.2.0"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "@base-ui/react": {
74
+ "optional": true
75
+ },
76
+ "react": {
77
+ "optional": true
78
+ },
79
+ "react-dom": {
80
+ "optional": true
81
+ }
82
+ },
83
+ "engines": {
84
+ "node": ">=24.22.1"
85
+ }
86
+ }