@neo-ui-kit/react 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +213 -2
- package/dist/artwork/icons.json.d.ts +2 -0
- package/dist/artwork/illustrations.json.d.ts +2 -0
- package/dist/chunks/chunk-347P6ZE4.js +104 -0
- package/dist/chunks/chunk-BJSFN52W.js +417 -0
- package/dist/chunks/chunk-FCOU3ODR.js +63 -0
- package/dist/chunks/chunk-JZ4GDTH5.js +87 -0
- package/dist/chunks/chunk-UGDRXR7P.js +3362 -0
- package/dist/chunks/chunk-VK6GHRLV.js +335 -0
- package/dist/chunks/chunk-YKCUOZ7V.js +777 -0
- package/dist/components/artwork/DatabaseArt/DatabaseArt.d.ts +6 -0
- package/dist/components/artwork/DatabaseArt/styles.css +58 -0
- package/dist/components/artwork/Landscape/Landscape.d.ts +7 -0
- package/dist/components/artwork/Landscape/styles.css +79 -0
- package/dist/components/artwork/NeonWaves/NeonWaves.d.ts +15 -0
- package/dist/components/artwork/NeonWaves/styles.css +48 -0
- package/dist/components/artwork/Planet/Planet.d.ts +4 -0
- package/dist/components/artwork/Planet/styles.css +52 -0
- package/dist/components/artwork/QuantumField/QuantumField.d.ts +42 -0
- package/dist/components/artwork/QuantumField/QuantumFieldExperience.d.ts +22 -0
- package/dist/components/artwork/QuantumField/UPSTREAM-LICENSE.txt +21 -0
- package/dist/components/artwork/QuantumField/audio.d.ts +15 -0
- package/dist/components/artwork/QuantumField/renderer.d.ts +24 -0
- package/dist/components/artwork/QuantumField/styles.css +77 -0
- package/dist/components/artwork/ServerArt/ServerArt.d.ts +8 -0
- package/dist/components/artwork/ServerArt/styles.css +43 -0
- package/dist/components/artwork/Spectrum/Spectrum.d.ts +7 -0
- package/dist/components/artwork/Spectrum/styles.css +35 -0
- package/dist/components/artwork/layers.d.ts +15 -0
- package/dist/components/artwork/useArtwork.d.ts +8 -0
- package/dist/components/controls/Autocomplete/Autocomplete.d.ts +2 -0
- package/dist/components/controls/Autocomplete/styles.css +1 -0
- package/dist/components/controls/Button/Button.d.ts +2 -0
- package/dist/components/controls/Button/styles.css +1 -0
- package/dist/components/controls/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/controls/Checkbox/styles.css +70 -0
- package/dist/components/controls/Chip/Chip.d.ts +21 -0
- package/dist/components/controls/Chip/styles.css +74 -0
- package/dist/components/controls/ChipField.d.ts +25 -0
- package/dist/components/controls/ColorPicker/ColorPicker.d.ts +16 -0
- package/dist/components/controls/ColorPicker/color.d.ts +9 -0
- package/dist/components/controls/ColorPicker/styles.css +103 -0
- package/dist/components/controls/DatePicker/DatePicker.d.ts +19 -0
- package/dist/components/controls/DatePicker/styles.css +69 -0
- package/dist/components/controls/FilePicker/FilePicker.d.ts +2 -0
- package/dist/components/controls/FilePicker/styles.css +149 -0
- package/dist/components/controls/IconButton/IconButton.d.ts +2 -0
- package/dist/components/controls/IconButton/styles.css +4 -0
- package/dist/components/controls/InputBase/InputBase.d.ts +21 -0
- package/dist/components/controls/InputBase/styles.css +379 -0
- package/dist/components/controls/Link/Link.d.ts +11 -0
- package/dist/components/controls/Link/styles.css +50 -0
- package/dist/components/controls/NumberField/NumberField.d.ts +2 -0
- package/dist/components/controls/NumberField/styles.css +1 -0
- package/dist/components/controls/PeoplePicker/PeoplePicker.d.ts +37 -0
- package/dist/components/controls/PeoplePicker/styles.css +7 -0
- package/dist/components/controls/SegmentedControl/SegmentedControl.d.ts +2 -0
- package/dist/components/controls/SegmentedControl/styles.css +9 -0
- package/dist/components/controls/Select/Select.d.ts +8 -0
- package/dist/components/controls/Select/styles.css +142 -0
- package/dist/components/controls/Slider/Slider.d.ts +3 -0
- package/dist/components/controls/Slider/styles.css +138 -0
- package/dist/components/controls/SplitButton/SplitButton.d.ts +2 -0
- package/dist/components/controls/SplitButton/styles.css +169 -0
- package/dist/components/controls/Switch/Switch.d.ts +2 -0
- package/dist/components/controls/Switch/styles.css +54 -0
- package/dist/components/controls/Tab/Tab.d.ts +2 -0
- package/dist/components/controls/Tab/styles.css +111 -0
- package/dist/components/controls/Tabs/Tabs.d.ts +2 -0
- package/dist/components/controls/Tabs/styles.css +239 -0
- package/dist/components/controls/TagInput/TagInput.d.ts +24 -0
- package/dist/components/controls/TagInput/styles.css +24 -0
- package/dist/components/controls/TextArea/TextArea.d.ts +2 -0
- package/dist/components/controls/TextArea/styles.css +15 -0
- package/dist/components/controls/TextField/TextField.d.ts +2 -0
- package/dist/components/controls/ThemePicker/ThemePicker.d.ts +24 -0
- package/dist/components/controls/ThemePicker/styles.css +128 -0
- package/dist/components/controls/ToggleButton/ToggleButton.d.ts +2 -0
- package/dist/components/controls/ToggleButton/styles.css +49 -0
- package/dist/components/controls/internal.d.ts +62 -0
- package/dist/components/controls/shared.css +694 -0
- package/dist/components/controls/shared.d.ts +204 -0
- package/dist/components/editor/PianoRoll/PianoRoll.d.ts +65 -0
- package/dist/components/editor/PianoRoll/styles.css +186 -0
- package/dist/components/editor/shared.css +1 -0
- package/dist/components/effects/AnimatedBorder/AnimatedBorder.d.ts +9 -0
- package/dist/components/effects/AnimatedBorder/styles.css +7 -0
- package/dist/components/effects/Beacon/Beacon.d.ts +9 -0
- package/dist/components/effects/Beacon/styles.css +38 -0
- package/dist/components/effects/Equalizer/Equalizer.d.ts +14 -0
- package/dist/components/effects/Equalizer/styles.css +38 -0
- package/dist/components/effects/GlowText/GlowText.d.ts +9 -0
- package/dist/components/effects/GlowText/styles.css +56 -0
- package/dist/components/effects/ImageShine/ImageShine.d.ts +13 -0
- package/dist/components/effects/ImageShine/styles.css +66 -0
- package/dist/components/effects/Marquee/Marquee.d.ts +9 -0
- package/dist/components/effects/Marquee/styles.css +46 -0
- package/dist/components/effects/MelodixText/MelodixText.d.ts +15 -0
- package/dist/components/effects/MelodixText/styles.css +28 -0
- package/dist/components/effects/Reveal/Reveal.d.ts +13 -0
- package/dist/components/effects/Reveal/styles.css +25 -0
- package/dist/components/effects/Shimmer/Shimmer.d.ts +10 -0
- package/dist/components/effects/Shimmer/styles.css +48 -0
- package/dist/components/effects/Sparkles/Sparkles.d.ts +9 -0
- package/dist/components/effects/Sparkles/styles.css +28 -0
- package/dist/components/effects/Spotlight/Spotlight.d.ts +11 -0
- package/dist/components/effects/Spotlight/styles.css +45 -0
- package/dist/components/effects/Tilt/Tilt.d.ts +11 -0
- package/dist/components/effects/Tilt/styles.css +67 -0
- package/dist/components/feedback/Badge/Badge.d.ts +3 -0
- package/dist/components/feedback/Badge/styles.css +91 -0
- package/dist/components/feedback/CollapsibleSection/CollapsibleSection.d.ts +2 -0
- package/dist/components/feedback/CollapsibleSection/styles.css +76 -0
- package/dist/components/feedback/DataTable/DataTable.d.ts +16 -0
- package/dist/components/feedback/DataTable/styles.css +522 -0
- package/dist/components/feedback/Dialog/Dialog.d.ts +2 -0
- package/dist/components/feedback/Dialog/styles.css +82 -0
- package/dist/components/feedback/EmptyState/EmptyState.d.ts +2 -0
- package/dist/components/feedback/EmptyState/styles.css +80 -0
- package/dist/components/feedback/KeyValueList/KeyValueList.d.ts +2 -0
- package/dist/components/feedback/KeyValueList/styles.css +51 -0
- package/dist/components/feedback/Menu/Menu.d.ts +2 -0
- package/dist/components/feedback/Menu/styles.css +123 -0
- package/dist/components/feedback/MenuItem/MenuItem.d.ts +2 -0
- package/dist/components/feedback/MenuItem/styles.css +71 -0
- package/dist/components/feedback/MessageBar/MessageBar.d.ts +2 -0
- package/dist/components/feedback/MessageBar/styles.css +116 -0
- package/dist/components/feedback/Popover/Popover.d.ts +2 -0
- package/dist/components/feedback/Popover/styles.css +44 -0
- package/dist/components/feedback/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/components/feedback/ProgressBar/styles.css +76 -0
- package/dist/components/feedback/SignalBars/SignalBars.d.ts +11 -0
- package/dist/components/feedback/SignalBars/styles.css +31 -0
- package/dist/components/feedback/StatusIndicator/StatusIndicator.d.ts +2 -0
- package/dist/components/feedback/StatusIndicator/styles.css +88 -0
- package/dist/components/feedback/Steps/Steps.d.ts +2 -0
- package/dist/components/feedback/Steps/styles.css +152 -0
- package/dist/components/feedback/Toast/Toast.d.ts +2 -0
- package/dist/components/feedback/Toast/styles.css +89 -0
- package/dist/components/feedback/Tooltip/Tooltip.d.ts +15 -0
- package/dist/components/feedback/Tooltip/styles.css +38 -0
- package/dist/components/feedback/shared.css +22 -0
- package/dist/components/feedback/shared.d.ts +231 -0
- package/dist/components/forms/Form/Form.d.ts +35 -0
- package/dist/components/forms/Form/styles.css +1 -0
- package/dist/components/forms/FormFields/FormFields.d.ts +20 -0
- package/dist/components/forms/FormFields/styles.css +72 -0
- package/dist/components/foundation/Loader/Loader.d.ts +30 -0
- package/dist/components/foundation/LoaderGenerator/LoaderGenerator.d.ts +38 -0
- package/dist/components/foundation/LoaderGenerator/styles.css +104 -0
- package/dist/components/foundation/ThemeEditor/ThemeEditor.d.ts +15 -0
- package/dist/components/foundation/ThemeEditor/styles.css +97 -0
- package/dist/components/foundation/ThemeEditor/themeConfig.d.ts +47 -0
- package/dist/components/foundation/ThemeProvider/ThemeProvider.d.ts +32 -0
- package/dist/components/foundation/ThemeProvider/styles.css +59 -0
- package/dist/components/foundation/Typography/Typography.d.ts +17 -0
- package/dist/components/foundation/Typography/styles.css +115 -0
- package/dist/components/layout/Avatar/Avatar.d.ts +2 -0
- package/dist/components/layout/Avatar/HostSeal.d.ts +5 -0
- package/dist/components/layout/Avatar/styles.css +166 -0
- package/dist/components/layout/BrandMark/BrandMark.d.ts +2 -0
- package/dist/components/layout/BrandMark/styles.css +39 -0
- package/dist/components/layout/ButtonGroup/ButtonGroup.d.ts +12 -0
- package/dist/components/layout/ButtonGroup/styles.css +36 -0
- package/dist/components/layout/Card/Card.d.ts +14 -0
- package/dist/components/layout/Card/styles.css +37 -0
- package/dist/components/layout/DialogActions/DialogActions.d.ts +12 -0
- package/dist/components/layout/DialogActions/styles.css +31 -0
- package/dist/components/layout/DialogBody/DialogBody.d.ts +12 -0
- package/dist/components/layout/DialogBody/styles.css +28 -0
- package/dist/components/layout/Divider/Divider.d.ts +2 -0
- package/dist/components/layout/Divider/styles.css +58 -0
- package/dist/components/layout/FloatingPanel/FloatingPanel.d.ts +15 -0
- package/dist/components/layout/FloatingPanel/styles.css +47 -0
- package/dist/components/layout/FloatingPanel/useFloatingPanel.d.ts +54 -0
- package/dist/components/layout/Grid/Grid.d.ts +24 -0
- package/dist/components/layout/Grid/styles.css +90 -0
- package/dist/components/layout/Header/Header.d.ts +2 -0
- package/dist/components/layout/Header/styles.css +42 -0
- package/dist/components/layout/Icon/Icon.d.ts +4 -0
- package/dist/components/layout/Icon/styles.css +62 -0
- package/dist/components/layout/Illustration/Illustration.d.ts +2 -0
- package/dist/components/layout/Illustration/styles.css +104 -0
- package/dist/components/layout/ScrollArea/ScrollArea.d.ts +2 -0
- package/dist/components/layout/ScrollArea/styles.css +61 -0
- package/dist/components/layout/Stack/Stack.d.ts +21 -0
- package/dist/components/layout/Stack/styles.css +53 -0
- package/dist/components/layout/StatTile/StatTile.d.ts +20 -0
- package/dist/components/layout/StatTile/styles.css +90 -0
- package/dist/components/layout/TabPanel/TabPanel.d.ts +2 -0
- package/dist/components/layout/TabPanel/styles.css +16 -0
- package/dist/components/layout/Text/Text.d.ts +2 -0
- package/dist/components/layout/Text/styles.css +29 -0
- package/dist/components/layout/Toolbar/Toolbar.d.ts +12 -0
- package/dist/components/layout/Toolbar/styles.css +7 -0
- package/dist/components/layout/shared.css +79 -0
- package/dist/components/layout/shared.d.ts +64 -0
- package/dist/components/media/AudioPlayer/AudioPlayer.d.ts +2 -0
- package/dist/components/media/AudioPlayer/styles.css +86 -0
- package/dist/components/media/KaraokeLyrics/KaraokeLyrics.d.ts +25 -0
- package/dist/components/media/KaraokeLyrics/styles.css +56 -0
- package/dist/components/media/LevelMeter/LevelMeter.d.ts +7 -0
- package/dist/components/media/LevelMeter/styles.css +30 -0
- package/dist/components/media/MediaCard/MediaCard.d.ts +24 -0
- package/dist/components/media/MediaCard/styles.css +108 -0
- package/dist/components/media/MelodyRoll/MelodyRoll.d.ts +48 -0
- package/dist/components/media/MelodyRoll/styles.css +196 -0
- package/dist/components/media/PianoKeyboard/PianoKeyboard.d.ts +24 -0
- package/dist/components/media/PianoKeyboard/styles.css +83 -0
- package/dist/components/media/RotaryKnob/RotaryKnob.d.ts +3 -0
- package/dist/components/media/RotaryKnob/styles.css +319 -0
- package/dist/components/media/Sparkline/Sparkline.d.ts +2 -0
- package/dist/components/media/Sparkline/styles.css +70 -0
- package/dist/components/media/WaveDecoration/WaveDecoration.d.ts +2 -0
- package/dist/components/media/WaveDecoration/styles.css +2 -0
- package/dist/components/media/Waveform/Waveform.d.ts +9 -0
- package/dist/components/media/Waveform/styles.css +375 -0
- package/dist/components/media/Waveform/useWaveformPeaks.d.ts +11 -0
- package/dist/components/media/shared.css +7 -0
- package/dist/components/media/shared.d.ts +80 -0
- package/dist/components/navigation/Router/Router.d.ts +32 -0
- package/dist/components/navigation/Router/styles.css +1 -0
- package/dist/components.css +102 -0
- package/dist/core/artwork.d.ts +17 -0
- package/dist/core/base.d.ts +65 -0
- package/dist/core/environment.d.ts +5 -0
- package/dist/core/i18n.d.ts +34 -0
- package/dist/core/messages.d.ts +1 -0
- package/dist/core/motion/hooks.d.ts +17 -0
- package/dist/core/motion-engine.d.ts +13 -0
- package/dist/core/noise.d.ts +20 -0
- package/dist/core/providers/context.d.ts +4 -0
- package/dist/core/responsive.d.ts +13 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.js +56 -0
- package/dist/editor.d.ts +2 -0
- package/dist/editor.js +8 -0
- package/dist/fonts/melodix/Melodix-100.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-200.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-300.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-400.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-500.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-600.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-700.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-800.woff2 +0 -0
- package/dist/fonts/melodix/Melodix-900.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-100.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-200.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-300.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-400.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-500.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-600.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-700.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-800.woff2 +0 -0
- package/dist/fonts/melodix/MelodixText-900.woff2 +0 -0
- package/dist/fonts/melodix/OFL-PlayfairDisplay.txt +93 -0
- package/dist/fonts/melodix.css +123 -0
- package/dist/forms.d.ts +4 -0
- package/dist/forms.js +17 -0
- package/dist/index.d.ts +163 -0
- package/dist/index.js +9683 -0
- package/dist/router.d.ts +2 -0
- package/dist/router.js +11 -0
- package/dist/styles.css +2 -0
- package/dist/theme/base.css +221 -0
- package/dist/theme/tokens.css +196 -0
- package/dist/theme/typography.d.ts +24 -0
- package/dist/tokens.css +1 -0
- package/package.json +83 -4
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/* Styles owned by Steps: nodes on a rail; energy flows along the rail into the current step. */
|
|
2
|
+
.ad-steps {
|
|
3
|
+
--ad-step-node: 1.9rem;
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-auto-flow: column;
|
|
6
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
7
|
+
padding: 0;
|
|
8
|
+
margin: 0;
|
|
9
|
+
list-style: none;
|
|
10
|
+
}
|
|
11
|
+
.ad-steps > li {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: grid;
|
|
14
|
+
justify-items: center;
|
|
15
|
+
align-content: start;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
/* Rail segment from the previous node to this one. */
|
|
21
|
+
.ad-steps > li + li::before {
|
|
22
|
+
content: "";
|
|
23
|
+
position: absolute;
|
|
24
|
+
z-index: 0;
|
|
25
|
+
top: calc(var(--ad-step-node) / 2 - 0.0625rem);
|
|
26
|
+
right: calc(50% + var(--ad-step-node) / 2 + 0.25rem);
|
|
27
|
+
left: calc(-50% + var(--ad-step-node) / 2 + 0.25rem);
|
|
28
|
+
height: 0.125rem;
|
|
29
|
+
border-radius: 999rem;
|
|
30
|
+
background: #ffffff14;
|
|
31
|
+
}
|
|
32
|
+
.ad-steps > li[data-state="done"] + li::before,
|
|
33
|
+
.ad-steps > li + li[data-state="done"]::before {
|
|
34
|
+
background: linear-gradient(90deg, var(--ad-primary), var(--ad-secondary));
|
|
35
|
+
box-shadow: 0 0 0.5rem rgb(from var(--ad-primary) r g b / 0.53);
|
|
36
|
+
}
|
|
37
|
+
.ad-steps > li + li[data-state="current"]::before {
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
background: linear-gradient(90deg, var(--ad-primary) 0 40%, rgb(from var(--ad-primary) r g b / 0.25) 100%);
|
|
40
|
+
box-shadow: 0 0 0.5rem rgb(from var(--ad-primary) r g b / 0.53);
|
|
41
|
+
}
|
|
42
|
+
/* The line toward the current step carries a running glint. */
|
|
43
|
+
.ad-steps > li[data-state="current"] {
|
|
44
|
+
--ad-steps-glint: 1;
|
|
45
|
+
}
|
|
46
|
+
.ad-steps-glint {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: calc(var(--ad-step-node) / 2 - 0.0625rem);
|
|
49
|
+
right: calc(50% + var(--ad-step-node) / 2 + 0.25rem);
|
|
50
|
+
left: calc(-50% + var(--ad-step-node) / 2 + 0.25rem);
|
|
51
|
+
height: 0.125rem;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
border-radius: 999rem;
|
|
54
|
+
clip-path: inset(0 round 999rem);
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
/* The glint is 30% of the line and slides from 28% left of it to 98% across, on its own layer. */
|
|
58
|
+
.ad-steps-glint::before {
|
|
59
|
+
content: "";
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0;
|
|
62
|
+
width: 30%;
|
|
63
|
+
background: linear-gradient(90deg, transparent, var(--ad-neutral-200), transparent);
|
|
64
|
+
transform: translateX(-93.333%);
|
|
65
|
+
animation: ad-steps-flow 1.6s linear infinite;
|
|
66
|
+
will-change: transform;
|
|
67
|
+
}
|
|
68
|
+
.ad-step-node {
|
|
69
|
+
position: relative;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
display: grid;
|
|
72
|
+
place-items: center;
|
|
73
|
+
width: var(--ad-step-node);
|
|
74
|
+
height: var(--ad-step-node);
|
|
75
|
+
border-radius: 50%;
|
|
76
|
+
font-size: 0.75rem;
|
|
77
|
+
font-weight: 700;
|
|
78
|
+
color: var(--ad-neutral-500);
|
|
79
|
+
background: var(--ad-neutral-900);
|
|
80
|
+
box-shadow: inset 0 0 0 0.0625rem #ffffff26;
|
|
81
|
+
transition:
|
|
82
|
+
background 0.3s,
|
|
83
|
+
box-shadow 0.3s,
|
|
84
|
+
color 0.3s;
|
|
85
|
+
}
|
|
86
|
+
.ad-step-node > .ad-icon {
|
|
87
|
+
--ad-icon-size: 1rem;
|
|
88
|
+
animation: ad-steps-pop 0.45s cubic-bezier(0.34, 1.6, 0.5, 1) both;
|
|
89
|
+
}
|
|
90
|
+
.ad-steps > li[data-state="done"] .ad-step-node {
|
|
91
|
+
color: #fff;
|
|
92
|
+
background: linear-gradient(180deg, var(--ad-primary), var(--ad-primary-700));
|
|
93
|
+
box-shadow:
|
|
94
|
+
inset 0 0.0625rem 0 rgb(from var(--ad-secondary-100) r g b / 0.53),
|
|
95
|
+
0 0 0.6rem rgb(from var(--ad-primary) r g b / 0.4);
|
|
96
|
+
}
|
|
97
|
+
.ad-steps > li[data-state="current"] .ad-step-node {
|
|
98
|
+
color: #fff;
|
|
99
|
+
background: radial-gradient(circle, rgb(from var(--ad-primary) r g b / 0.33), var(--ad-neutral-900) 70%);
|
|
100
|
+
box-shadow:
|
|
101
|
+
inset 0 0 0 0.125rem var(--ad-secondary),
|
|
102
|
+
0 0 0.9rem rgb(from var(--ad-primary) r g b / 0.53);
|
|
103
|
+
}
|
|
104
|
+
.ad-steps > li[data-state="current"] .ad-step-node::before {
|
|
105
|
+
content: "";
|
|
106
|
+
position: absolute;
|
|
107
|
+
inset: 0;
|
|
108
|
+
border-radius: 50%;
|
|
109
|
+
box-shadow: inset 0 0 0 0.125rem var(--ad-secondary-200), 0 0 1.4rem rgb(from var(--ad-primary) r g b / 0.67);
|
|
110
|
+
opacity: 0;
|
|
111
|
+
animation: ad-steps-pulse 1.8s ease-in-out infinite;
|
|
112
|
+
}
|
|
113
|
+
/* Orbiting dashed ring around the current node. */
|
|
114
|
+
.ad-steps > li[data-state="current"] .ad-step-node::after {
|
|
115
|
+
content: "";
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset: -0.3rem;
|
|
118
|
+
border-radius: 50%;
|
|
119
|
+
border: 0.0625rem dashed rgb(from var(--ad-secondary) r g b / 0.67);
|
|
120
|
+
animation: ad-steps-orbit 6s linear infinite;
|
|
121
|
+
}
|
|
122
|
+
.ad-step-label {
|
|
123
|
+
max-width: 100%;
|
|
124
|
+
font-size: var(--ad-font-size-caption);
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
color: var(--ad-neutral-500);
|
|
127
|
+
overflow-wrap: anywhere;
|
|
128
|
+
}
|
|
129
|
+
.ad-steps > li:is([data-state="done"], [data-state="current"]) .ad-step-label {
|
|
130
|
+
color: var(--ad-neutral-200);
|
|
131
|
+
}
|
|
132
|
+
@keyframes ad-steps-flow {
|
|
133
|
+
to {
|
|
134
|
+
transform: translateX(326.667%);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
@keyframes ad-steps-pulse {
|
|
138
|
+
50% {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
@keyframes ad-steps-orbit {
|
|
143
|
+
to {
|
|
144
|
+
rotate: 1turn;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
@keyframes ad-steps-pop {
|
|
148
|
+
from {
|
|
149
|
+
scale: 0;
|
|
150
|
+
rotate: -45deg;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* Styles owned by Toast: springs in with a tone-lit icon ring; a burning fuse shows the time left. */
|
|
2
|
+
.ad-toast {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 0.8rem;
|
|
7
|
+
min-width: min(18rem, 100%);
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
font-size: var(--ad-font-size-body-sm);
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
padding: 0.7rem 1.2rem 0.75rem 0.7rem;
|
|
12
|
+
border: 0.0625rem solid color-mix(in srgb, var(--ad-tone) 40%, transparent);
|
|
13
|
+
border-radius: 2rem;
|
|
14
|
+
background:
|
|
15
|
+
radial-gradient(
|
|
16
|
+
60% 140% at 0 50%,
|
|
17
|
+
color-mix(in srgb, var(--ad-tone) 22%, transparent),
|
|
18
|
+
transparent 70%
|
|
19
|
+
),
|
|
20
|
+
rgb(from var(--ad-neutral-900) r g b / 0.95);
|
|
21
|
+
box-shadow:
|
|
22
|
+
0 0.8rem 2rem #000b,
|
|
23
|
+
0 0 1.2rem color-mix(in srgb, var(--ad-tone) 25%, transparent);
|
|
24
|
+
backdrop-filter: blur(1rem);
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
animation: ad-toast-in 0.55s cubic-bezier(0.34, 1.5, 0.5, 1) both;
|
|
27
|
+
}
|
|
28
|
+
.ad-toast > :nth-child(2) {
|
|
29
|
+
min-width: 0;
|
|
30
|
+
overflow-wrap: anywhere;
|
|
31
|
+
}
|
|
32
|
+
.ad-toast-icon {
|
|
33
|
+
display: grid;
|
|
34
|
+
place-items: center;
|
|
35
|
+
flex: none;
|
|
36
|
+
width: 2rem;
|
|
37
|
+
height: 2rem;
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
color: #fff;
|
|
40
|
+
background: radial-gradient(
|
|
41
|
+
circle at 35% 30%,
|
|
42
|
+
color-mix(in srgb, var(--ad-tone) 70%, #fff),
|
|
43
|
+
var(--ad-tone) 70%
|
|
44
|
+
);
|
|
45
|
+
box-shadow: 0 0 0.9rem var(--ad-tone);
|
|
46
|
+
animation: ad-toast-icon 0.6s 0.15s cubic-bezier(0.34, 1.6, 0.5, 1) both;
|
|
47
|
+
}
|
|
48
|
+
.ad-toast-icon > .ad-icon {
|
|
49
|
+
--ad-icon-size: 1.05rem;
|
|
50
|
+
color: var(--ad-neutral-900);
|
|
51
|
+
}
|
|
52
|
+
.ad-toast-floating {
|
|
53
|
+
position: fixed;
|
|
54
|
+
bottom: 1.5rem;
|
|
55
|
+
left: 50%;
|
|
56
|
+
translate: -50% 0;
|
|
57
|
+
z-index: 9999;
|
|
58
|
+
min-width: min(18rem, 90vw);
|
|
59
|
+
max-width: min(90vw, 46.875rem);
|
|
60
|
+
}
|
|
61
|
+
.ad-toast-timer {
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: 1.5rem;
|
|
64
|
+
right: 1.5rem;
|
|
65
|
+
bottom: 0;
|
|
66
|
+
height: 0.125rem;
|
|
67
|
+
border-radius: 999rem;
|
|
68
|
+
background: linear-gradient(90deg, var(--ad-tone), #fff);
|
|
69
|
+
box-shadow: 0 0 0.5rem var(--ad-tone);
|
|
70
|
+
transform-origin: left;
|
|
71
|
+
animation: ad-toast-timer var(--ad-toast-duration, 3.6s) linear both;
|
|
72
|
+
}
|
|
73
|
+
@keyframes ad-toast-in {
|
|
74
|
+
from {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
transform: translateY(1.5rem) scale(0.85);
|
|
77
|
+
filter: blur(0.3rem);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
@keyframes ad-toast-icon {
|
|
81
|
+
from {
|
|
82
|
+
transform: scale(0) rotate(-90deg);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
@keyframes ad-toast-timer {
|
|
86
|
+
to {
|
|
87
|
+
transform: scaleX(0);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type CommonProps } from "../../../core/base";
|
|
3
|
+
export interface TooltipProps extends CommonProps {
|
|
4
|
+
/** What the tooltip says. */
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
/** The element it explains; it gets `aria-describedby`. */
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
/** Preferred side; it flips when there is no room. */
|
|
9
|
+
placement?: "top" | "bottom";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A short explanation that appears on hover or keyboard focus. It lives in the top layer, so
|
|
13
|
+
* no scrolling or clipping container can cut it off, and it flips to the side with room.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Tooltip({ content, children, placement, ...p }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* Styles owned by Tooltip: a small glass note that rises from its side of the trigger. */
|
|
2
|
+
.ad-tooltip-trigger {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
}
|
|
5
|
+
.ad-tooltip {
|
|
6
|
+
position: fixed;
|
|
7
|
+
inset: auto;
|
|
8
|
+
margin: 0;
|
|
9
|
+
max-width: min(20rem, calc(100vw - 1rem));
|
|
10
|
+
padding: 0.45rem 0.65rem;
|
|
11
|
+
border: 0;
|
|
12
|
+
border-radius: 0.55rem;
|
|
13
|
+
background: rgb(from var(--ad-neutral-950) r g b / 0.94);
|
|
14
|
+
box-shadow:
|
|
15
|
+
inset 0 0 0 0.0625rem rgb(from var(--ad-primary) r g b / 0.35),
|
|
16
|
+
0 0.5rem 1.5rem #000a,
|
|
17
|
+
0 0 1rem rgb(from var(--ad-primary) r g b / 0.18);
|
|
18
|
+
color: var(--ad-text);
|
|
19
|
+
font: var(--ad-font-weight-medium) var(--ad-font-size-caption) / 1.45
|
|
20
|
+
var(--ad-font-family-sans);
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
animation: ad-tooltip-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
|
|
23
|
+
}
|
|
24
|
+
.ad-tooltip[data-ad-side="below"] {
|
|
25
|
+
animation-name: ad-tooltip-in-below;
|
|
26
|
+
}
|
|
27
|
+
@keyframes ad-tooltip-in {
|
|
28
|
+
from {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transform: translateY(0.25rem) scale(0.96);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
@keyframes ad-tooltip-in-below {
|
|
34
|
+
from {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
transform: translateY(-0.25rem) scale(0.96);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* Shared only by sibling components. */
|
|
2
|
+
.ad-steps .ad-status-indicator {
|
|
3
|
+
font-size: 0.625rem;
|
|
4
|
+
gap: 0.3125rem;
|
|
5
|
+
}
|
|
6
|
+
.ad-steps .ad-status-dot {
|
|
7
|
+
width: 1.4375rem;
|
|
8
|
+
height: 1.4375rem;
|
|
9
|
+
}
|
|
10
|
+
.ad-popover,
|
|
11
|
+
.ad-menu {
|
|
12
|
+
position: fixed;
|
|
13
|
+
inset: auto;
|
|
14
|
+
margin: 0;
|
|
15
|
+
min-width: 14.6875rem;
|
|
16
|
+
max-width: 21.875rem;
|
|
17
|
+
padding: 0.5rem;
|
|
18
|
+
border: 0.0625rem solid rgb(from var(--ad-primary-600) r g b / 0.51) !important;
|
|
19
|
+
border-radius: 0.8125rem;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
color: var(--ad-text);
|
|
22
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { ReactNode, RefObject, KeyboardEventHandler } from "react";
|
|
2
|
+
import type { CommonProps, Tone } from "../../core/base";
|
|
3
|
+
export interface DialogProps extends CommonProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** `false` (with `cancelLabel={false}`) leaves the dialog without a footer, e.g. for settings that apply at once. */
|
|
10
|
+
confirmLabel?: string | false;
|
|
11
|
+
cancelLabel?: string | false;
|
|
12
|
+
/** Icon tile beside the title. */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** Label of the close button, for localisation. */
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
/** Decoration painted across the whole window behind its content (artwork, glows, frames). */
|
|
17
|
+
art?: ReactNode;
|
|
18
|
+
/** Close on a click outside the window (default); `false` keeps it open until a button closes it. */
|
|
19
|
+
dismissible?: boolean;
|
|
20
|
+
/** Window width: "narrow" for a short question, "wide" and "large" for forms and lists, "full" for a workspace. */
|
|
21
|
+
width?: "narrow" | "normal" | "wide" | "large" | "full";
|
|
22
|
+
danger?: boolean;
|
|
23
|
+
onConfirm?: () => boolean | void | Promise<boolean | void>;
|
|
24
|
+
}
|
|
25
|
+
export interface PopoverProps extends CommonProps {
|
|
26
|
+
open?: boolean;
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
anchorRef?: RefObject<HTMLElement | null>;
|
|
29
|
+
label?: string;
|
|
30
|
+
role?: "dialog" | "menu" | "listbox";
|
|
31
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
32
|
+
align?: "start" | "end";
|
|
33
|
+
matchAnchorWidth?: boolean;
|
|
34
|
+
/** Move focus into the popover when it opens (default). Off for comboboxes that keep typing focus. */
|
|
35
|
+
autoFocus?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface MenuItemData {
|
|
38
|
+
id?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
icon?: string;
|
|
41
|
+
endIcon?: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
danger?: boolean;
|
|
44
|
+
separator?: boolean;
|
|
45
|
+
onSelect?: () => void;
|
|
46
|
+
}
|
|
47
|
+
export interface MenuItemProps extends CommonProps, MenuItemData {
|
|
48
|
+
}
|
|
49
|
+
export interface MenuProps extends PopoverProps {
|
|
50
|
+
items?: MenuItemData[];
|
|
51
|
+
}
|
|
52
|
+
export interface ToastProps extends CommonProps {
|
|
53
|
+
message?: ReactNode;
|
|
54
|
+
open?: boolean;
|
|
55
|
+
duration?: number;
|
|
56
|
+
onClose?: () => void;
|
|
57
|
+
floating?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface BadgeProps extends CommonProps {
|
|
60
|
+
label?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface MessageBarProps extends CommonProps {
|
|
63
|
+
/** A button or link that resolves the message, e.g. "Повторить". */
|
|
64
|
+
action?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export interface StatusIndicatorProps extends CommonProps {
|
|
67
|
+
status?: Tone;
|
|
68
|
+
label?: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
export interface ProgressBarProps extends CommonProps {
|
|
71
|
+
value?: number;
|
|
72
|
+
max?: number;
|
|
73
|
+
label?: string;
|
|
74
|
+
indeterminate?: boolean;
|
|
75
|
+
/** A bar, or a sound wave that fills with colour from the left (e.g. audio being processed). */
|
|
76
|
+
variant?: "bar" | "wave";
|
|
77
|
+
}
|
|
78
|
+
export interface StepsProps extends CommonProps {
|
|
79
|
+
steps?: string[];
|
|
80
|
+
current?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface EmptyStateProps extends CommonProps {
|
|
83
|
+
title?: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
icon?: string;
|
|
86
|
+
action?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
export interface KeyValueListProps extends CommonProps {
|
|
89
|
+
items?: Array<[ReactNode, ReactNode]>;
|
|
90
|
+
}
|
|
91
|
+
/** A row of a table: named fields, or the cells in column order. */
|
|
92
|
+
export type DataTableRow = Record<string, unknown> | ReactNode[];
|
|
93
|
+
export interface DataTableColumn<T extends DataTableRow = DataTableRow> {
|
|
94
|
+
/** Field of the row (or the cell index for array rows). */
|
|
95
|
+
key: string;
|
|
96
|
+
title: ReactNode;
|
|
97
|
+
align?: "start" | "center" | "end";
|
|
98
|
+
width?: string;
|
|
99
|
+
/** Allow readers to resize this column; on by default. */
|
|
100
|
+
resizable?: boolean;
|
|
101
|
+
/** Click the header to sort; on by default. */
|
|
102
|
+
sortable?: boolean;
|
|
103
|
+
/** Cell content; value(row), or the raw field, by default. */
|
|
104
|
+
render?: (row: T, index: number) => ReactNode;
|
|
105
|
+
/** What sorting, search, filters and groups look at; the raw field by default. */
|
|
106
|
+
value?: (row: T) => string | number;
|
|
107
|
+
/**
|
|
108
|
+
* A filter in the header: "text" (contains), "values" (pick from the column's values),
|
|
109
|
+
* "range" (numbers from–to). With `filterable` on the table every column gets one: values
|
|
110
|
+
* for short lists, range for numbers, text otherwise; `false` turns it off.
|
|
111
|
+
*/
|
|
112
|
+
filter?: "text" | "values" | "range" | false;
|
|
113
|
+
/** Rows can be grouped by this column; on by default. */
|
|
114
|
+
groupable?: boolean;
|
|
115
|
+
/** A summary of a group's rows shown in its header row (a count, a sum, an average…). */
|
|
116
|
+
aggregate?: (rows: T[]) => ReactNode;
|
|
117
|
+
}
|
|
118
|
+
export type DataTableSort = {
|
|
119
|
+
key: string;
|
|
120
|
+
direction: "asc" | "desc";
|
|
121
|
+
};
|
|
122
|
+
export type DataTablePagination = {
|
|
123
|
+
pageIndex: number;
|
|
124
|
+
pageSize: number;
|
|
125
|
+
};
|
|
126
|
+
export type DataTableColumnPinning = {
|
|
127
|
+
left?: string[];
|
|
128
|
+
right?: string[];
|
|
129
|
+
};
|
|
130
|
+
/** One column's filter: text it contains, values it is one of, or a number range. */
|
|
131
|
+
export type DataTableFilter = {
|
|
132
|
+
kind: "text";
|
|
133
|
+
text: string;
|
|
134
|
+
} | {
|
|
135
|
+
kind: "values";
|
|
136
|
+
values: string[];
|
|
137
|
+
} | {
|
|
138
|
+
kind: "range";
|
|
139
|
+
min?: number;
|
|
140
|
+
max?: number;
|
|
141
|
+
};
|
|
142
|
+
export interface DataTableProps<T extends DataTableRow = DataTableRow> extends CommonProps {
|
|
143
|
+
/** Column titles, or full column descriptions. */
|
|
144
|
+
columns?: Array<string | DataTableColumn<T>>;
|
|
145
|
+
rows?: T[];
|
|
146
|
+
caption?: ReactNode;
|
|
147
|
+
/** Stable id of a row, for selection; defaults to `row.id` or object identity. Provide this for freshly recreated rows without ids. */
|
|
148
|
+
rowKey?: (row: T, index: number) => string;
|
|
149
|
+
sort?: DataTableSort | null;
|
|
150
|
+
defaultSort?: DataTableSort | null;
|
|
151
|
+
onSortChange?: (sort: DataTableSort | null) => void;
|
|
152
|
+
/** Ordered sort priority. Shift-click adds/cycles one column; a normal click replaces the list. */
|
|
153
|
+
sorting?: DataTableSort[];
|
|
154
|
+
defaultSorting?: DataTableSort[];
|
|
155
|
+
onSortingChange?: (sorting: DataTableSort[]) => void;
|
|
156
|
+
/** Checkboxes to pick rows, with "select all" in the header. */
|
|
157
|
+
selectable?: boolean;
|
|
158
|
+
selected?: string[];
|
|
159
|
+
defaultSelected?: string[];
|
|
160
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
161
|
+
/** A search field over every column. */
|
|
162
|
+
searchable?: boolean;
|
|
163
|
+
query?: string;
|
|
164
|
+
defaultQuery?: string;
|
|
165
|
+
onQueryChange?: (query: string) => void;
|
|
166
|
+
/** Filters in every column header (see `DataTableColumn.filter`). */
|
|
167
|
+
filterable?: boolean;
|
|
168
|
+
filters?: Record<string, DataTableFilter>;
|
|
169
|
+
defaultFilters?: Record<string, DataTableFilter>;
|
|
170
|
+
onFiltersChange?: (filters: Record<string, DataTableFilter>) => void;
|
|
171
|
+
/** Group rows by a column; `groupable` adds a "group by" choice to the toolbar. */
|
|
172
|
+
groupable?: boolean;
|
|
173
|
+
groupBy?: string | null;
|
|
174
|
+
defaultGroupBy?: string | null;
|
|
175
|
+
onGroupByChange?: (key: string | null) => void;
|
|
176
|
+
/** Rows per page; everything on one page by default. */
|
|
177
|
+
pageSize?: number;
|
|
178
|
+
/** Page-size choices in the footer when pagination is enabled. */
|
|
179
|
+
pageSizeOptions?: number[];
|
|
180
|
+
/** Controlled, zero-based pagination; rows are sliced locally unless manualPagination is enabled. */
|
|
181
|
+
pagination?: DataTablePagination;
|
|
182
|
+
defaultPagination?: DataTablePagination;
|
|
183
|
+
onPaginationChange?: (pagination: DataTablePagination) => void;
|
|
184
|
+
/** Server-owned data operations: the table emits state changes but never fetches or transforms these rows. */
|
|
185
|
+
manualFiltering?: boolean;
|
|
186
|
+
manualSorting?: boolean;
|
|
187
|
+
manualPagination?: boolean;
|
|
188
|
+
/** Total matching server rows, not merely the current page length. */
|
|
189
|
+
rowCount?: number;
|
|
190
|
+
columnOrder?: string[];
|
|
191
|
+
defaultColumnOrder?: string[];
|
|
192
|
+
onColumnOrderChange?: (keys: string[]) => void;
|
|
193
|
+
columnPinning?: DataTableColumnPinning;
|
|
194
|
+
defaultColumnPinning?: DataTableColumnPinning;
|
|
195
|
+
onColumnPinningChange?: (pinning: DataTableColumnPinning) => void;
|
|
196
|
+
/** Allow readers to resize columns; on by default. */
|
|
197
|
+
resizableColumns?: boolean;
|
|
198
|
+
/** Scroll inside the table with a sticky header beyond this height. */
|
|
199
|
+
maxHeight?: string | number;
|
|
200
|
+
/** Render only the visible rows, group headings and expanded details. Uses a 480px viewport by default. */
|
|
201
|
+
virtualize?: boolean;
|
|
202
|
+
estimatedRowHeight?: number;
|
|
203
|
+
overscan?: number;
|
|
204
|
+
/** Detail content is mounted only while its stable row key is expanded and visible. */
|
|
205
|
+
renderRowDetails?: (row: T, index: number) => ReactNode;
|
|
206
|
+
expandedRows?: string[];
|
|
207
|
+
defaultExpandedRows?: string[];
|
|
208
|
+
onExpandedRowsChange?: (keys: string[]) => void;
|
|
209
|
+
renderRowActions?: (row: T, index: number) => ReactNode;
|
|
210
|
+
/** Width reserved for row actions, in pixels; defaults to 120. */
|
|
211
|
+
rowActionsWidth?: number;
|
|
212
|
+
rowNumbers?: boolean;
|
|
213
|
+
dense?: boolean;
|
|
214
|
+
densityToggle?: boolean;
|
|
215
|
+
onDenseChange?: (dense: boolean) => void;
|
|
216
|
+
striped?: boolean;
|
|
217
|
+
/** Placeholder rows while data loads. */
|
|
218
|
+
loading?: boolean;
|
|
219
|
+
/** Shown when there are no rows (or none match the search). */
|
|
220
|
+
empty?: ReactNode;
|
|
221
|
+
onRowClick?: (row: T, index: number) => void;
|
|
222
|
+
}
|
|
223
|
+
export interface CollapsibleSectionProps extends CommonProps {
|
|
224
|
+
title?: string;
|
|
225
|
+
/** Muted line under the title, e.g. what the section holds. */
|
|
226
|
+
description?: ReactNode;
|
|
227
|
+
icon?: string;
|
|
228
|
+
open?: boolean;
|
|
229
|
+
defaultOpen?: boolean;
|
|
230
|
+
onOpenChange?: (open: boolean) => void;
|
|
231
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type FormErrors<T> = Partial<Record<keyof T, string>> & Record<string, string | undefined>;
|
|
3
|
+
export interface FormApi<T extends Record<string, unknown>> {
|
|
4
|
+
values: T;
|
|
5
|
+
errors: FormErrors<T>;
|
|
6
|
+
touched: Record<string, boolean>;
|
|
7
|
+
submitting: boolean;
|
|
8
|
+
setValue: (path: string, value: unknown) => void;
|
|
9
|
+
setTouched: (path: string, touched?: boolean) => void;
|
|
10
|
+
reset: (values?: T) => void;
|
|
11
|
+
submit: () => Promise<boolean>;
|
|
12
|
+
field: (path: string) => {
|
|
13
|
+
value: unknown;
|
|
14
|
+
error?: string;
|
|
15
|
+
touched: boolean;
|
|
16
|
+
onValueChange: (value: unknown) => void;
|
|
17
|
+
onBlur: () => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface UseFormOptions<T extends Record<string, unknown>> {
|
|
21
|
+
initialValues: T;
|
|
22
|
+
validate?: (values: T) => FormErrors<T> | Promise<FormErrors<T>>;
|
|
23
|
+
onSubmit?: (values: T, form: FormApi<T>) => void | Promise<void>;
|
|
24
|
+
reinitialize?: boolean;
|
|
25
|
+
validateOnChange?: boolean;
|
|
26
|
+
validateOnBlur?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function useForm<T extends Record<string, unknown>>(options: UseFormOptions<T>): FormApi<T>;
|
|
29
|
+
export interface FormProps<T extends Record<string, unknown>> {
|
|
30
|
+
form: FormApi<T>;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function Form<T extends Record<string, unknown>>({ form, children, className, }: FormProps<T>): import("react").JSX.Element;
|
|
35
|
+
export declare function useFormContext<T extends Record<string, unknown>>(): FormApi<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Form is behavior-only; compose layout with Stack/Grid. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import { type GridResponsive } from "../../layout/Grid/Grid";
|
|
3
|
+
export type FieldKind = "text" | "number" | "textarea" | "select" | "autocomplete" | "checkbox" | "switch" | "color" | "date" | "file" | "people" | "slider" | "rotary" | "tags";
|
|
4
|
+
export interface FormFieldDefinition<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
5
|
+
name: string;
|
|
6
|
+
kind?: FieldKind;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
span?: GridResponsive<number | "full">;
|
|
9
|
+
showWhen?: (values: T) => boolean;
|
|
10
|
+
props?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export type FieldRegistry = Record<string, ComponentType<any>>;
|
|
13
|
+
export declare const defaultFieldRegistry: FieldRegistry;
|
|
14
|
+
export interface FormFieldsProps<T extends Record<string, unknown>> {
|
|
15
|
+
fields: readonly FormFieldDefinition<T>[];
|
|
16
|
+
registry?: FieldRegistry;
|
|
17
|
+
columns?: number;
|
|
18
|
+
gap?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function FormFields<T extends Record<string, unknown>>({ fields, registry, columns, gap, }: FormFieldsProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* FormFields composes existing field primitives. */
|
|
2
|
+
@supports (grid-template-rows: subgrid) {
|
|
3
|
+
/* Labels and messages size their own tracks, not the controls' center line. */
|
|
4
|
+
.ad-form-fields.ad-grid {
|
|
5
|
+
grid-auto-rows: auto auto auto minmax(var(--ad-grid-row-gap), auto);
|
|
6
|
+
row-gap: 0;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
margin-block-end: calc(var(--ad-grid-row-gap) * -1);
|
|
9
|
+
}
|
|
10
|
+
.ad-form-field {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-row-end: span 4;
|
|
13
|
+
grid-template-rows: subgrid;
|
|
14
|
+
}
|
|
15
|
+
.ad-form-field > * {
|
|
16
|
+
grid-row: 2;
|
|
17
|
+
align-self: center;
|
|
18
|
+
}
|
|
19
|
+
.ad-form-field > :has(> .ad-field) {
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-row: 1 / 5;
|
|
22
|
+
grid-template-rows: subgrid;
|
|
23
|
+
row-gap: 0;
|
|
24
|
+
align-self: stretch;
|
|
25
|
+
}
|
|
26
|
+
.ad-form-field > .ad-field,
|
|
27
|
+
.ad-form-field > :has(> .ad-field) > .ad-field {
|
|
28
|
+
grid-row: 1 / 4;
|
|
29
|
+
grid-template-rows: subgrid;
|
|
30
|
+
row-gap: 0;
|
|
31
|
+
align-self: stretch;
|
|
32
|
+
}
|
|
33
|
+
.ad-form-field .ad-field > * {
|
|
34
|
+
grid-row: 2;
|
|
35
|
+
align-self: center;
|
|
36
|
+
}
|
|
37
|
+
.ad-form-field .ad-field > .ad-field-label {
|
|
38
|
+
grid-row: 1;
|
|
39
|
+
align-self: end;
|
|
40
|
+
margin-block-end: calc(var(--ad-space-1) * 1.5);
|
|
41
|
+
}
|
|
42
|
+
.ad-form-field .ad-field > .ad-field-message {
|
|
43
|
+
grid-row: 3;
|
|
44
|
+
align-self: start;
|
|
45
|
+
margin-block-start: calc(var(--ad-space-1) * 1.5);
|
|
46
|
+
}
|
|
47
|
+
.ad-form-field > :has(> .ad-field) > :not(.ad-field) {
|
|
48
|
+
grid-row: 4;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/* Fields of a declarative form arrive in a quick cascade. */
|
|
52
|
+
form .ad-grid > .ad-grid-item {
|
|
53
|
+
animation: ad-fields-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
|
54
|
+
}
|
|
55
|
+
form .ad-grid > .ad-grid-item:nth-child(2) {
|
|
56
|
+
animation-delay: 0.06s;
|
|
57
|
+
}
|
|
58
|
+
form .ad-grid > .ad-grid-item:nth-child(3) {
|
|
59
|
+
animation-delay: 0.12s;
|
|
60
|
+
}
|
|
61
|
+
form .ad-grid > .ad-grid-item:nth-child(4) {
|
|
62
|
+
animation-delay: 0.18s;
|
|
63
|
+
}
|
|
64
|
+
form .ad-grid > .ad-grid-item:nth-child(n + 5) {
|
|
65
|
+
animation-delay: 0.24s;
|
|
66
|
+
}
|
|
67
|
+
@keyframes ad-fields-in {
|
|
68
|
+
from {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translateY(0.6rem);
|
|
71
|
+
}
|
|
72
|
+
}
|