@zeyolabs/ui 0.0.0-stage → 2026.11.5
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 +43 -2
- package/back-button/BackButton.svelte +26 -0
- package/badge/Badge.svelte +73 -0
- package/badge/PromoBadge.svelte +319 -0
- package/badge/color.ts +10 -0
- package/bar/Bar.svelte +63 -0
- package/base.css +47 -0
- package/boundary/Boundary.svelte +59 -0
- package/boundary/BoundaryFailed.svelte +40 -0
- package/boundary/PendingTracker.svelte +14 -0
- package/boundary/pending-context.ts +15 -0
- package/boundary/pending-flag.svelte.ts +33 -0
- package/boundary/report-boundary-error.ts +13 -0
- package/card/Card.svelte +239 -0
- package/card/CardBody.svelte +41 -0
- package/card/CardFooter.svelte +36 -0
- package/card/CardHeader.svelte +36 -0
- package/copy/CopyArea.svelte +37 -0
- package/copy/CopyButton.svelte +59 -0
- package/copy/copy-state.svelte.ts +23 -0
- package/copy/types.ts +1 -0
- package/dialog/ConfirmDialog.svelte +61 -0
- package/dialog/Dialog.svelte +31 -0
- package/dialog/DialogBody.svelte +88 -0
- package/dialog/DialogCloseButton.svelte +26 -0
- package/dialog/DialogFooter.svelte +23 -0
- package/dialog/DialogTrigger.svelte +15 -0
- package/distribution-bar/DistributionBar.svelte +37 -0
- package/drawer/Drawer.svelte +31 -0
- package/drawer/DrawerBody.svelte +61 -0
- package/empty-state/EmptyState.svelte +74 -0
- package/error/ErrorPage.svelte +54 -0
- package/eyebrow/Eyebrow.svelte +10 -0
- package/faq/FAQList.svelte +89 -0
- package/filter/FilterChipGroup.svelte +78 -0
- package/filter/FilterOptionList.svelte +188 -0
- package/filter/FilterPopover.svelte +122 -0
- package/filter/filter-draft.svelte.ts +25 -0
- package/form/Button.svelte +73 -0
- package/form/Field.svelte +111 -0
- package/form/FieldLabel.svelte +19 -0
- package/form/Form.svelte +133 -0
- package/form/PhoneField.svelte +214 -0
- package/form/UnsavedBar.svelte +22 -0
- package/form/field-view.svelte.ts +213 -0
- package/form/fields/CheckboxField.svelte +85 -0
- package/form/fields/Combobox.svelte +327 -0
- package/form/fields/ComboboxAction.svelte +16 -0
- package/form/fields/DateField.svelte +31 -0
- package/form/fields/DateRangeField.svelte +188 -0
- package/form/fields/DateRangePresetField.svelte +119 -0
- package/form/fields/EmailField.svelte +63 -0
- package/form/fields/FileField.svelte +145 -0
- package/form/fields/HexColorField.svelte +83 -0
- package/form/fields/IntervalField.svelte +100 -0
- package/form/fields/MessageField.svelte +99 -0
- package/form/fields/NumberField.svelte +64 -0
- package/form/fields/Option.svelte +48 -0
- package/form/fields/OptionRegistrar.svelte +15 -0
- package/form/fields/PasswordField.svelte +44 -0
- package/form/fields/RadioField.svelte +60 -0
- package/form/fields/RichTextField.svelte +221 -0
- package/form/fields/SelectField.svelte +216 -0
- package/form/fields/SliderField.svelte +182 -0
- package/form/fields/SwitchField.svelte +102 -0
- package/form/fields/TextField.svelte +72 -0
- package/form/fields/TimeField.svelte +31 -0
- package/form/fields/index.ts +19 -0
- package/form/fields/select-field-context.ts +21 -0
- package/form/index.ts +21 -0
- package/form/primitives/Checkbox.svelte +103 -0
- package/form/primitives/DateInput.svelte +51 -0
- package/form/primitives/IconInputWrapper.svelte +40 -0
- package/form/primitives/Input.svelte +47 -0
- package/form/primitives/SearchBar.svelte +37 -0
- package/form/primitives/Select.svelte +139 -0
- package/form/primitives/TextArea.svelte +51 -0
- package/form/primitives/index.ts +6 -0
- package/gallery/ImageGallery.svelte +133 -0
- package/gallery/flickity-fullscreen.d.ts +2 -0
- package/grouped-grid/GroupedGrid.svelte +143 -0
- package/grouped-grid/types.ts +25 -0
- package/layout/Cluster.svelte +92 -0
- package/layout/Container.svelte +9 -0
- package/layout/Grid.svelte +131 -0
- package/layout/Section.svelte +146 -0
- package/layout/Shell.svelte +32 -0
- package/layout/SplitShell.svelte +47 -0
- package/layout/Stack.svelte +78 -0
- package/list-row/ListRow.svelte +77 -0
- package/menu/MenuButton.svelte +101 -0
- package/mini-stat/MiniStat.svelte +13 -0
- package/package.json +169 -5
- package/page-hero/PageHero.svelte +35 -0
- package/pagination/Pagination.svelte +44 -0
- package/pagination/finder-pagination.svelte.ts +55 -0
- package/pagination/finder-search.svelte.ts +292 -0
- package/percentage-ring/PercentageRing.svelte +76 -0
- package/percentage-ring/types.ts +1 -0
- package/popover/InfoTip.svelte +36 -0
- package/popover/Popover.svelte +157 -0
- package/query-state/QueryState.svelte +42 -0
- package/schema.ts +20 -0
- package/skeleton/Skeleton.svelte +86 -0
- package/skeleton/SkeletonButton.svelte +27 -0
- package/skeleton/SkeletonCard.svelte +49 -0
- package/skeleton/SkeletonCircle.svelte +25 -0
- package/skeleton/SkeletonField.svelte +19 -0
- package/skeleton/SkeletonRow.svelte +47 -0
- package/skeleton/SkeletonText.svelte +46 -0
- package/skeleton/TableSkeleton.svelte +60 -0
- package/spacing.css +32 -0
- package/stat/NextPayoutCountdown.svelte +52 -0
- package/stat/Stat.svelte +103 -0
- package/stat/ValueBox.svelte +38 -0
- package/status-row/StatusRow.svelte +176 -0
- package/status-row/types.ts +5 -0
- package/table/SelectAllCell.svelte +34 -0
- package/table/SelectAllTableCell.svelte +25 -0
- package/table/SelectRowCell.svelte +31 -0
- package/table/SelectRowTableCell.svelte +25 -0
- package/table/SelectionBar.svelte +68 -0
- package/table/SelectionOverlay.svelte +83 -0
- package/table/Table.svelte +64 -0
- package/table/TableCell.svelte +185 -0
- package/table/TableRow.svelte +86 -0
- package/table/index.ts +9 -0
- package/table/selection.svelte.ts +79 -0
- package/tabs/TabBlock.svelte +56 -0
- package/tabs/TabButton.svelte +33 -0
- package/template.css +1393 -0
- package/text/Span.svelte +83 -0
- package/text/Text.svelte +94 -0
- package/text/Title.svelte +75 -0
- package/text/color.ts +41 -0
- package/theme/theme.svelte.ts +33 -0
- package/tokens.css +62 -0
- package/typography.css +164 -0
package/text/Span.svelte
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import { BG_CLASS, type Color, COLOR_CLASS } from './color';
|
|
5
|
+
|
|
6
|
+
type Size = 'default' | 'lg' | 'sm' | 'xl' | 'xs';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
bg,
|
|
10
|
+
bold = false,
|
|
11
|
+
centerBelow = false,
|
|
12
|
+
centered = false,
|
|
13
|
+
children,
|
|
14
|
+
clamp,
|
|
15
|
+
class: className = '',
|
|
16
|
+
color,
|
|
17
|
+
maxWidth,
|
|
18
|
+
mono = false,
|
|
19
|
+
size = 'default',
|
|
20
|
+
title,
|
|
21
|
+
truncate = false,
|
|
22
|
+
uppercase = false,
|
|
23
|
+
}: {
|
|
24
|
+
/** Tinted chip background behind the text (e.g. flagging one invalid cell/value without
|
|
25
|
+
* tinting its whole row) — same `Color` set as `color`. */
|
|
26
|
+
bg?: Color;
|
|
27
|
+
bold?: boolean;
|
|
28
|
+
/** text-align: center + margin-inline: auto below 960px — for a maxWidth block that
|
|
29
|
+
* sits beside a side panel on desktop and should become a centered block once that
|
|
30
|
+
* layout stacks. */
|
|
31
|
+
centerBelow?: boolean;
|
|
32
|
+
centered?: boolean;
|
|
33
|
+
children: Snippet;
|
|
34
|
+
clamp?: number;
|
|
35
|
+
class?: string;
|
|
36
|
+
color?: Color;
|
|
37
|
+
maxWidth?: string;
|
|
38
|
+
/** Monospace font. */
|
|
39
|
+
mono?: boolean;
|
|
40
|
+
size?: Size;
|
|
41
|
+
/** Native tooltip. */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** Single-line ellipsis. Needs a bounded width from context (a flex child needs its own
|
|
44
|
+
* `min-width: 0`/`flex: 1` via `class`, or pass `maxWidth`). Also forces
|
|
45
|
+
* `display: inline-block` — a plain `<span>` is `inline` and ignores `max-width`
|
|
46
|
+
* entirely, so without it the width constraint (and thus the ellipsis) would be a no-op.
|
|
47
|
+
* Harmless when this `Span` is itself a flex/grid item — those get blockified either way. */
|
|
48
|
+
truncate?: boolean;
|
|
49
|
+
/** Uppercase + widened letter-spacing — the eyebrow-label pairing. For the fuller
|
|
50
|
+
* kicker-above-a-heading pattern, prefer `@zeyolabs/ui/eyebrow/Eyebrow.svelte`. */
|
|
51
|
+
uppercase?: boolean;
|
|
52
|
+
} = $props();
|
|
53
|
+
|
|
54
|
+
const sizeClass = $derived(size === 'default' ? '' : size);
|
|
55
|
+
const inlineStyle = $derived(
|
|
56
|
+
`${maxWidth ? `max-width:${maxWidth};` : ''}${clamp ? `display:-webkit-box;-webkit-line-clamp:${clamp};line-clamp:${clamp};-webkit-box-orient:vertical;overflow:hidden;` : ''}`
|
|
57
|
+
);
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<span
|
|
61
|
+
style={inlineStyle}
|
|
62
|
+
class="{sizeClass} {bold ? 'bold' : ''} {centered ? 'text-center' : ''} {color
|
|
63
|
+
? COLOR_CLASS[color]
|
|
64
|
+
: ''} {bg ? BG_CLASS[bg] : ''} {className}"
|
|
65
|
+
class:center-below={centerBelow}
|
|
66
|
+
class:font-mono={mono}
|
|
67
|
+
class:inline-block={truncate}
|
|
68
|
+
class:tracking-wider={uppercase}
|
|
69
|
+
class:truncate
|
|
70
|
+
class:uppercase
|
|
71
|
+
{title}
|
|
72
|
+
>
|
|
73
|
+
{@render children()}
|
|
74
|
+
</span>
|
|
75
|
+
|
|
76
|
+
<style>
|
|
77
|
+
@media (max-width: 960px) {
|
|
78
|
+
.center-below {
|
|
79
|
+
text-align: center;
|
|
80
|
+
margin-inline: auto;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</style>
|
package/text/Text.svelte
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import { BG_CLASS, type Color, COLOR_CLASS } from './color';
|
|
5
|
+
|
|
6
|
+
type Size = 'default' | 'lg' | 'sm' | 'xl' | 'xs';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
bg,
|
|
10
|
+
bold = false,
|
|
11
|
+
centerBelow = false,
|
|
12
|
+
centered = false,
|
|
13
|
+
children,
|
|
14
|
+
clamp,
|
|
15
|
+
class: className = '',
|
|
16
|
+
color,
|
|
17
|
+
href,
|
|
18
|
+
maxWidth,
|
|
19
|
+
mono = false,
|
|
20
|
+
rel,
|
|
21
|
+
size = 'default',
|
|
22
|
+
target,
|
|
23
|
+
title,
|
|
24
|
+
truncate = false,
|
|
25
|
+
uppercase = false,
|
|
26
|
+
}: {
|
|
27
|
+
/** Tinted chip background behind the text (e.g. flagging one invalid cell/value without
|
|
28
|
+
* tinting its whole row) — same `Color` set as `color`. */
|
|
29
|
+
bg?: Color;
|
|
30
|
+
bold?: boolean;
|
|
31
|
+
/** text-align: center + margin-inline: auto below 960px — for a maxWidth block that
|
|
32
|
+
* sits beside a side panel on desktop and should become a centered block once that
|
|
33
|
+
* layout stacks. */
|
|
34
|
+
centerBelow?: boolean;
|
|
35
|
+
centered?: boolean;
|
|
36
|
+
children: Snippet;
|
|
37
|
+
clamp?: number;
|
|
38
|
+
class?: string;
|
|
39
|
+
color?: Color;
|
|
40
|
+
/** Renders as an `<a>` instead of `<p>` when set. */
|
|
41
|
+
href?: string;
|
|
42
|
+
maxWidth?: string;
|
|
43
|
+
/** Monospace font. */
|
|
44
|
+
mono?: boolean;
|
|
45
|
+
rel?: string;
|
|
46
|
+
size?: Size;
|
|
47
|
+
target?: string;
|
|
48
|
+
/** Native tooltip. */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Single-line ellipsis. Needs a bounded width from context (a flex child needs its own
|
|
51
|
+
* `min-width: 0`/`flex: 1` via `class`, or pass `maxWidth`). When `href` is set (renders
|
|
52
|
+
* `<a>`, `inline` by default), `truncate` also forces `display: inline-block` so the
|
|
53
|
+
* width constraint actually takes effect — inline elements ignore max-width entirely. */
|
|
54
|
+
truncate?: boolean;
|
|
55
|
+
/** Uppercase + widened letter-spacing — the eyebrow-label pairing. For the fuller
|
|
56
|
+
* kicker-above-a-heading pattern, prefer `@zeyolabs/ui/eyebrow/Eyebrow.svelte`. */
|
|
57
|
+
uppercase?: boolean;
|
|
58
|
+
} = $props();
|
|
59
|
+
|
|
60
|
+
const tag = $derived(href ? 'a' : 'p');
|
|
61
|
+
const sizeClass = $derived(size === 'default' ? '' : size);
|
|
62
|
+
const inlineStyle = $derived(
|
|
63
|
+
`${maxWidth ? `max-width:${maxWidth};` : ''}${clamp ? `display:-webkit-box;-webkit-line-clamp:${clamp};line-clamp:${clamp};-webkit-box-orient:vertical;overflow:hidden;` : ''}`
|
|
64
|
+
);
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<svelte:element
|
|
68
|
+
this={tag}
|
|
69
|
+
style={inlineStyle}
|
|
70
|
+
class="{sizeClass} {bold ? 'bold' : ''} {centered ? 'text-center' : ''} {color
|
|
71
|
+
? COLOR_CLASS[color]
|
|
72
|
+
: ''} {bg ? BG_CLASS[bg] : ''} {className}"
|
|
73
|
+
class:center-below={centerBelow}
|
|
74
|
+
class:font-mono={mono}
|
|
75
|
+
class:inline-block={truncate && !!href}
|
|
76
|
+
class:tracking-wider={uppercase}
|
|
77
|
+
class:truncate
|
|
78
|
+
class:uppercase
|
|
79
|
+
{href}
|
|
80
|
+
{rel}
|
|
81
|
+
{target}
|
|
82
|
+
{title}
|
|
83
|
+
>
|
|
84
|
+
{@render children()}
|
|
85
|
+
</svelte:element>
|
|
86
|
+
|
|
87
|
+
<style>
|
|
88
|
+
@media (max-width: 960px) {
|
|
89
|
+
.center-below {
|
|
90
|
+
text-align: center;
|
|
91
|
+
margin-inline: auto;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import { BG_CLASS, type Color, COLOR_CLASS } from './color';
|
|
5
|
+
|
|
6
|
+
type Level = 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
bg,
|
|
10
|
+
bold = false,
|
|
11
|
+
centerBelow = false,
|
|
12
|
+
centered = false,
|
|
13
|
+
children,
|
|
14
|
+
clamp,
|
|
15
|
+
class: className = '',
|
|
16
|
+
color,
|
|
17
|
+
level,
|
|
18
|
+
maxWidth,
|
|
19
|
+
truncate = false,
|
|
20
|
+
}: {
|
|
21
|
+
/** Tinted chip background behind the text (e.g. flagging one invalid cell/value without
|
|
22
|
+
* tinting its whole row) — same `Color` set as `color`. */
|
|
23
|
+
bg?: Color;
|
|
24
|
+
bold?: boolean;
|
|
25
|
+
/** text-align: center + margin-inline: auto below 960px — for a maxWidth heading that
|
|
26
|
+
* sits beside a side panel on desktop and should become a centered block once that
|
|
27
|
+
* layout stacks. */
|
|
28
|
+
centerBelow?: boolean;
|
|
29
|
+
centered?: boolean;
|
|
30
|
+
children: Snippet;
|
|
31
|
+
clamp?: number;
|
|
32
|
+
class?: string;
|
|
33
|
+
color?: Color;
|
|
34
|
+
level: Level;
|
|
35
|
+
maxWidth?: string;
|
|
36
|
+
/** Single-line ellipsis. Needs a bounded width from context (a flex child needs its own
|
|
37
|
+
* `min-width: 0`/`flex: 1` via `class`, or pass `maxWidth`). Clips only the inline axis —
|
|
38
|
+
* unlike Tailwind's `truncate`, the vertical axis stays `visible` so descenders (DM Sans's
|
|
39
|
+
* glyph box is taller than the tight h1/h2 line-height) don't get cropped by the clip box. */
|
|
40
|
+
truncate?: boolean;
|
|
41
|
+
} = $props();
|
|
42
|
+
|
|
43
|
+
const tag = $derived(`h${level}` as const);
|
|
44
|
+
const inlineStyle = $derived(
|
|
45
|
+
`${maxWidth ? `max-width:${maxWidth};` : ''}${clamp ? `display:-webkit-box;-webkit-line-clamp:${clamp};line-clamp:${clamp};-webkit-box-orient:vertical;overflow:hidden;` : ''}`
|
|
46
|
+
);
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<svelte:element
|
|
50
|
+
this={tag}
|
|
51
|
+
style={inlineStyle}
|
|
52
|
+
class="{bold ? 'bold' : ''} {centered ? 'text-center' : ''} {color ? COLOR_CLASS[color] : ''} {bg
|
|
53
|
+
? BG_CLASS[bg]
|
|
54
|
+
: ''} {className}"
|
|
55
|
+
class:center-below={centerBelow}
|
|
56
|
+
class:truncate-title={truncate}
|
|
57
|
+
>
|
|
58
|
+
{@render children()}
|
|
59
|
+
</svelte:element>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
@media (max-width: 960px) {
|
|
63
|
+
.center-below {
|
|
64
|
+
text-align: center;
|
|
65
|
+
margin-inline: auto;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.truncate-title {
|
|
70
|
+
overflow-x: clip;
|
|
71
|
+
overflow-y: visible;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
package/text/color.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type Color =
|
|
2
|
+
| 'accent'
|
|
3
|
+
| 'error'
|
|
4
|
+
| 'info'
|
|
5
|
+
| 'secondary'
|
|
6
|
+
| 'success'
|
|
7
|
+
| 'tertiary'
|
|
8
|
+
| 'warning'
|
|
9
|
+
| 'white'
|
|
10
|
+
| 'whiteSecondary';
|
|
11
|
+
|
|
12
|
+
export const COLOR_CLASS: Record<Color, string> = {
|
|
13
|
+
accent: 'text-(--acc)',
|
|
14
|
+
error: 'text-(--err)',
|
|
15
|
+
info: 'text-(--inf)',
|
|
16
|
+
secondary: 'text-(--txs)',
|
|
17
|
+
success: 'text-(--ok)',
|
|
18
|
+
tertiary: 'text-(--txt)',
|
|
19
|
+
warning: 'text-(--w)',
|
|
20
|
+
// Fixed white, not theme-aware var(--tx)/etc — for text sitting on a dark/gradient
|
|
21
|
+
// surface (e.g. the rainbow panel bg), which stays the same regardless of site theme.
|
|
22
|
+
white: 'text-white',
|
|
23
|
+
whiteSecondary: 'text-white/70',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** A tinted "chip" background behind the text (see `.chip-*` in `typography.css` for the shared
|
|
27
|
+
* padding/margin/radius + each color's `color-mix`) — e.g. flagging one invalid table cell or
|
|
28
|
+
* CSV sample without tinting the whole row. Same `Color` set as `COLOR_CLASS`; unlike text color
|
|
29
|
+
* this is a real global class (not a Tailwind arbitrary-value utility) because Tailwind has no
|
|
30
|
+
* utility for mixing a token toward transparent. */
|
|
31
|
+
export const BG_CLASS: Record<Color, string> = {
|
|
32
|
+
accent: 'chip-accent',
|
|
33
|
+
error: 'chip-error',
|
|
34
|
+
info: 'chip-info',
|
|
35
|
+
secondary: 'chip-secondary',
|
|
36
|
+
success: 'chip-success',
|
|
37
|
+
tertiary: 'chip-tertiary',
|
|
38
|
+
warning: 'chip-warning',
|
|
39
|
+
white: 'chip-white',
|
|
40
|
+
whiteSecondary: 'chip-whiteSecondary',
|
|
41
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const isBrowser = typeof window !== 'undefined';
|
|
2
|
+
const stored = isBrowser ? localStorage.getItem('zeyo-theme') : null;
|
|
3
|
+
const media = isBrowser ? window.matchMedia('(prefers-color-scheme: dark)') : null;
|
|
4
|
+
let hasExplicitChoice = stored !== null;
|
|
5
|
+
|
|
6
|
+
const initial = stored ? stored === 'dark' : (media?.matches ?? false);
|
|
7
|
+
let dark = $state(initial);
|
|
8
|
+
|
|
9
|
+
if (isBrowser) {
|
|
10
|
+
document.documentElement.classList.toggle('dark', initial);
|
|
11
|
+
|
|
12
|
+
// Follow live OS changes only until the user makes an explicit choice — an explicit
|
|
13
|
+
// toggle must never be overridden by a later system theme change in the same session.
|
|
14
|
+
media?.addEventListener('change', (e) => {
|
|
15
|
+
if (hasExplicitChoice) return;
|
|
16
|
+
dark = e.matches;
|
|
17
|
+
document.documentElement.classList.toggle('dark', dark);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const theme = {
|
|
22
|
+
get dark() {
|
|
23
|
+
return dark;
|
|
24
|
+
},
|
|
25
|
+
toggle() {
|
|
26
|
+
dark = !dark;
|
|
27
|
+
hasExplicitChoice = true;
|
|
28
|
+
if (isBrowser) {
|
|
29
|
+
localStorage.setItem('zeyo-theme', dark ? 'dark' : 'light');
|
|
30
|
+
document.documentElement.classList.toggle('dark', dark);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
package/tokens.css
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Design tokens: neutral defaults. Each app overrides them with its own brand in its
|
|
2
|
+
app.css / brand.css. The component stylesheet (template.css) reads these. */
|
|
3
|
+
:root {
|
|
4
|
+
--bg: #ffffff;
|
|
5
|
+
/* The page behind cards/surfaces (which use --bg), where an app opts into a tinted page. */
|
|
6
|
+
--bg-page: #f6f6f6;
|
|
7
|
+
--sf: #ffffff;
|
|
8
|
+
--sfh: #f6f6f6;
|
|
9
|
+
--bd: #e8e6e3;
|
|
10
|
+
--bds: #f0f0f0;
|
|
11
|
+
--tx: #1e1d26;
|
|
12
|
+
--txs: #6b7280;
|
|
13
|
+
--txt: #9ca3af;
|
|
14
|
+
--ok: #2f6e3d;
|
|
15
|
+
--w: #b45309;
|
|
16
|
+
--err: #9b3838;
|
|
17
|
+
--inf: #1e1d26;
|
|
18
|
+
--ov: rgba(30, 29, 38, 0.18);
|
|
19
|
+
--ch: rgba(30, 29, 38, 0.015);
|
|
20
|
+
--acc: #1e1d26;
|
|
21
|
+
--tertiary: #faf7f0;
|
|
22
|
+
|
|
23
|
+
/* The one accent: buttons, links, focus. --primary-strong must keep AA contrast as a
|
|
24
|
+
white-text fill and as text on --bg. */
|
|
25
|
+
--primary: #2563eb;
|
|
26
|
+
--primary-strong: #1d4ed8;
|
|
27
|
+
--primary-soft: #dbeafe;
|
|
28
|
+
|
|
29
|
+
/* Plain-language aliases used by app markup; they follow the tokens above. */
|
|
30
|
+
--fg: var(--tx);
|
|
31
|
+
--muted: var(--txs);
|
|
32
|
+
--border: var(--bd);
|
|
33
|
+
--danger: var(--err);
|
|
34
|
+
|
|
35
|
+
/* Control heights: buttons, inputs, selects and comboboxes share these so a field and the
|
|
36
|
+
button beside it line up. */
|
|
37
|
+
--control-h: 35px;
|
|
38
|
+
--control-h-sm: 28px;
|
|
39
|
+
--control-h-lg: 48px;
|
|
40
|
+
|
|
41
|
+
--font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dark {
|
|
45
|
+
--bg: #0a0a0a;
|
|
46
|
+
--bg-page: #141414;
|
|
47
|
+
--sf: #141414;
|
|
48
|
+
--sfh: #1c1c1c;
|
|
49
|
+
--bd: #282828;
|
|
50
|
+
--bds: #1c1c1c;
|
|
51
|
+
--tx: #ffffff;
|
|
52
|
+
--txs: #aaaaaa;
|
|
53
|
+
--txt: #666666;
|
|
54
|
+
--ok: #22c55e;
|
|
55
|
+
--w: #eab308;
|
|
56
|
+
--err: #ef4444;
|
|
57
|
+
--inf: #3b82f6;
|
|
58
|
+
--ov: rgba(0, 0, 0, 0.5);
|
|
59
|
+
--ch: rgba(255, 255, 255, 0.02);
|
|
60
|
+
--acc: #ffffff;
|
|
61
|
+
--tertiary: #161311;
|
|
62
|
+
}
|
package/typography.css
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/* Body size reads --text-base so a storefront can set a larger base than the dense 13px
|
|
2
|
+
dashboard default. */
|
|
3
|
+
/* ─── Typography tokens — shared across every app (dashboard, admin, marketing) ─────
|
|
4
|
+
Single source of truth for both font-family and the h1-h6 size/weight/line-height/
|
|
5
|
+
letter-spacing scale, so no app duplicates or drifts from another. A component's own
|
|
6
|
+
scoped <style> block (higher specificity than these unscoped tag selectors) still
|
|
7
|
+
wins for any heading that needs a bespoke size — this scale is only the default.
|
|
8
|
+
Requires the consuming app.html to load DM Sans via Google Fonts (see app.html in any
|
|
9
|
+
app) — every app on the same font-delivery pipeline, same font-family name. */
|
|
10
|
+
@theme inline {
|
|
11
|
+
--font-sans:
|
|
12
|
+
'DM Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
|
|
13
|
+
--font-heading: 'DM Sans', sans-serif;
|
|
14
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@layer base {
|
|
18
|
+
body {
|
|
19
|
+
font-family: var(--font-sans);
|
|
20
|
+
font-size: var(--text-base, 13px);
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
letter-spacing: -0.01em;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
-webkit-font-smoothing: antialiased;
|
|
25
|
+
-moz-osx-font-smoothing: grayscale;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
input,
|
|
29
|
+
textarea,
|
|
30
|
+
select,
|
|
31
|
+
button {
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
letter-spacing: -0.01em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
button {
|
|
37
|
+
transition: all 0.1s;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
h1,
|
|
41
|
+
h2,
|
|
42
|
+
h3,
|
|
43
|
+
h4,
|
|
44
|
+
h5,
|
|
45
|
+
h6 {
|
|
46
|
+
font-family: var(--font-heading);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
h4,
|
|
50
|
+
h5,
|
|
51
|
+
h6 {
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
h1 {
|
|
56
|
+
font-size: 42px;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
line-height: 1.08;
|
|
59
|
+
letter-spacing: -2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
h2 {
|
|
63
|
+
font-size: clamp(1.85rem, 5vw, 48px);
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
line-height: 1.08;
|
|
66
|
+
letter-spacing: -2px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
h3 {
|
|
70
|
+
font-size: clamp(1.5rem, 3.6vw, 32px);
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
line-height: 1.2;
|
|
73
|
+
letter-spacing: -1px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
h4 {
|
|
77
|
+
font-size: 22px;
|
|
78
|
+
line-height: 1.3;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
h5 {
|
|
82
|
+
font-size: 18px;
|
|
83
|
+
line-height: 1.4;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
h6 {
|
|
87
|
+
font-size: 16px;
|
|
88
|
+
line-height: 1.5;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.xs {
|
|
92
|
+
font-size: 11px;
|
|
93
|
+
letter-spacing: 0.01em;
|
|
94
|
+
line-height: 1.6;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.sm {
|
|
98
|
+
font-size: 11px;
|
|
99
|
+
letter-spacing: 0;
|
|
100
|
+
line-height: 1.55;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.lg {
|
|
104
|
+
font-size: 15px;
|
|
105
|
+
line-height: 1.5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.xl {
|
|
109
|
+
font-size: 18px;
|
|
110
|
+
line-height: 1.4;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.bold {
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Text/Span/Title's `bg` prop (classes `chip-*`, named so they cannot collide with Tailwind's own
|
|
118
|
+
`bg-*` utilities such as `bg-white`) — a tinted chip behind a run of text (see `BG_CLASS` in
|
|
119
|
+
text/color.ts). Shared shape across every color: a small inset so the tint reads as a chip
|
|
120
|
+
around the text rather than a flush-edge smear, not just the tint itself. */
|
|
121
|
+
.chip-accent,
|
|
122
|
+
.chip-error,
|
|
123
|
+
.chip-info,
|
|
124
|
+
.chip-secondary,
|
|
125
|
+
.chip-success,
|
|
126
|
+
.chip-tertiary,
|
|
127
|
+
.chip-warning,
|
|
128
|
+
.chip-white,
|
|
129
|
+
.chip-whiteSecondary {
|
|
130
|
+
margin: -2px -4px;
|
|
131
|
+
padding: 2px 4px;
|
|
132
|
+
border-radius: var(--radius-xs);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.chip-accent {
|
|
136
|
+
background: color-mix(in srgb, var(--acc) 12%, transparent);
|
|
137
|
+
}
|
|
138
|
+
.chip-error {
|
|
139
|
+
background: color-mix(in srgb, var(--err) 18%, transparent);
|
|
140
|
+
}
|
|
141
|
+
.chip-info {
|
|
142
|
+
background: color-mix(in srgb, var(--inf) 12%, transparent);
|
|
143
|
+
}
|
|
144
|
+
.chip-secondary {
|
|
145
|
+
background: color-mix(in srgb, var(--txs) 12%, transparent);
|
|
146
|
+
}
|
|
147
|
+
.chip-success {
|
|
148
|
+
background: color-mix(in srgb, var(--ok) 14%, transparent);
|
|
149
|
+
}
|
|
150
|
+
.chip-tertiary {
|
|
151
|
+
background: color-mix(in srgb, var(--txt) 12%, transparent);
|
|
152
|
+
}
|
|
153
|
+
.chip-warning {
|
|
154
|
+
background: color-mix(in srgb, var(--w) 14%, transparent);
|
|
155
|
+
}
|
|
156
|
+
/* Fixed white tint, not theme-aware — pairs with `white`/`whiteSecondary` text color for a
|
|
157
|
+
chip on a dark/gradient surface that stays the same regardless of site theme. */
|
|
158
|
+
.chip-white {
|
|
159
|
+
background: rgb(255 255 255 / 12%);
|
|
160
|
+
}
|
|
161
|
+
.chip-whiteSecondary {
|
|
162
|
+
background: rgb(255 255 255 / 8%);
|
|
163
|
+
}
|
|
164
|
+
}
|