@lt-three/love3 0.1.0 → 0.1.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 +40 -40
- package/dist/native/analytics/animation.d.ts +1 -1
- package/dist/native/analytics/animation.js +1 -1
- package/dist/native/analytics/chart.types.d.ts +3 -3
- package/dist/native/analytics/metric-card.d.ts +3 -3
- package/dist/native/analytics/metric-card.js +3 -3
- package/dist/native/analytics/multi-line-chart.d.ts +9 -8
- package/dist/native/analytics/multi-line-chart.js +14 -13
- package/dist/native/analytics/pie-chart.d.ts +7 -7
- package/dist/native/analytics/pie-chart.js +8 -8
- package/dist/native/analytics/single-number.d.ts +4 -4
- package/dist/native/analytics/single-number.js +2 -2
- package/dist/native/atom/avatar.d.ts +6 -6
- package/dist/native/atom/avatar.js +2 -2
- package/dist/native/atom/badge.d.ts +5 -5
- package/dist/native/atom/button.d.ts +12 -12
- package/dist/native/atom/button.js +8 -8
- package/dist/native/atom/checkbox.d.ts +4 -4
- package/dist/native/atom/checkbox.js +2 -2
- package/dist/native/atom/colored-value.d.ts +4 -4
- package/dist/native/atom/colored-value.js +4 -4
- package/dist/native/atom/image.d.ts +7 -7
- package/dist/native/atom/image.js +2 -2
- package/dist/native/atom/label.d.ts +5 -5
- package/dist/native/atom/label.js +2 -2
- package/dist/native/atom/link.d.ts +5 -5
- package/dist/native/atom/link.js +5 -5
- package/dist/native/atom/readout.d.ts +7 -7
- package/dist/native/atom/readout.js +3 -3
- package/dist/native/atom/search-input.d.ts +2 -2
- package/dist/native/atom/search-input.js +2 -2
- package/dist/native/atom/select.d.ts +14 -14
- package/dist/native/atom/select.js +8 -8
- package/dist/native/atom/separator.d.ts +2 -3
- package/dist/native/atom/separator.js +2 -3
- package/dist/native/atom/skeleton.d.ts +3 -3
- package/dist/native/atom/skeleton.js +3 -3
- package/dist/native/atom/slider.d.ts +6 -6
- package/dist/native/atom/slider.js +3 -3
- package/dist/native/atom/spinner.d.ts +4 -4
- package/dist/native/atom/spinner.js +2 -2
- package/dist/native/atom/switch.d.ts +4 -4
- package/dist/native/atom/switch.js +3 -3
- package/dist/native/atom/symbol.d.ts +7 -7
- package/dist/native/atom/symbol.js +7 -7
- package/dist/native/atom/symbol.types.d.ts +8 -8
- package/dist/native/atom/symbol.types.js +7 -7
- package/dist/native/atom/text-field.d.ts +15 -15
- package/dist/native/atom/text-field.js +5 -5
- package/dist/native/atom/theme-toggle.d.ts +7 -7
- package/dist/native/atom/theme-toggle.js +4 -4
- package/dist/native/atom/timezone-select.d.ts +5 -5
- package/dist/native/atom/timezone-select.js +4 -4
- package/dist/native/atom/typography.d.ts +2 -2
- package/dist/native/atom/typography.js +2 -2
- package/dist/native/base/button.d.ts +13 -13
- package/dist/native/base/button.js +4 -4
- package/dist/native/base/form.d.ts +15 -15
- package/dist/native/base/form.js +11 -11
- package/dist/native/base/glass-card.d.ts +3 -3
- package/dist/native/base/glass-card.js +3 -3
- package/dist/native/base/input.d.ts +8 -8
- package/dist/native/base/input.js +7 -7
- package/dist/native/base/sheet.d.ts +27 -27
- package/dist/native/base/sheet.js +15 -15
- package/dist/native/form/checkbox.d.ts +3 -3
- package/dist/native/form/checkbox.js +2 -2
- package/dist/native/form/date-picker.d.ts +9 -9
- package/dist/native/form/date-picker.js +9 -9
- package/dist/native/form/form.d.ts +5 -6
- package/dist/native/form/form.js +4 -5
- package/dist/native/form/radio-group.d.ts +5 -5
- package/dist/native/form/radio-group.js +4 -4
- package/dist/native/form/select.d.ts +2 -2
- package/dist/native/form/select.js +2 -2
- package/dist/native/form/slider.d.ts +2 -2
- package/dist/native/form/slider.js +2 -2
- package/dist/native/form/switch.d.ts +2 -2
- package/dist/native/form/switch.js +2 -2
- package/dist/native/form/text-area.d.ts +2 -2
- package/dist/native/form/text-area.js +1 -1
- package/dist/native/form/text-input.d.ts +5 -5
- package/dist/native/form/text-input.js +8 -8
- package/dist/native/layout/accordion.d.ts +5 -5
- package/dist/native/layout/accordion.js +2 -2
- package/dist/native/layout/card.d.ts +8 -8
- package/dist/native/layout/card.js +3 -3
- package/dist/native/layout/description.d.ts +2 -2
- package/dist/native/layout/description.js +2 -2
- package/dist/native/layout/error.d.ts +5 -5
- package/dist/native/layout/error.js +2 -2
- package/dist/native/layout/information.d.ts +4 -4
- package/dist/native/layout/information.js +3 -3
- package/dist/native/layout/locked.d.ts +15 -15
- package/dist/native/layout/locked.js +7 -7
- package/dist/native/layout/modal.d.ts +8 -8
- package/dist/native/layout/modal.js +5 -5
- package/dist/native/layout/not-found.d.ts +4 -4
- package/dist/native/layout/not-found.js +3 -3
- package/dist/native/layout/page-frame.d.ts +8 -8
- package/dist/native/layout/page-frame.js +3 -3
- package/dist/native/layout/panel.d.ts +5 -5
- package/dist/native/layout/panel.js +5 -5
- package/dist/native/layout/reorderable-list.d.ts +14 -14
- package/dist/native/layout/reorderable-list.js +10 -10
- package/dist/native/layout/sheet.d.ts +10 -10
- package/dist/native/layout/sheet.js +4 -4
- package/dist/native/layout/simple-dialog.d.ts +3 -3
- package/dist/native/layout/simple-dialog.js +2 -2
- package/dist/native/layout/simple-table.d.ts +18 -18
- package/dist/native/layout/simple-table.js +1 -1
- package/dist/native/layout/tab-bar.d.ts +10 -10
- package/dist/native/layout/tab-bar.js +4 -4
- package/dist/native/layout/tabs.d.ts +6 -6
- package/dist/native/layout/tabs.js +4 -4
- package/dist/native/layout/tuning-panel.d.ts +10 -10
- package/dist/native/layout/tuning-panel.js +15 -15
- package/dist/native/lib/autocomplete.d.ts +1 -1
- package/dist/native/lib/autocomplete.js +1 -1
- package/dist/native/lib/breakpoints.d.ts +3 -3
- package/dist/native/lib/breakpoints.js +3 -3
- package/dist/native/lib/chart-palette.d.ts +2 -2
- package/dist/native/lib/chart-palette.js +2 -2
- package/dist/native/lib/confirm.d.ts +15 -16
- package/dist/native/lib/confirm.js +9 -10
- package/dist/native/lib/control.d.ts +9 -9
- package/dist/native/lib/external-store.d.ts +4 -5
- package/dist/native/lib/keyboard.d.ts +7 -7
- package/dist/native/lib/keyboard.js +7 -7
- package/dist/native/lib/labels.d.ts +6 -6
- package/dist/native/lib/labels.js +6 -6
- package/dist/native/lib/loading.d.ts +3 -3
- package/dist/native/lib/loading.js +3 -3
- package/dist/native/lib/network.d.ts +5 -6
- package/dist/native/lib/network.js +5 -6
- package/dist/native/lib/scheme.d.ts +7 -7
- package/dist/native/lib/scheme.js +3 -3
- package/dist/native/lib/snackbar.d.ts +12 -13
- package/dist/native/lib/snackbar.js +7 -8
- package/dist/native/lib/theme.d.ts +15 -15
- package/dist/native/lib/theme.js +15 -15
- package/dist/native/lib/timezone.d.ts +13 -13
- package/dist/native/lib/timezone.js +13 -13
- package/dist/native/lib/token-color.d.ts +1 -1
- package/dist/native/lib/token-color.js +1 -1
- package/dist/native/lib/tuning-context.d.ts +2 -2
- package/dist/native/lib/tuning.d.ts +10 -10
- package/dist/native/lib/tuning.js +8 -8
- package/dist/native/lib/typography.d.ts +3 -3
- package/dist/native/lib/typography.js +3 -3
- package/dist/native/lib/utils.d.ts +3 -3
- package/dist/native/lib/utils.js +3 -3
- package/dist/native/once/confirm.d.ts +2 -2
- package/dist/native/once/confirm.js +2 -2
- package/dist/native/once/error-boundary.d.ts +3 -3
- package/dist/native/once/error-boundary.js +2 -2
- package/dist/native/once/loading-lock.d.ts +3 -3
- package/dist/native/once/loading-lock.js +3 -3
- package/dist/native/once/offline-banner.d.ts +6 -6
- package/dist/native/once/offline-banner.js +5 -5
- package/dist/native/once/snackbar.d.ts +7 -7
- package/dist/native/once/snackbar.js +5 -5
- package/dist/native/styles.css +21 -21
- package/dist/shared/analytics.d.ts +23 -23
- package/dist/shared/button.d.ts +1 -1
- package/dist/shared/form.d.ts +7 -7
- package/dist/shared/form.js +2 -2
- package/dist/tokens/contrast-pairs.d.ts +9 -9
- package/dist/tokens/contrast-pairs.js +10 -10
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/styles.gen.css +87 -87
- package/dist/tokens/tokens.gen.d.ts +2 -2
- package/dist/tokens/tokens.gen.js +2 -2
- package/dist/tuning/catalog.d.ts +8 -8
- package/dist/tuning/catalog.js +9 -9
- package/dist/tuning/color.d.ts +4 -4
- package/dist/tuning/color.js +5 -5
- package/dist/tuning/css.d.ts +13 -13
- package/dist/tuning/css.js +17 -17
- package/dist/tuning/model.d.ts +11 -11
- package/dist/tuning/model.js +11 -11
- package/dist/tuning/native.d.ts +18 -18
- package/dist/tuning/native.js +18 -18
- package/dist/tuning/schema.d.ts +15 -15
- package/dist/tuning/schema.js +22 -22
- package/dist/tuning/types.d.ts +25 -25
- package/dist/tuning/types.js +6 -6
- package/dist/web/analytics/line-chart.d.ts +6 -6
- package/dist/web/analytics/line-chart.js +3 -3
- package/dist/web/analytics/metric-card.d.ts +6 -6
- package/dist/web/analytics/metric-card.js +5 -5
- package/dist/web/analytics/multi-line-chart.d.ts +23 -23
- package/dist/web/analytics/multi-line-chart.js +33 -33
- package/dist/web/atom/avatar.d.ts +1 -1
- package/dist/web/atom/checkbox.d.ts +6 -6
- package/dist/web/atom/checkbox.js +2 -2
- package/dist/web/atom/colored-value.d.ts +4 -4
- package/dist/web/atom/colored-value.js +4 -4
- package/dist/web/atom/help.d.ts +1 -1
- package/dist/web/atom/segmented-control.d.ts +13 -14
- package/dist/web/atom/segmented-control.js +6 -7
- package/dist/web/atom/select.d.ts +7 -7
- package/dist/web/atom/select.js +5 -5
- package/dist/web/atom/slider.d.ts +3 -3
- package/dist/web/atom/slider.js +2 -2
- package/dist/web/atom/switch.d.ts +3 -3
- package/dist/web/atom/text-area.d.ts +9 -8
- package/dist/web/atom/text-area.js +9 -8
- package/dist/web/atom/text-field.d.ts +5 -4
- package/dist/web/atom/text-field.js +5 -4
- package/dist/web/atom/toggle-chip.d.ts +6 -6
- package/dist/web/atom/toggle-chip.js +4 -4
- package/dist/web/atom/tooltip.d.ts +6 -6
- package/dist/web/atom/tooltip.js +2 -2
- package/dist/web/base/accordion.js +1 -1
- package/dist/web/base/breadcrumb.d.ts +1 -1
- package/dist/web/base/breadcrumb.js +1 -1
- package/dist/web/base/card.d.ts +3 -3
- package/dist/web/base/card.js +2 -2
- package/dist/web/base/dialog.d.ts +1 -1
- package/dist/web/base/dialog.js +1 -1
- package/dist/web/base/form.d.ts +7 -7
- package/dist/web/base/form.js +5 -5
- package/dist/web/base/pagination.d.ts +5 -5
- package/dist/web/base/pagination.js +1 -1
- package/dist/web/base/sheet.d.ts +1 -1
- package/dist/web/base/sheet.js +1 -1
- package/dist/web/base/slider.d.ts +1 -1
- package/dist/web/base/sonner.d.ts +2 -2
- package/dist/web/base/sonner.js +2 -2
- package/dist/web/base/spinner.js +1 -1
- package/dist/web/form/checkbox.d.ts +8 -8
- package/dist/web/form/checkbox.js +3 -3
- package/dist/web/form/radio-group.js +3 -3
- package/dist/web/form/select.js +1 -1
- package/dist/web/form/slider.d.ts +3 -3
- package/dist/web/form/slider.js +3 -3
- package/dist/web/form/switch.d.ts +3 -3
- package/dist/web/form/switch.js +4 -4
- package/dist/web/form/text-area.js +1 -1
- package/dist/web/form/text-input.d.ts +1 -1
- package/dist/web/form/text-input.js +1 -1
- package/dist/web/layout/accordion.d.ts +5 -5
- package/dist/web/layout/accordion.js +2 -2
- package/dist/web/layout/alert-modal.d.ts +11 -11
- package/dist/web/layout/alert-modal.js +7 -7
- package/dist/web/layout/card.d.ts +1 -1
- package/dist/web/layout/information.d.ts +9 -9
- package/dist/web/layout/information.js +7 -7
- package/dist/web/layout/modal.d.ts +1 -1
- package/dist/web/layout/page-frame.d.ts +14 -14
- package/dist/web/layout/page-frame.js +7 -7
- package/dist/web/layout/scroll-area.d.ts +1 -1
- package/dist/web/layout/sheet.d.ts +4 -4
- package/dist/web/layout/simple-table.d.ts +18 -18
- package/dist/web/layout/simple-table.js +2 -2
- package/dist/web/layout/tabs.d.ts +4 -4
- package/dist/web/layout/titled-modal.d.ts +10 -11
- package/dist/web/layout/titled-modal.js +7 -8
- package/dist/web/lib/css-vars.d.ts +6 -6
- package/dist/web/lib/css-vars.js +5 -5
- package/dist/web/lib/dialog.d.ts +4 -4
- package/dist/web/lib/labels.d.ts +8 -8
- package/dist/web/lib/labels.js +8 -8
- package/dist/web/lib/modal-open-focus.d.ts +7 -7
- package/dist/web/lib/modal-open-focus.js +9 -9
- package/dist/web/lib/restore-focus.d.ts +4 -4
- package/dist/web/lib/restore-focus.js +4 -4
- package/dist/web/styles.css +33 -33
- package/package.json +2 -2
|
@@ -2,10 +2,10 @@ import { useRef } from "react";
|
|
|
2
2
|
|
|
3
3
|
//#region src/web/lib/restore-focus.ts
|
|
4
4
|
/**
|
|
5
|
-
* Radix
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Radix's Dialog returns focus after closing only to `DialogTrigger`. love3's Modal, Sheet and AlertModal keep `open` in state
|
|
6
|
+
* (there is no trigger), so as is, focus falls to `body` (keyboard and assistive-technology users lose track of where they opened it).
|
|
7
|
+
* It remembers the element that had focus when the dialog opened and returns focus there on close. When there is no remembered element, such as when it was opened with `DialogTrigger`, or
|
|
8
|
+
* when the caller called `preventDefault`, it does nothing (it leaves it to Radix's default behaviour).
|
|
9
9
|
*/
|
|
10
10
|
function useRestoreFocus(onOpenAutoFocus, onCloseAutoFocus) {
|
|
11
11
|
const previous = useRef(null);
|
package/dist/web/styles.css
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Web styles for love3 (`@lt-three/love3/web/styles.css`). Import it once, at the entry of your app's CSS.
|
|
3
3
|
*
|
|
4
4
|
* @import "@lt-three/love3/web/styles.css";
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `.theme-light`
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* It contains Tailwind v4 itself, the fonts, the animations, the tokens (`@lt-three/love3/styles.css`) and the base styles.
|
|
7
|
+
* The token values live in `src/tokens/definition.ts` (the SSOT). No tokens are written here.
|
|
8
|
+
* `.theme-light` only lightens the raw tokens (such as `bg-paper` / `text-ink-900`).
|
|
9
|
+
* Semantic classes (such as `bg-background` / `bg-primary`) do not get lighter, so components do not use them
|
|
10
|
+
* (to keep a public page always light, use raw-token classes or redeclare the variables on the consuming side).
|
|
11
11
|
*/
|
|
12
12
|
@import "tailwindcss/theme.css" layer(theme);
|
|
13
13
|
@import "tailwindcss/preflight.css" layer(base);
|
|
14
14
|
@import "tailwindcss/utilities.css";
|
|
15
15
|
|
|
16
|
-
/*
|
|
16
|
+
/* Latin text uses self-hosted Geist (Latin only, so it is light). Japanese text uses the Yu Gothic fonts that ship with the OS, and falls back to sans-serif where they are not installed */
|
|
17
17
|
@import "@fontsource-variable/geist";
|
|
18
|
-
/*
|
|
18
|
+
/* Numbers, IDs, code and data tables use Geist Mono */
|
|
19
19
|
@import "@fontsource-variable/geist-mono";
|
|
20
20
|
|
|
21
21
|
@import "tw-animate-css";
|
|
22
22
|
|
|
23
|
-
/*
|
|
23
|
+
/* The token definitions (@theme, light, dark). It is generated, so to change a value edit definition.ts */
|
|
24
24
|
@import "@lt-three/love3/styles.css";
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
*
|
|
28
|
-
* node_modules
|
|
29
|
-
* `@source`
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* Picks up the Tailwind classes used by love3's components (components are *.tsx; the *.ts files in lib have no classes).
|
|
28
|
+
* node_modules (through a workspace symlink) is outside automatic detection, so it is stated explicitly here.
|
|
29
|
+
* The `@source` path is relative to the location of this CSS file.
|
|
30
|
+
* In the published build (`dist/`) the components are `*.js`, so both `tsx` and `js` are picked up (the same file is placed in both src and dist).
|
|
31
|
+
* The consuming app's own sources are left to automatic detection based on the bundler's project root
|
|
32
|
+
* (the Vite root, or the cwd for PostCSS); the location of this CSS file does not matter.
|
|
33
33
|
*/
|
|
34
34
|
@source "./**/*.{tsx,js}";
|
|
35
35
|
@source not "./**/*.test.tsx";
|
|
36
36
|
|
|
37
37
|
/*
|
|
38
|
-
*
|
|
39
|
-
* state
|
|
40
|
-
* sonner
|
|
41
|
-
* `[data-sonner-toaster]`
|
|
38
|
+
* Notifications (sonner): overlay surface + thin 1px border + soft shadow (shadow-md). Corner radius is the surface step.
|
|
39
|
+
* The state is shown by the icon colour, not by a left border (the text stays in the normal colour).
|
|
40
|
+
* sonner injects its styles at runtime (at the same specificity as the default `[data-sonner-toast][data-styled=true]`, load order would make us lose), so
|
|
41
|
+
* `[data-sonner-toaster]` and `[data-styled="true"]` are added to raise the specificity by one step and win reliably (!important is not used).
|
|
42
42
|
*/
|
|
43
43
|
[data-sonner-toaster] [data-sonner-toast][data-styled="true"] {
|
|
44
44
|
box-shadow: var(--shadow-md);
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
}
|
|
72
72
|
body {
|
|
73
73
|
@apply bg-background text-foreground;
|
|
74
|
-
/*
|
|
74
|
+
/* Japanese breaks lines at bunsetsu (phrase) boundaries and does not wrap in the middle of a word */
|
|
75
75
|
word-break: auto-phrase;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
/*
|
|
78
|
+
/* Headings use the same Geist as the body. Flush left, with slightly tightened letter spacing. */
|
|
79
79
|
h1,
|
|
80
80
|
h2,
|
|
81
81
|
h3,
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
font-family: var(--font-sans, "Geist Variable", sans-serif);
|
|
86
86
|
font-weight: 700;
|
|
87
87
|
letter-spacing: -0.01em;
|
|
88
|
-
/*
|
|
88
|
+
/* Headings also break at phrase boundaries. Intentional line breaks are controlled in the copy itself (a \n in the text) */
|
|
89
89
|
word-break: auto-phrase;
|
|
90
90
|
}
|
|
91
91
|
h1 {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
color: var(--muted-foreground);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/*
|
|
117
|
+
/* Numbers / IDs / code / data use tabular (monospaced) figures */
|
|
118
118
|
code,
|
|
119
119
|
kbd,
|
|
120
120
|
samp,
|
|
@@ -123,23 +123,23 @@
|
|
|
123
123
|
font-variant-numeric: tabular-nums;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/*
|
|
126
|
+
/* Text selection is a pale indigo surface. The text colour is unchanged */
|
|
127
127
|
::selection {
|
|
128
128
|
background: color-mix(in srgb, var(--action) 30%, transparent);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/*
|
|
133
|
-
*
|
|
134
|
-
* default:
|
|
135
|
-
* hover: 1px
|
|
136
|
-
* active:
|
|
137
|
-
*
|
|
138
|
-
* hover
|
|
133
|
+
* States of a text link.
|
|
134
|
+
* default: text only
|
|
135
|
+
* hover: a 1px underline
|
|
136
|
+
* active: knock out the text fill and draw a 1px outline on the outside + an underline (while pressed)
|
|
137
|
+
* The colour follows currentColor, so it works the same way when the text colour changes, such as white text on top of a wallpaper.
|
|
138
|
+
* hover switches instantly (no transition).
|
|
139
139
|
*
|
|
140
|
-
*
|
|
141
|
-
* SVG
|
|
142
|
-
*
|
|
140
|
+
* An "outside-only outline" cannot be made with -webkit-text-stroke (it is drawn centred on the glyph edge), so
|
|
141
|
+
* it is made with the SVG filter #text-outside-stroke (grow the text by 1px and knock out the original text).
|
|
142
|
+
* The consuming app places the filter definition in the DOM once.
|
|
143
143
|
*/
|
|
144
144
|
@utility text-outline {
|
|
145
145
|
filter: url(#text-outside-stroke);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lt-three/love3",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "<3
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Design system for <3 (Less Than Three): web and React Native (NativeWind) components plus design tokens, in a single package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
7
7
|
"nativewind",
|