@abuzareal/contour-ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/COMPOSITION.md +28 -28
- package/CONTRACTS.md +9 -3
- package/FORMS.md +94 -0
- package/NEXTJS.md +6 -2
- package/OVERLAYS.md +52 -0
- package/PUBLIC-API.md +181 -162
- package/README.md +44 -28
- package/RELEASING.md +1 -1
- package/SIZE.md +45 -0
- package/STYLING.md +68 -0
- package/dist/actions.css +7 -0
- package/dist/components/hero/Sculpture.js +2 -1
- package/dist/components/three/ObjectStudy.js +2 -1
- package/dist/components/ui/Alert.d.ts +2 -1
- package/dist/components/ui/Alert.js +3 -3
- package/dist/components/ui/Avatar.d.ts +3 -1
- package/dist/components/ui/Avatar.js +3 -3
- package/dist/components/ui/Badge.js +2 -2
- package/dist/components/ui/BrandMark.js +2 -1
- package/dist/components/ui/Breadcrumbs.d.ts +2 -1
- package/dist/components/ui/Breadcrumbs.js +3 -2
- package/dist/components/ui/Button.d.ts +2 -0
- package/dist/components/ui/Button.js +3 -2
- package/dist/components/ui/Card.js +2 -2
- package/dist/components/ui/Checkbox.d.ts +2 -2
- package/dist/components/ui/Checkbox.js +14 -5
- package/dist/components/ui/CountUp.d.ts +2 -1
- package/dist/components/ui/CountUp.js +6 -3
- package/dist/components/ui/DataTable.d.ts +1 -0
- package/dist/components/ui/DataTable.js +12 -8
- package/dist/components/ui/DepthButton.js +2 -2
- package/dist/components/ui/Dialog.d.ts +5 -1
- package/dist/components/ui/Dialog.js +49 -18
- package/dist/components/ui/Disclosure.js +2 -1
- package/dist/components/ui/Divider.js +3 -2
- package/dist/components/ui/DropdownMenu.d.ts +11 -4
- package/dist/components/ui/DropdownMenu.js +109 -66
- package/dist/components/ui/EmptyState.js +2 -1
- package/dist/components/ui/Field.js +2 -2
- package/dist/components/ui/FlipCard.js +2 -2
- package/dist/components/ui/FloatingPortal.d.ts +10 -0
- package/dist/components/ui/FloatingPortal.js +51 -0
- package/dist/components/ui/IconButton.js +2 -2
- package/dist/components/ui/Kbd.js +2 -1
- package/dist/components/ui/Magnetic.js +2 -1
- package/dist/components/ui/Marquee.js +3 -2
- package/dist/components/ui/OverlayTrigger.d.ts +11 -0
- package/dist/components/ui/OverlayTrigger.js +5 -0
- package/dist/components/ui/Pagination.d.ts +5 -1
- package/dist/components/ui/Pagination.js +3 -2
- package/dist/components/ui/Popover.d.ts +18 -8
- package/dist/components/ui/Popover.js +58 -17
- package/dist/components/ui/ProgressBar.js +2 -2
- package/dist/components/ui/RadioGroup.d.ts +13 -5
- package/dist/components/ui/RadioGroup.js +36 -9
- package/dist/components/ui/Reveal.d.ts +0 -1
- package/dist/components/ui/Reveal.js +4 -3
- package/dist/components/ui/RevealHeading.js +2 -1
- package/dist/components/ui/ScrollProgress.js +2 -1
- package/dist/components/ui/SectionLabel.js +2 -1
- package/dist/components/ui/SegmentedControl.js +6 -3
- package/dist/components/ui/SelectField.js +18 -3
- package/dist/components/ui/Skeleton.js +2 -2
- package/dist/components/ui/Slider.d.ts +23 -7
- package/dist/components/ui/Slider.js +43 -6
- package/dist/components/ui/Spinner.js +2 -2
- package/dist/components/ui/Stat.js +2 -1
- package/dist/components/ui/Stepper.js +3 -3
- package/dist/components/ui/Switch.d.ts +27 -5
- package/dist/components/ui/Switch.js +51 -5
- package/dist/components/ui/Tabs.js +7 -5
- package/dist/components/ui/Tag.d.ts +2 -1
- package/dist/components/ui/Tag.js +4 -3
- package/dist/components/ui/TextArea.js +4 -1
- package/dist/components/ui/TextField.js +8 -3
- package/dist/components/ui/ThemeScope.d.ts +13 -0
- package/dist/components/ui/ThemeScope.js +10 -0
- package/dist/components/ui/ThemeToggle.d.ts +3 -0
- package/dist/components/ui/ThemeToggle.js +4 -3
- package/dist/components/ui/TiltCard.js +3 -2
- package/dist/components/ui/Timeline.js +2 -2
- package/dist/components/ui/ToastProvider.d.ts +5 -2
- package/dist/components/ui/ToastProvider.js +5 -5
- package/dist/components/ui/Tooltip.d.ts +4 -4
- package/dist/components/ui/Tooltip.js +70 -10
- package/dist/data-display.css +5 -0
- package/dist/effects.css +6 -0
- package/dist/feedback.css +5 -0
- package/dist/fonts-latin.css +10 -4
- package/dist/fonts.css +8 -0
- package/dist/forms.css +5 -0
- package/dist/hooks/useDismiss.d.ts +12 -3
- package/dist/hooks/useDismiss.js +5 -21
- package/dist/hooks/useFloatingPanel.d.ts +14 -0
- package/dist/hooks/useFloatingPanel.js +157 -0
- package/dist/hooks/useFormReset.d.ts +1 -1
- package/dist/hooks/useLayerDismiss.d.ts +4 -0
- package/dist/hooks/useLayerDismiss.js +48 -0
- package/dist/hooks/useMobileMenu.d.ts +0 -1
- package/dist/hooks/useMobileMenu.js +11 -16
- package/dist/hooks/usePanelFocus.d.ts +10 -0
- package/dist/hooks/usePanelFocus.js +60 -0
- package/dist/hooks/useTheme.d.ts +1 -0
- package/dist/hooks/useTheme.js +18 -5
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/kit/forms.css +11 -2
- package/dist/kit/navigation.css +4 -0
- package/dist/kit/overlays.css +8 -4
- package/dist/lib/classNames.d.ts +2 -0
- package/dist/lib/classNames.js +16 -1
- package/dist/lib/componentClasses.d.ts +1 -0
- package/dist/lib/componentClasses.js +2 -0
- package/dist/lib/keyboard.d.ts +1 -1
- package/dist/lib/keyboard.js +5 -2
- package/dist/lib/layers.d.ts +18 -0
- package/dist/lib/layers.js +128 -0
- package/dist/lib/themeScope.d.ts +5 -0
- package/dist/lib/themeScope.js +3 -0
- package/dist/minimal-reset.css +6 -0
- package/dist/navigation.css +5 -0
- package/dist/overlays.css +5 -0
- package/dist/scoped/base.css +183 -0
- package/dist/scoped/kit/actions.css +209 -0
- package/dist/scoped/kit/data-display.css +492 -0
- package/dist/scoped/kit/effects.css +140 -0
- package/dist/scoped/kit/feedback.css +309 -0
- package/dist/scoped/kit/forms.css +370 -0
- package/dist/scoped/kit/navigation.css +266 -0
- package/dist/scoped/kit/overlays.css +299 -0
- package/dist/scoped/marquee.css +58 -0
- package/dist/scoped/spinner.css +20 -0
- package/dist/scoped/theme-toggle.css +38 -0
- package/dist/scoped/tokens.css +119 -0
- package/dist/scoped/ui.css +127 -0
- package/dist/scoped/utilities.css +17 -0
- package/dist/scoped-tokens.css +1 -0
- package/dist/scoped.css +12 -0
- package/dist/theme-toggle.css +2 -2
- package/dist/tokens.json +710 -0
- package/examples/forms/HookFormSettingsForm.tsx +176 -0
- package/examples/forms/ManualSettingsForm-0.3.0.tsx +102 -0
- package/examples/forms/NativeSettingsForm.tsx +119 -0
- package/examples/forms/settings.ts +61 -0
- package/examples/forms/useSubmission.ts +77 -0
- package/package.json +30 -6
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* Generated from tokens/schema.json by scripts/build-styles.mjs. */
|
|
2
|
+
:where(:root) {
|
|
3
|
+
--contour-ink: #171817;
|
|
4
|
+
--contour-paper: #f2f3ee;
|
|
5
|
+
--contour-white: #fcfcf9;
|
|
6
|
+
--contour-acid: #d0f344;
|
|
7
|
+
--contour-ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
8
|
+
--contour-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
9
|
+
--contour-font-display: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
10
|
+
--contour-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
|
|
11
|
+
--contour-radius-sm: 4px;
|
|
12
|
+
--contour-radius-md: 8px;
|
|
13
|
+
--contour-radius-pill: 999px;
|
|
14
|
+
--contour-duration-fast: 160ms;
|
|
15
|
+
--contour-duration-base: 300ms;
|
|
16
|
+
--contour-duration-slow: 700ms;
|
|
17
|
+
--contour-bg: var(--contour-paper);
|
|
18
|
+
--contour-fg: var(--contour-ink);
|
|
19
|
+
--contour-muted: #63665f;
|
|
20
|
+
--contour-line: #d6d8d0;
|
|
21
|
+
--contour-line-strong: #b4b8ac;
|
|
22
|
+
--contour-surface: #fbfbf8;
|
|
23
|
+
--contour-surface-sunken: #e8e9e1;
|
|
24
|
+
--contour-overlay: #171817b8;
|
|
25
|
+
--contour-shadow-raised: 0 1px 2px #1718170d, 0 10px 28px #17181712;
|
|
26
|
+
--contour-shadow-floating: 0 24px 56px #1718172e;
|
|
27
|
+
--contour-olive: #75901a;
|
|
28
|
+
--contour-signal: #4d7522;
|
|
29
|
+
--contour-success: #3f6119;
|
|
30
|
+
--contour-success-soft: #e4ecc9;
|
|
31
|
+
--contour-info: #2f6a82;
|
|
32
|
+
--contour-info-soft: #dbe8ec;
|
|
33
|
+
--contour-warning: #7a5100;
|
|
34
|
+
--contour-warning-soft: #f5e6c3;
|
|
35
|
+
--contour-danger: #a8321c;
|
|
36
|
+
--contour-danger-soft: #f7dcd3;
|
|
37
|
+
--contour-invert-bg: var(--contour-ink);
|
|
38
|
+
--contour-invert-fg: var(--contour-paper);
|
|
39
|
+
--contour-menu-shadow: #00000012;
|
|
40
|
+
--contour-space-4: 4px;
|
|
41
|
+
--contour-space-8: 8px;
|
|
42
|
+
--contour-space-12: 12px;
|
|
43
|
+
--contour-space-16: 16px;
|
|
44
|
+
--contour-space-24: 24px;
|
|
45
|
+
--contour-space-32: 32px;
|
|
46
|
+
--contour-space-48: 48px;
|
|
47
|
+
--contour-space-64: 64px;
|
|
48
|
+
--contour-space-104: 104px;
|
|
49
|
+
--contour-text-body: 15px;
|
|
50
|
+
--contour-text-small: 13px;
|
|
51
|
+
--contour-text-label: 11px;
|
|
52
|
+
--contour-text-lead: 24px;
|
|
53
|
+
--contour-text-display: clamp(48px, 8vw, 116px);
|
|
54
|
+
--contour-z-overlay: 30;
|
|
55
|
+
--contour-inverse-accent: var(--contour-acid);
|
|
56
|
+
--contour-inverse-mark: var(--contour-acid);
|
|
57
|
+
--contour-depth-base: var(--contour-ink);
|
|
58
|
+
--contour-floating-outline: transparent;
|
|
59
|
+
}
|
|
60
|
+
:where(:root[data-theme="dark"], [data-contour-theme="dark"]) {
|
|
61
|
+
--contour-bg: #0f100d;
|
|
62
|
+
--contour-fg: #eef0e6;
|
|
63
|
+
--contour-muted: #9a9e90;
|
|
64
|
+
--contour-line: #2a2d24;
|
|
65
|
+
--contour-line-strong: #444939;
|
|
66
|
+
--contour-surface: #171913;
|
|
67
|
+
--contour-surface-sunken: #0a0b09;
|
|
68
|
+
--contour-overlay: #050605cc;
|
|
69
|
+
--contour-shadow-raised: 0 1px 2px #0000004d, 0 10px 28px #00000059;
|
|
70
|
+
--contour-shadow-floating: 0 24px 56px #00000099;
|
|
71
|
+
--contour-olive: #c2e042;
|
|
72
|
+
--contour-signal: var(--contour-acid);
|
|
73
|
+
--contour-success: #b5d33f;
|
|
74
|
+
--contour-success-soft: #222914;
|
|
75
|
+
--contour-info: #8fc0d6;
|
|
76
|
+
--contour-info-soft: #152227;
|
|
77
|
+
--contour-warning: #f0c063;
|
|
78
|
+
--contour-warning-soft: #2b2311;
|
|
79
|
+
--contour-danger: #ff8a70;
|
|
80
|
+
--contour-danger-soft: #2f1914;
|
|
81
|
+
--contour-invert-bg: var(--contour-paper);
|
|
82
|
+
--contour-invert-fg: var(--contour-ink);
|
|
83
|
+
--contour-menu-shadow: #00000066;
|
|
84
|
+
--contour-inverse-accent: #5a7210;
|
|
85
|
+
--contour-inverse-mark: var(--contour-ink);
|
|
86
|
+
--contour-depth-base: #5a7210;
|
|
87
|
+
--contour-floating-outline: #353733;
|
|
88
|
+
color-scheme: dark;
|
|
89
|
+
}
|
|
90
|
+
:where([data-contour-theme="light"]) {
|
|
91
|
+
--contour-bg: var(--contour-paper);
|
|
92
|
+
--contour-fg: var(--contour-ink);
|
|
93
|
+
--contour-muted: #63665f;
|
|
94
|
+
--contour-line: #d6d8d0;
|
|
95
|
+
--contour-line-strong: #b4b8ac;
|
|
96
|
+
--contour-surface: #fbfbf8;
|
|
97
|
+
--contour-surface-sunken: #e8e9e1;
|
|
98
|
+
--contour-overlay: #171817b8;
|
|
99
|
+
--contour-shadow-raised: 0 1px 2px #1718170d, 0 10px 28px #17181712;
|
|
100
|
+
--contour-shadow-floating: 0 24px 56px #1718172e;
|
|
101
|
+
--contour-olive: #75901a;
|
|
102
|
+
--contour-signal: #4d7522;
|
|
103
|
+
--contour-success: #3f6119;
|
|
104
|
+
--contour-success-soft: #e4ecc9;
|
|
105
|
+
--contour-info: #2f6a82;
|
|
106
|
+
--contour-info-soft: #dbe8ec;
|
|
107
|
+
--contour-warning: #7a5100;
|
|
108
|
+
--contour-warning-soft: #f5e6c3;
|
|
109
|
+
--contour-danger: #a8321c;
|
|
110
|
+
--contour-danger-soft: #f7dcd3;
|
|
111
|
+
--contour-invert-bg: var(--contour-ink);
|
|
112
|
+
--contour-invert-fg: var(--contour-paper);
|
|
113
|
+
--contour-menu-shadow: #00000012;
|
|
114
|
+
--contour-inverse-accent: var(--contour-acid);
|
|
115
|
+
--contour-inverse-mark: var(--contour-acid);
|
|
116
|
+
--contour-depth-base: var(--contour-ink);
|
|
117
|
+
--contour-floating-outline: transparent;
|
|
118
|
+
color-scheme: light;
|
|
119
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/* Shared UI patterns: brand mark, section scaffolding, links, disclosures, and reveal animations. */
|
|
2
|
+
|
|
3
|
+
.contour-brand {
|
|
4
|
+
font-family: var(--contour-font-display);
|
|
5
|
+
font-size: 34px;
|
|
6
|
+
line-height: 1;
|
|
7
|
+
font-weight: 700;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.contour-brand > span {
|
|
11
|
+
color: var(--contour-olive);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.contour-section-label {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
gap: 24px;
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
padding-bottom: 24px;
|
|
20
|
+
border-bottom: 1px solid var(--contour-line);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.contour-text-link {
|
|
24
|
+
width: fit-content;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 18px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
border-bottom: 1px solid currentColor;
|
|
30
|
+
padding-block: 8px;
|
|
31
|
+
transition: gap 300ms var(--contour-ease);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.contour-text-link:hover {
|
|
35
|
+
gap: 26px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Disclosure: native details/summary with a plus icon that rotates into a cross. */
|
|
39
|
+
.contour-disclosure > summary {
|
|
40
|
+
list-style: none;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.contour-disclosure > summary::-webkit-details-marker {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.contour-disclosure-icon {
|
|
49
|
+
transition: transform 300ms;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.contour-disclosure[open] .contour-disclosure-icon {
|
|
53
|
+
transform: rotate(45deg);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Two-column intro + content layout used by Experience and Expertise. */
|
|
57
|
+
|
|
58
|
+
/* Reveal: content fades up once, and heading lines slide up inside a clip. */
|
|
59
|
+
.contour-reveal {
|
|
60
|
+
opacity: 0;
|
|
61
|
+
transform: translateY(24px);
|
|
62
|
+
transition:
|
|
63
|
+
opacity 700ms var(--contour-ease),
|
|
64
|
+
transform 700ms var(--contour-ease);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.contour-reveal.contour-is-visible {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
transform: translateY(0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.contour-type-line {
|
|
73
|
+
display: block;
|
|
74
|
+
overflow: clip;
|
|
75
|
+
padding-block: 0.09em;
|
|
76
|
+
margin-block: -0.09em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.contour-type-run {
|
|
80
|
+
display: block;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
transform: translateY(105%);
|
|
83
|
+
transition:
|
|
84
|
+
transform 850ms var(--contour-ease),
|
|
85
|
+
opacity 650ms ease;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.contour-type-line:nth-child(2) .contour-type-run {
|
|
89
|
+
transition-delay: 110ms;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.contour-type-line:nth-child(3) .contour-type-run {
|
|
93
|
+
transition-delay: 220ms;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.contour-reveal.contour-is-visible .contour-type-run {
|
|
97
|
+
opacity: 1;
|
|
98
|
+
transform: translateY(0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes contour-rise-in {
|
|
102
|
+
from {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
transform: translateY(18px);
|
|
105
|
+
}
|
|
106
|
+
to {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: translateY(0);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (max-width: 1023px) {
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media (max-width: 767px) {
|
|
116
|
+
.contour-brand {
|
|
117
|
+
font-size: 30px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.contour-section-label {
|
|
121
|
+
padding-bottom: 19px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.contour-section-label > span:last-child {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Shared accessibility and typography utilities also work with an application-owned reset. */
|
|
2
|
+
.contour-mono {
|
|
3
|
+
font-family: var(--contour-font-mono);
|
|
4
|
+
font-size: var(--contour-text-label);
|
|
5
|
+
line-height: 1.6;
|
|
6
|
+
}
|
|
7
|
+
.contour-visually-hidden {
|
|
8
|
+
position: absolute;
|
|
9
|
+
width: 1px;
|
|
10
|
+
height: 1px;
|
|
11
|
+
margin: -1px;
|
|
12
|
+
padding: 0;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
clip-path: inset(50%);
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
border: 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./scoped/tokens.css";
|
package/dist/scoped.css
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import "./scoped/tokens.css";
|
|
2
|
+
@import "./scoped/base.css";
|
|
3
|
+
@import "./scoped/utilities.css";
|
|
4
|
+
@import "./scoped/ui.css";
|
|
5
|
+
@import "./scoped/kit/actions.css";
|
|
6
|
+
@import "./scoped/kit/forms.css";
|
|
7
|
+
@import "./scoped/kit/navigation.css";
|
|
8
|
+
@import "./scoped/kit/data-display.css";
|
|
9
|
+
@import "./scoped/kit/feedback.css";
|
|
10
|
+
@import "./scoped/kit/overlays.css";
|
|
11
|
+
@import "./scoped/kit/effects.css";
|
|
12
|
+
@import "./scoped/theme-toggle.css";
|
package/dist/theme-toggle.css
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
/* The icon for the theme you can switch to is shown; the other spins away. */
|
|
29
29
|
.theme-icon-sun,
|
|
30
|
-
|
|
30
|
+
.theme-toggle[aria-pressed="true"] .theme-icon-moon {
|
|
31
31
|
opacity: 0;
|
|
32
32
|
transform: rotate(-120deg) scale(0.3);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
.theme-toggle[aria-pressed="true"] .theme-icon-sun {
|
|
36
36
|
opacity: 1;
|
|
37
37
|
transform: none;
|
|
38
38
|
}
|