@milktop/react-ui 0.1.2 → 0.2.1
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 +57 -6
- package/dist/accordion/Accordion.d.ts +1 -1
- package/dist/accordion/Accordion.js +1 -1
- package/dist/action-bar/ActionBar.d.ts +1 -1
- package/dist/action-bar/ActionBar.js +1 -1
- package/dist/alert/Alert.d.ts +1 -1
- package/dist/alert/Alert.js +1 -1
- package/dist/app-shell/AppShell.d.ts +9 -1
- package/dist/app-shell/AppShell.js +46 -5
- package/dist/app-shell/Topbar.d.ts +1 -1
- package/dist/app-shell/Topbar.js +1 -1
- package/dist/app-shell/app-shell.css +5 -0
- package/dist/app-shell/shell.d.ts +2 -0
- package/dist/appearance-panel/Appearance.d.ts +39 -0
- package/dist/appearance-panel/Appearance.js +74 -0
- package/dist/appearance-panel/appearance.css +17 -0
- package/dist/appearance.d.ts +42 -0
- package/dist/appearance.js +157 -0
- package/dist/attachments/Attachments.d.ts +1 -1
- package/dist/attachments/Attachments.js +1 -1
- package/dist/avatar/Avatar.d.ts +1 -1
- package/dist/avatar/Avatar.js +1 -1
- package/dist/badge/Badge.d.ts +1 -1
- package/dist/badge/Badge.js +1 -1
- package/dist/banner/Banner.d.ts +1 -1
- package/dist/banner/Banner.js +1 -1
- package/dist/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/button/Button.d.ts +3 -2
- package/dist/button/Button.js +1 -1
- package/dist/card/Card.d.ts +2 -2
- package/dist/card/Card.js +1 -1
- package/dist/checkbox/Checkbox.d.ts +1 -1
- package/dist/checkbox/Checkbox.js +1 -1
- package/dist/checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/checkbox/CheckboxGroup.js +1 -1
- package/dist/checkbox/checkbox.css +1 -1
- package/dist/collapsible/Collapsible.d.ts +1 -1
- package/dist/collapsible/Collapsible.js +1 -1
- package/dist/command/Command.d.ts +1 -1
- package/dist/command/Command.js +1 -1
- package/dist/copy-button/CopyButton.d.ts +1 -1
- package/dist/copy-button/CopyButton.js +1 -1
- package/dist/data-list/DataList.d.ts +1 -1
- package/dist/data-list/DataList.js +1 -1
- package/dist/date-picker/DatePicker.d.ts +1 -1
- package/dist/date-picker/DatePicker.js +1 -1
- package/dist/date-picker/date-picker.css +6 -3
- package/dist/dialog/Dialog.d.ts +1 -1
- package/dist/dialog/Dialog.js +1 -1
- package/dist/editable/Editable.d.ts +1 -1
- package/dist/editable/Editable.js +1 -1
- package/dist/editor/Editor.d.ts +1 -1
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/editor.css +2 -1
- package/dist/empty-state/EmptyState.d.ts +1 -1
- package/dist/empty-state/EmptyState.js +1 -1
- package/dist/event-calendar/EventCalendar.d.ts +12 -5
- package/dist/event-calendar/EventCalendar.js +155 -41
- package/dist/event-calendar/event-calendar.css +10 -5
- package/dist/file-upload/FileUpload.d.ts +1 -1
- package/dist/file-upload/FileUpload.js +1 -1
- package/dist/format/messages.d.ts +12 -0
- package/dist/format/messages.js +12 -0
- package/dist/hover-card/hover-card.css +3 -1
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/input/Input.d.ts +1 -1
- package/dist/input/Input.js +1 -1
- package/dist/input/input.css +7 -1
- package/dist/menu/Menu.d.ts +1 -1
- package/dist/menu/Menu.js +1 -1
- package/dist/menu/menu.css +3 -1
- package/dist/native-select/NativeSelect.d.ts +1 -1
- package/dist/native-select/NativeSelect.js +1 -1
- package/dist/native-select/native-select.css +2 -1
- package/dist/number-input/NumberInput.d.ts +1 -1
- package/dist/number-input/NumberInput.js +1 -1
- package/dist/number-input/number-input.css +6 -3
- package/dist/page/Page.d.ts +4 -0
- package/dist/page/Page.js +4 -2
- package/dist/pagination/Pagination.d.ts +1 -1
- package/dist/pagination/Pagination.js +1 -1
- package/dist/password-input/PasswordInput.d.ts +1 -1
- package/dist/password-input/PasswordInput.js +1 -1
- package/dist/password-input/password-input.css +6 -3
- package/dist/pin-input/pin-input.css +2 -1
- package/dist/popover/Popover.d.ts +1 -1
- package/dist/popover/Popover.js +1 -1
- package/dist/popover/popover.css +3 -1
- package/dist/radio-group/RadioGroup.d.ts +1 -1
- package/dist/radio-group/RadioGroup.js +1 -1
- package/dist/radio-group/radio-group.css +1 -1
- package/dist/segment-group/Segmented.d.ts +1 -1
- package/dist/segment-group/Segmented.js +1 -1
- package/dist/select/ListSelect.d.ts +1 -1
- package/dist/select/ListSelect.js +1 -1
- package/dist/select/SearchSelect.d.ts +1 -1
- package/dist/select/SearchSelect.js +1 -1
- package/dist/select/search-select.css +6 -3
- package/dist/select/select.css +5 -2
- package/dist/sheet/Sheet.d.ts +1 -1
- package/dist/sheet/Sheet.js +1 -1
- package/dist/sidebar/NavGroup.d.ts +3 -2
- package/dist/sidebar/NavGroup.js +14 -4
- package/dist/sidebar/NavItem.d.ts +1 -1
- package/dist/sidebar/NavItem.js +1 -1
- package/dist/sidebar/NavSection.d.ts +1 -1
- package/dist/sidebar/NavSection.js +1 -1
- package/dist/sidebar/Sidebar.d.ts +1 -1
- package/dist/sidebar/Sidebar.js +1 -1
- package/dist/sidebar/SidebarUser.d.ts +1 -1
- package/dist/sidebar/SidebarUser.js +1 -1
- package/dist/sidebar/sidebar.css +75 -14
- package/dist/sortable-list/SortableList.d.ts +1 -1
- package/dist/sortable-list/SortableList.js +1 -1
- package/dist/stat/Stat.d.ts +1 -1
- package/dist/stat/Stat.js +1 -1
- package/dist/swatch-picker/SwatchPicker.d.ts +1 -1
- package/dist/swatch-picker/SwatchPicker.js +1 -1
- package/dist/swatch-picker/swatch-picker.css +3 -2
- package/dist/table/Table.d.ts +1 -1
- package/dist/table/Table.js +1 -1
- package/dist/tabs/Tabs.d.ts +1 -1
- package/dist/tabs/Tabs.js +1 -1
- package/dist/tags-input/TagsInput.d.ts +1 -1
- package/dist/tags-input/TagsInput.js +1 -1
- package/dist/tags-input/tags-input.css +6 -3
- package/dist/textarea/textarea.css +2 -1
- package/dist/theme-toggle/ThemeToggle.d.ts +1 -1
- package/dist/theme-toggle/ThemeToggle.js +1 -1
- package/dist/theme.css +51 -10
- package/dist/timeline/Timeline.d.ts +1 -1
- package/dist/timeline/Timeline.js +1 -1
- package/dist/toast/Toaster.d.ts +1 -1
- package/dist/toast/Toaster.js +1 -1
- package/dist/tooltip/tooltip.css +3 -1
- package/dist/tree-view/TreeView.d.ts +1 -1
- package/dist/tree-view/TreeView.js +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// The app's accent colour and sidebar style, chosen by its users (with
|
|
2
|
+
// <Appearance>) or set in code, saved like colorScheme:
|
|
3
|
+
//
|
|
4
|
+
// import { appearance, useAppearance } from '@milktop/react-ui'
|
|
5
|
+
// appearance.defaults = { accent: 'teal', sidebar: 'neutral' }
|
|
6
|
+
// appearance.update({ accent: 'violet', sidebar: 'dark' })
|
|
7
|
+
// appearance.load(user.appearance) // a saved choice, e.g. from the server
|
|
8
|
+
// appearance.onChange = (value) => save(value)
|
|
9
|
+
// const { accent, custom, sidebar } = useAppearance() // re-renders on change
|
|
10
|
+
//
|
|
11
|
+
// - `accent`: a name from `accents` (Tailwind's scales, each 600 taking white
|
|
12
|
+
// text), or `custom`: any hex colour, its scale worked out in the browser
|
|
13
|
+
// (CSS relative colours keep its hue), e.g. to try a brand colour
|
|
14
|
+
// - `sidebar`: a name from `sidebarStyles`, light mode only (dark keeps its
|
|
15
|
+
// own layers). 'default' leaves the theme's sidebar as it is.
|
|
16
|
+
// - `defaults`: what a visitor with nothing saved gets, and what `reset`
|
|
17
|
+
// goes back to
|
|
18
|
+
// - `update(changes)` sets and saves them and calls `onChange` with `value`
|
|
19
|
+
// ({ accent, custom, sidebar }); `load(value)` applies a saved one without
|
|
20
|
+
// calling it
|
|
21
|
+
// - `restrict(accents, sidebars)` moves a choice outside those lists to their
|
|
22
|
+
// first item (<Appearance> does this with its own lists); a custom colour
|
|
23
|
+
// stays only when it's the default
|
|
24
|
+
//
|
|
25
|
+
// The accent becomes the --ui-accent-50 … -950 scale on <html>, which the
|
|
26
|
+
// accent tokens are steps of (see theme.css); the sidebar style is
|
|
27
|
+
// `data-ui-sidebar-style` there (its styles are in sidebar.css). Saved in
|
|
28
|
+
// localStorage (`storageKey`), scale included, so a script in the page's
|
|
29
|
+
// <head> can paint it before the bundle loads (see the README).
|
|
30
|
+
import { useSyncExternalStore } from 'react';
|
|
31
|
+
export const accentSteps = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
32
|
+
// [the scale, the text on its 500 (dark mode's accent)]
|
|
33
|
+
export const accents = {
|
|
34
|
+
slate: [['#f8fafc', '#f1f5f9', '#e2e8f0', '#cbd5e1', '#94a3b8', '#64748b', '#475569', '#334155', '#1e293b', '#0f172a', '#020617'], 'white'],
|
|
35
|
+
blue: [['#eff6ff', '#dbeafe', '#bfdbfe', '#93c5fd', '#60a5fa', '#3b82f6', '#2563eb', '#1d4ed8', '#1e40af', '#1e3a8a', '#172554'], 'white'],
|
|
36
|
+
indigo: [['#eef2ff', '#e0e7ff', '#c7d2fe', '#a5b4fc', '#818cf8', '#6366f1', '#4f46e5', '#4338ca', '#3730a3', '#312e81', '#1e1b4b'], 'white'],
|
|
37
|
+
violet: [['#f5f3ff', '#ede9fe', '#ddd6fe', '#c4b5fd', '#a78bfa', '#8b5cf6', '#7c3aed', '#6d28d9', '#5b21b6', '#4c1d95', '#2e1065'], 'white'],
|
|
38
|
+
teal: [['#f0fdfa', '#ccfbf1', '#99f6e4', '#5eead4', '#2dd4bf', '#14b8a6', '#0d9488', '#0f766e', '#115e59', '#134e4a', '#042f2e'], '#042f2e'],
|
|
39
|
+
emerald: [['#ecfdf5', '#d1fae5', '#a7f3d0', '#6ee7b7', '#34d399', '#10b981', '#059669', '#047857', '#065f46', '#064e3b', '#022c22'], '#022c22'],
|
|
40
|
+
rose: [['#fff1f2', '#ffe4e6', '#fecdd3', '#fda4af', '#fb7185', '#f43f5e', '#e11d48', '#be123c', '#9f1239', '#881337', '#4c0519'], 'white'],
|
|
41
|
+
};
|
|
42
|
+
export const sidebarStyles = ['default', 'neutral', 'soft', 'tint', 'accent', 'dark', 'deep'];
|
|
43
|
+
// Old names still accepted, e.g. from a saved choice
|
|
44
|
+
const sidebarAliases = { 'neutral-accent': 'neutral' };
|
|
45
|
+
// Lightness and share of the colour's chroma per step, for a custom colour.
|
|
46
|
+
const ramp = [[0.98, 0.15], [0.95, 0.3], [0.9, 0.5], [0.83, 0.7], [0.74, 0.9], [0.65, 1], [0.56, 1], [0.48, 0.9], [0.4, 0.75], [0.33, 0.6], [0.23, 0.45]];
|
|
47
|
+
// A custom colour's scale, as CSS relative colours.
|
|
48
|
+
export const accentScale = (hex) => ramp.map(([l, c]) => `oklch(from ${hex} ${l} calc(c * ${c}) h)`);
|
|
49
|
+
const isHex = (v) => typeof v === 'string' && /^#[0-9a-f]{6}$/i.test(v);
|
|
50
|
+
// Only known accents and sidebar styles, and hex colours.
|
|
51
|
+
function pick(value) {
|
|
52
|
+
const out = {};
|
|
53
|
+
if (!value || typeof value !== 'object')
|
|
54
|
+
return out;
|
|
55
|
+
const { accent, custom, sidebar } = value;
|
|
56
|
+
if (typeof accent === 'string' && accent in accents)
|
|
57
|
+
out.accent = accent;
|
|
58
|
+
if (custom === null || isHex(custom))
|
|
59
|
+
out.custom = custom;
|
|
60
|
+
const style = typeof sidebar === 'string' ? sidebarAliases[sidebar] ?? sidebar : null;
|
|
61
|
+
if (sidebarStyles.includes(style))
|
|
62
|
+
out.sidebar = style;
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
class Appearance {
|
|
66
|
+
#key = 'ui-appearance';
|
|
67
|
+
#defaults = { accent: 'blue', custom: null, sidebar: 'default' };
|
|
68
|
+
#value = { ...this.#defaults };
|
|
69
|
+
#listeners = new Set();
|
|
70
|
+
onChange = null;
|
|
71
|
+
constructor() {
|
|
72
|
+
if (typeof document === 'undefined')
|
|
73
|
+
return;
|
|
74
|
+
addEventListener('storage', (e) => { if (e.key === this.#key)
|
|
75
|
+
this.#reload(); });
|
|
76
|
+
this.#reload();
|
|
77
|
+
}
|
|
78
|
+
get storageKey() { return this.#key; }
|
|
79
|
+
// Set it before the page reads a value (it reloads the saved choice).
|
|
80
|
+
set storageKey(key) {
|
|
81
|
+
this.#key = key;
|
|
82
|
+
this.#reload();
|
|
83
|
+
}
|
|
84
|
+
get defaults() { return this.#defaults; }
|
|
85
|
+
set defaults(value) {
|
|
86
|
+
this.#defaults = { ...this.#defaults, custom: null, ...pick(value) };
|
|
87
|
+
this.#reload();
|
|
88
|
+
}
|
|
89
|
+
// { accent, custom, sidebar }: a new object on every change.
|
|
90
|
+
get value() { return this.#value; }
|
|
91
|
+
get accent() { return this.#value.accent; }
|
|
92
|
+
get custom() { return this.#value.custom; }
|
|
93
|
+
get sidebar() { return this.#value.sidebar; }
|
|
94
|
+
// The scale showing: [50 … 950] colours, and the text on the 500.
|
|
95
|
+
get scale() { return this.custom ? accentScale(this.custom) : accents[this.accent][0]; }
|
|
96
|
+
get scaleText() { return this.custom ? 'white' : accents[this.accent][1]; }
|
|
97
|
+
update(changes) {
|
|
98
|
+
this.#set(changes);
|
|
99
|
+
this.onChange?.(this.#value);
|
|
100
|
+
}
|
|
101
|
+
load(value) {
|
|
102
|
+
this.#set(value);
|
|
103
|
+
}
|
|
104
|
+
reset() { this.update(this.#defaults); }
|
|
105
|
+
restrict(allowedAccents, allowedSidebars) {
|
|
106
|
+
const fix = {};
|
|
107
|
+
// A custom colour stays only if it's the app's own default
|
|
108
|
+
const customOk = this.custom && this.custom === this.#defaults.custom;
|
|
109
|
+
if (allowedAccents?.length && !customOk && (this.custom || !allowedAccents.includes(this.accent))) {
|
|
110
|
+
fix.accent = allowedAccents[0];
|
|
111
|
+
fix.custom = null;
|
|
112
|
+
}
|
|
113
|
+
if (allowedSidebars?.length && !allowedSidebars.includes(this.sidebar))
|
|
114
|
+
fix.sidebar = allowedSidebars[0];
|
|
115
|
+
if (Object.keys(fix).length)
|
|
116
|
+
this.load(fix);
|
|
117
|
+
}
|
|
118
|
+
subscribe = (listener) => {
|
|
119
|
+
this.#listeners.add(listener);
|
|
120
|
+
return () => { this.#listeners.delete(listener); };
|
|
121
|
+
};
|
|
122
|
+
#reload() {
|
|
123
|
+
let saved = {};
|
|
124
|
+
try {
|
|
125
|
+
saved = JSON.parse(localStorage.getItem(this.#key) ?? '{}');
|
|
126
|
+
}
|
|
127
|
+
catch { /* private mode, or not JSON */ }
|
|
128
|
+
this.#value = { ...this.#defaults, ...pick(saved) };
|
|
129
|
+
this.#apply();
|
|
130
|
+
}
|
|
131
|
+
#set(changes) {
|
|
132
|
+
this.#value = { ...this.#value, ...pick(changes) };
|
|
133
|
+
this.#apply();
|
|
134
|
+
try {
|
|
135
|
+
localStorage.setItem(this.#key, JSON.stringify({ scale: this.scale, scaleText: this.scaleText, ...this.#value }));
|
|
136
|
+
}
|
|
137
|
+
catch { /* private mode */ }
|
|
138
|
+
}
|
|
139
|
+
#apply() {
|
|
140
|
+
if (typeof document === 'undefined')
|
|
141
|
+
return;
|
|
142
|
+
const root = document.documentElement;
|
|
143
|
+
this.scale.forEach((color, i) => root.style.setProperty(`--ui-accent-${accentSteps[i]}`, color));
|
|
144
|
+
root.style.setProperty('--ui-accent-500-text', this.scaleText);
|
|
145
|
+
if (this.sidebar === 'default')
|
|
146
|
+
delete root.dataset.uiSidebarStyle;
|
|
147
|
+
else
|
|
148
|
+
root.dataset.uiSidebarStyle = this.sidebar;
|
|
149
|
+
this.#listeners.forEach((listener) => listener());
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
export const appearance = new Appearance();
|
|
153
|
+
const serverValue = { accent: 'blue', custom: null, sidebar: 'default' };
|
|
154
|
+
// The current choice, re-rendering when it changes.
|
|
155
|
+
export function useAppearance() {
|
|
156
|
+
return useSyncExternalStore(appearance.subscribe, () => appearance.value, () => serverValue);
|
|
157
|
+
}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* a new tab. Files with a `url` get a download button.
|
|
38
38
|
*/
|
|
39
39
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
40
|
-
import '
|
|
40
|
+
import '../icons.js';
|
|
41
41
|
import { type Classes } from '../utils.js';
|
|
42
42
|
import '../theme.css';
|
|
43
43
|
import './attachments.css';
|
|
@@ -40,7 +40,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
40
40
|
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
41
41
|
import { createFileTypeValidator, getAcceptAttrString, getFileKey } from '@zag-js/file-utils';
|
|
42
42
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
43
|
-
import '
|
|
43
|
+
import '../icons.js';
|
|
44
44
|
import { Dialog } from '../dialog/Dialog.js';
|
|
45
45
|
import { formatBytes } from '../format/format.js';
|
|
46
46
|
import { useLocale, useMessages } from '../format/LocaleProvider.js';
|
package/dist/avatar/Avatar.d.ts
CHANGED
package/dist/avatar/Avatar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar as Ark } from '@ark-ui/react/avatar';
|
|
3
|
-
import '
|
|
3
|
+
import '../icons.js';
|
|
4
4
|
import { Tooltip } from '../tooltip/Tooltip.js';
|
|
5
5
|
import { cx, partsOf, withParts } from '../utils.js';
|
|
6
6
|
import { useMessages } from '../format/LocaleProvider.js';
|
package/dist/badge/Badge.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* filter, a record's label); `removeLabel` names it ('Remove …')
|
|
11
11
|
*/
|
|
12
12
|
import type { ComponentProps } from 'react';
|
|
13
|
-
import '
|
|
13
|
+
import '../icons.js';
|
|
14
14
|
import { type Classes } from '../utils.js';
|
|
15
15
|
import '../theme.css';
|
|
16
16
|
import './badge.css';
|
package/dist/badge/Badge.js
CHANGED
package/dist/banner/Banner.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - `full`: no rounding, to run edge to edge
|
|
15
15
|
*/
|
|
16
16
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
17
|
-
import '
|
|
17
|
+
import '../icons.js';
|
|
18
18
|
import { type Classes } from '../utils.js';
|
|
19
19
|
import '../theme.css';
|
|
20
20
|
import './banner.css';
|
package/dist/banner/Banner.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* the crumb and the props to spread on it: `(item, props) => <Link to={item.href} {...props} />`
|
|
13
13
|
*/
|
|
14
14
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
15
|
-
import '
|
|
15
|
+
import '../icons.js';
|
|
16
16
|
import { type Classes } from '../utils.js';
|
|
17
17
|
import '../theme.css';
|
|
18
18
|
import './breadcrumbs.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import '
|
|
2
|
+
import '../icons.js';
|
|
3
3
|
import { Menu } from '../menu/Menu.js';
|
|
4
4
|
import { cx, partsOf } from '../utils.js';
|
|
5
5
|
import { useMessages } from '../format/LocaleProvider.js';
|
package/dist/button/Button.d.ts
CHANGED
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
* - `count`: a badge on the corner (hidden at 0 or null), "99+" past `max`
|
|
13
13
|
* - `dot`: a small dot there instead, for "something new"
|
|
14
14
|
* - `pulse`: a ring ripples out from the badge or dot (not when the system asks for less motion)
|
|
15
|
-
* - `countColor`: 'danger', 'accent', 'success', 'warning' or 'neutral'
|
|
15
|
+
* - `countColor`: 'danger', 'accent', 'success', 'warning' or 'neutral', for the
|
|
16
|
+
* dot too; or set `--ui-button-count-bg` and `--ui-button-count-text` in CSS for any other
|
|
16
17
|
* - `countLabel`: what the count is, for assistive tech ('new': "Inbox, 3 new")
|
|
17
18
|
* - `type`: 'button' by default (pass 'submit' for forms)
|
|
18
19
|
*/
|
|
19
20
|
import type { ComponentProps } from 'react';
|
|
20
|
-
import '
|
|
21
|
+
import '../icons.js';
|
|
21
22
|
import { type Classes } from '../utils.js';
|
|
22
23
|
import '../theme.css';
|
|
23
24
|
import './button.css';
|
package/dist/button/Button.js
CHANGED
package/dist/card/Card.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* </Card>
|
|
28
28
|
*/
|
|
29
29
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
30
|
-
import '
|
|
30
|
+
import '../icons.js';
|
|
31
31
|
import { type Classes } from '../utils.js';
|
|
32
32
|
import '../theme.css';
|
|
33
33
|
import './card.css';
|
|
@@ -61,10 +61,10 @@ declare function CardShortcut({ heading, description, icon, actions, footer, var
|
|
|
61
61
|
'data-link': string | undefined;
|
|
62
62
|
'data-scope': string;
|
|
63
63
|
'data-part': string;
|
|
64
|
+
key?: import("react").Key | null | undefined;
|
|
64
65
|
slot?: string | undefined | undefined;
|
|
65
66
|
style?: import("react").CSSProperties | undefined;
|
|
66
67
|
ref?: import("react").Ref<HTMLDivElement> | undefined;
|
|
67
|
-
key?: import("react").Key | null | undefined;
|
|
68
68
|
defaultChecked?: boolean | undefined | undefined;
|
|
69
69
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
70
70
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
package/dist/card/Card.js
CHANGED
|
@@ -28,7 +28,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
28
28
|
* </Card>
|
|
29
29
|
*/
|
|
30
30
|
import { Children, createElement, isValidElement } from 'react';
|
|
31
|
-
import '
|
|
31
|
+
import '../icons.js';
|
|
32
32
|
import { cx, partOf, partsOf, withParts } from '../utils.js';
|
|
33
33
|
import '../theme.css';
|
|
34
34
|
import './card.css';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { ReactNode } from 'react';
|
|
26
26
|
import { Checkbox as Ark, type CheckboxCheckedChangeDetails } from '@ark-ui/react/checkbox';
|
|
27
|
-
import '
|
|
27
|
+
import '../icons.js';
|
|
28
28
|
import { type Classes, type Slot } from '../utils.js';
|
|
29
29
|
import '../theme.css';
|
|
30
30
|
import './checkbox.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox as Ark } from '@ark-ui/react/checkbox';
|
|
3
|
-
import '
|
|
3
|
+
import '../icons.js';
|
|
4
4
|
import { cx, on, partsOf, slot, withParts } from '../utils.js';
|
|
5
5
|
import '../theme.css';
|
|
6
6
|
import './checkbox.css';
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Shift-clicking a checkbox ticks (or clears) every item between it and the
|
|
19
19
|
* last one clicked, as in mail and file lists.
|
|
20
20
|
*/
|
|
21
|
-
import '
|
|
21
|
+
import '../icons.js';
|
|
22
22
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
23
23
|
import { type Classes } from '../utils.js';
|
|
24
24
|
import '../theme.css';
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
* Shift-clicking a checkbox ticks (or clears) every item between it and the
|
|
20
20
|
* last one clicked, as in mail and file lists.
|
|
21
21
|
*/
|
|
22
|
-
import '
|
|
22
|
+
import '../icons.js';
|
|
23
23
|
import { useId, useRef } from 'react';
|
|
24
24
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
25
25
|
import { Checkbox } from './Checkbox.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
color: var(--ui-text); font-family: var(--ui-font); font-size: 14px;
|
|
4
4
|
&[data-disabled] { opacity: 0.5; cursor: not-allowed; } }
|
|
5
5
|
[data-scope=checkbox][data-part=control] { display: grid; place-items: center; flex-shrink: 0; width: 1rem; height: 1rem; box-sizing: border-box;
|
|
6
|
-
background: var(--ui-
|
|
6
|
+
background: var(--ui-field-bg); border: 1px solid var(--ui-field-border); border-radius: calc(var(--ui-radius) - 2px); color: var(--ui-accent-text);
|
|
7
7
|
&:is([data-state=checked], [data-state=indeterminate]) { background: var(--ui-accent); border-color: var(--ui-accent); }
|
|
8
8
|
&[data-focus-visible] { outline: 2px solid var(--ui-ring-soft); border-color: var(--ui-ring); }
|
|
9
9
|
&[data-invalid] { border-color: var(--ui-danger); } }
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { ReactElement, ReactNode } from 'react';
|
|
21
21
|
import { Collapsible as Ark, type CollapsibleOpenChangeDetails } from '@ark-ui/react/collapsible';
|
|
22
|
-
import '
|
|
22
|
+
import '../icons.js';
|
|
23
23
|
import { type Classes } from '../utils.js';
|
|
24
24
|
import '../theme.css';
|
|
25
25
|
import './collapsible.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Collapsible as Ark } from '@ark-ui/react/collapsible';
|
|
3
|
-
import '
|
|
3
|
+
import '../icons.js';
|
|
4
4
|
import { cx, on, partsOf, withParts } from '../utils.js';
|
|
5
5
|
import '../theme.css';
|
|
6
6
|
import './collapsible.css';
|
package/dist/command/Command.js
CHANGED
|
@@ -30,7 +30,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
30
30
|
import { Dialog } from '@ark-ui/react/dialog';
|
|
31
31
|
import { Listbox, createListCollection, useListbox } from '@ark-ui/react/listbox';
|
|
32
32
|
import { Portal } from '@ark-ui/react/portal';
|
|
33
|
-
import '
|
|
33
|
+
import '../icons.js';
|
|
34
34
|
import { cx, partsOf, useControllable } from '../utils.js';
|
|
35
35
|
import { useMessages } from '../format/LocaleProvider.js';
|
|
36
36
|
import '../theme.css';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* (Clipboard.Root, Trigger, Indicator…) from '@ark-ui/react/clipboard'.
|
|
15
15
|
*/
|
|
16
16
|
import type { ComponentProps } from 'react';
|
|
17
|
-
import '
|
|
17
|
+
import '../icons.js';
|
|
18
18
|
import { type Classes } from '../utils.js';
|
|
19
19
|
import '../theme.css';
|
|
20
20
|
import './copy-button.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Clipboard, useClipboard } from '@ark-ui/react/clipboard';
|
|
3
|
-
import '
|
|
3
|
+
import '../icons.js';
|
|
4
4
|
import { cx, partsOf } from '../utils.js';
|
|
5
5
|
import { useMessages } from '../format/LocaleProvider.js';
|
|
6
6
|
import '../theme.css';
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* text in a tooltip; its content is the value
|
|
24
24
|
*/
|
|
25
25
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
26
|
-
import '
|
|
26
|
+
import '../icons.js';
|
|
27
27
|
import { type Classes } from '../utils.js';
|
|
28
28
|
import '../theme.css';
|
|
29
29
|
import './data-list.css';
|
|
@@ -24,7 +24,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
24
24
|
* text in a tooltip; its content is the value
|
|
25
25
|
*/
|
|
26
26
|
import { createContext, useContext } from 'react';
|
|
27
|
-
import '
|
|
27
|
+
import '../icons.js';
|
|
28
28
|
import { Tooltip } from '../tooltip/Tooltip.js';
|
|
29
29
|
import { cx, partsOf, withParts } from '../utils.js';
|
|
30
30
|
import '../theme.css';
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { type ReactElement, type ReactNode } from 'react';
|
|
39
39
|
import { DatePicker as Ark, parseDate, type DatePickerValueChangeDetails, type DateValue } from '@ark-ui/react/date-picker';
|
|
40
|
-
import '
|
|
40
|
+
import '../icons.js';
|
|
41
41
|
import { type Classes } from '../utils.js';
|
|
42
42
|
import '../theme.css';
|
|
43
43
|
import './date-picker.css';
|
|
@@ -41,7 +41,7 @@ import { DatePicker as Ark, parseDate, useDatePicker } from '@ark-ui/react/date-
|
|
|
41
41
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
42
42
|
import { DateFormatter, getLocalTimeZone, today } from '@internationalized/date';
|
|
43
43
|
import { parseDateString } from '@zag-js/date-utils';
|
|
44
|
-
import '
|
|
44
|
+
import '../icons.js';
|
|
45
45
|
import { useLocale, useMessages } from '../format/LocaleProvider.js';
|
|
46
46
|
import { cx, partsOf, useControllable, withParts } from '../utils.js';
|
|
47
47
|
import '../theme.css';
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
&[data-inline] { width: fit-content; } }
|
|
8
8
|
[data-scope=date-picker][data-part=label] { display: block; font-size: 14px; font-weight: 500; margin-bottom: 0.375rem; }
|
|
9
9
|
[data-scope=date-picker][data-part=control] { display: flex; align-items: center; gap: 0.25rem; padding: 0 0.5rem;
|
|
10
|
-
height: var(--ui-control-height); box-sizing: border-box; background: var(--ui-
|
|
11
|
-
border: 1px solid var(--ui-border); border-radius: var(--ui-radius);
|
|
10
|
+
height: var(--ui-control-height); box-sizing: border-box; background: var(--ui-field-bg);
|
|
11
|
+
border: 1px solid var(--ui-field-border); border-radius: var(--ui-radius);
|
|
12
|
+
&:hover { border-color: var(--ui-field-border-hover); }
|
|
12
13
|
&:focus-within { border-color: var(--ui-ring); outline: 2px solid var(--ui-ring-soft); }
|
|
13
14
|
&[data-invalid], &:has([aria-invalid=true]) { border-color: var(--ui-danger); }
|
|
14
15
|
&[data-disabled] { opacity: 0.5; } }
|
|
@@ -23,7 +24,9 @@
|
|
|
23
24
|
border-radius: 4px; color: var(--ui-muted); cursor: pointer;
|
|
24
25
|
&:hover { background: var(--ui-hover); color: var(--ui-text); } }
|
|
25
26
|
|
|
26
|
-
/*
|
|
27
|
+
/* The positioner carries the z-index itself. Zag sets it inline as
|
|
28
|
+
var(--z-index) but doesn't always fill in the variable, so set both. */
|
|
29
|
+
[data-scope=date-picker][data-part=positioner] { z-index: 50; --z-index: 50; }
|
|
27
30
|
[data-scope=date-picker][data-part=content] { z-index: 50; padding: 0.75rem; background: var(--ui-surface); outline: none;
|
|
28
31
|
border: 1px solid var(--ui-border); border-radius: calc(var(--ui-radius) + 2px); box-shadow: var(--ui-shadow);
|
|
29
32
|
/* An inline calendar in a popover (EventCalendar's date jump): the popover is the card. */
|
package/dist/dialog/Dialog.d.ts
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
*/
|
|
51
51
|
import { type ComponentProps, type ReactElement, type ReactNode } from 'react';
|
|
52
52
|
import { Dialog as Ark, type DialogOpenChangeDetails } from '@ark-ui/react/dialog';
|
|
53
|
-
import '
|
|
53
|
+
import '../icons.js';
|
|
54
54
|
import { type Classes } from '../utils.js';
|
|
55
55
|
import '../theme.css';
|
|
56
56
|
import './dialog.css';
|
package/dist/dialog/Dialog.js
CHANGED
|
@@ -52,7 +52,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
52
52
|
import { Children, isValidElement } from 'react';
|
|
53
53
|
import { Dialog as Ark } from '@ark-ui/react/dialog';
|
|
54
54
|
import { Portal } from '@ark-ui/react/portal';
|
|
55
|
-
import '
|
|
55
|
+
import '../icons.js';
|
|
56
56
|
import { cx, on, partOf, partsOf, withParts } from '../utils.js';
|
|
57
57
|
import { useMessages } from '../format/LocaleProvider.js';
|
|
58
58
|
import '../theme.css';
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type ReactNode } from 'react';
|
|
20
20
|
import { Editable as Ark } from '@ark-ui/react/editable';
|
|
21
|
-
import '
|
|
21
|
+
import '../icons.js';
|
|
22
22
|
import { type Classes } from '../utils.js';
|
|
23
23
|
import '../theme.css';
|
|
24
24
|
import './editable.css';
|
|
@@ -20,7 +20,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
20
20
|
import { useState } from 'react';
|
|
21
21
|
import { Editable as Ark } from '@ark-ui/react/editable';
|
|
22
22
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
23
|
-
import '
|
|
23
|
+
import '../icons.js';
|
|
24
24
|
import { cx, partsOf, withParts } from '../utils.js';
|
|
25
25
|
import { useMessages } from '../format/LocaleProvider.js';
|
|
26
26
|
import '../theme.css';
|
package/dist/editor/Editor.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { type HTMLAttributes, type ReactNode, type RefObject } from 'react';
|
|
29
29
|
import { Editor as TipTap } from '@tiptap/core';
|
|
30
|
-
import '
|
|
30
|
+
import '../icons.js';
|
|
31
31
|
import { type Classes } from '../utils.js';
|
|
32
32
|
import '../theme.css';
|
|
33
33
|
import './editor.css';
|
package/dist/editor/Editor.js
CHANGED
|
@@ -31,7 +31,7 @@ import { Editor as TipTap } from '@tiptap/core';
|
|
|
31
31
|
import StarterKit from '@tiptap/starter-kit';
|
|
32
32
|
import { Placeholder, CharacterCount } from '@tiptap/extensions';
|
|
33
33
|
import { useFieldContext } from '@ark-ui/react/field';
|
|
34
|
-
import '
|
|
34
|
+
import '../icons.js';
|
|
35
35
|
import { RichImage } from './image.js';
|
|
36
36
|
import { Popover } from '../popover/Popover.js';
|
|
37
37
|
import { Input } from '../input/Input.js';
|
package/dist/editor/editor.css
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
@layer ui {
|
|
2
2
|
[data-scope=editor][data-part=label] { display: block; margin-bottom: 0.375rem; font-size: 14px; font-weight: 500; color: var(--ui-text); font-family: var(--ui-font); }
|
|
3
3
|
[data-scope=editor][data-part=root] { display: block; position: relative; width: 100%; min-width: 0; box-sizing: border-box;
|
|
4
|
-
background: var(--ui-
|
|
4
|
+
background: var(--ui-field-bg); border: 1px solid var(--ui-field-border); border-radius: var(--ui-radius);
|
|
5
5
|
color: var(--ui-text); font-family: var(--ui-font); font-size: 14px;
|
|
6
|
+
&:hover { border-color: var(--ui-field-border-hover); }
|
|
6
7
|
&[data-focused] { border-color: var(--ui-ring); outline: 2px solid var(--ui-ring-soft); }
|
|
7
8
|
&[data-invalid] { border-color: var(--ui-danger); }
|
|
8
9
|
&[data-disabled] { background: var(--ui-hover); } }
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - the content: actions, e.g. a button to create the first item
|
|
10
10
|
*/
|
|
11
11
|
import type { ComponentProps, ReactNode } from 'react';
|
|
12
|
-
import '
|
|
12
|
+
import '../icons.js';
|
|
13
13
|
import { type Classes } from '../utils.js';
|
|
14
14
|
import '../theme.css';
|
|
15
15
|
import './empty-state.css';
|