@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,30 @@
|
|
|
1
|
+
import { type CommonProps } from "../../../core/base";
|
|
2
|
+
import { tr } from "../../../core/i18n";
|
|
3
|
+
export declare const loaderAnimations: readonly ["spin", "pulse", "breathe", "bounce", "flip", "orbit", "wave", "glow", "fill", "shine", "wobble", "radar", "palette"];
|
|
4
|
+
export type LoaderAnimation = (typeof loaderAnimations)[number];
|
|
5
|
+
/** Names of the animations for pickers, in the library's language. */
|
|
6
|
+
export declare const loaderAnimationLabel: (animation: LoaderAnimation, translate?: typeof tr) => string;
|
|
7
|
+
export interface LoaderProps extends Omit<CommonProps, "size"> {
|
|
8
|
+
/** The picture that moves: a logo, an icon, any image (transparent PNG/SVG/WebP look best). */
|
|
9
|
+
src?: string;
|
|
10
|
+
animation?: LoaderAnimation;
|
|
11
|
+
/** xs/sm/md/lg, a CSS length, or pixels converted to rem at the 16px design baseline. */
|
|
12
|
+
size?: number | string;
|
|
13
|
+
/** Speed multiplier: 2 is twice as fast. */
|
|
14
|
+
speed?: number;
|
|
15
|
+
/** Colour of rings, glows and the sweep; the theme colour by default. */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Extra colours used by multicolour animations. */
|
|
18
|
+
palette?: string[];
|
|
19
|
+
/** What screen readers hear. */
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The loader's stylesheet. It lives here (not in a .css file) so the generator can hand the
|
|
24
|
+
* exact same animation out as a standalone page. Only transform and opacity move.
|
|
25
|
+
*/
|
|
26
|
+
export declare const loaderCss = "\n.ad-loader{--ad-loader-size:4rem;--ad-loader-speed:1;--ad-loader-color:var(--ad-primary,#ff244c);position:relative;display:inline-grid;place-items:center;width:var(--ad-loader-size);height:var(--ad-loader-size);flex:none}\n.ad-loader>*{grid-area:1/1}\n.ad-loader-img{width:72%;height:72%;object-fit:contain;filter:drop-shadow(0 0 calc(var(--ad-loader-size)*.07) color-mix(in srgb,var(--ad-loader-color) 60%,transparent));user-select:none;pointer-events:none}\n.ad-loader:is([data-animation=spin],[data-animation=pulse],[data-animation=breathe],[data-animation=bounce],[data-animation=flip],[data-animation=orbit],[data-animation=wobble],[data-animation=palette]) .ad-loader-img,.ad-loader-fill>.ad-loader-img{will-change:transform,opacity}\n.ad-loader-default-image{display:block;background:linear-gradient(135deg,var(--ad-loader-color-2,var(--ad-secondary)),var(--ad-loader-color));-webkit-mask:var(--ad-loader-src) center/contain no-repeat;mask:var(--ad-loader-src) center/contain no-repeat}\n.ad-loader-ring{width:100%;height:100%;border-radius:50%;pointer-events:none}\n.ad-loader[data-animation=spin] .ad-loader-img{animation:ad-loader-spin calc(1.2s/var(--ad-loader-speed)) linear infinite}\n.ad-loader[data-animation=pulse] .ad-loader-img{animation:ad-loader-pulse calc(1s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=breathe] .ad-loader-img{animation:ad-loader-breathe calc(2.4s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=bounce] .ad-loader-img{width:60%;height:60%;animation:ad-loader-bounce calc(.9s/var(--ad-loader-speed)) cubic-bezier(.3,0,.6,1) infinite alternate}\n.ad-loader[data-animation=bounce] .ad-loader-ring{width:46%;height:10%;align-self:end;border-radius:50%;background:radial-gradient(closest-side,rgb(0 0 0/.45),transparent);animation:ad-loader-shadow calc(.9s/var(--ad-loader-speed)) cubic-bezier(.3,0,.6,1) infinite alternate}\n.ad-loader[data-animation=flip] .ad-loader-img{animation:ad-loader-flip calc(1.6s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=orbit] .ad-loader-img{width:34%;height:34%;animation:ad-loader-orbit calc(1.4s/var(--ad-loader-speed)) linear infinite}\n.ad-loader[data-animation=orbit] .ad-loader-ring{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--ad-loader-color) 35%,transparent)}\n.ad-loader[data-animation=wave] .ad-loader-img{width:54%;height:54%}\n.ad-loader[data-animation=wave] .ad-loader-ring{box-shadow:0 0 0 2px var(--ad-loader-color);opacity:0;animation:ad-loader-wave calc(1.8s/var(--ad-loader-speed)) ease-out infinite}\n.ad-loader[data-animation=wave] .ad-loader-ring+.ad-loader-ring{animation-delay:calc(-.9s/var(--ad-loader-speed))}\n.ad-loader[data-animation=glow] .ad-loader-ring{width:80%;height:80%;background:radial-gradient(closest-side,var(--ad-loader-color),transparent);opacity:.25;animation:ad-loader-glow calc(1.6s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=fill] .ad-loader-img{opacity:.22;filter:grayscale(1) drop-shadow(0 0 calc(var(--ad-loader-size)*.07) color-mix(in srgb,var(--ad-loader-color) 60%,transparent))}\n.ad-loader-fill{width:72%;height:72%;overflow:hidden;transform:translateY(100%);animation:ad-loader-fill calc(2s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader-fill>.ad-loader-img{width:100%;height:100%;object-fit:contain;transform:translateY(-100%);animation:ad-loader-fill-back calc(2s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=shine] .ad-loader-sweep{width:72%;height:72%;overflow:hidden;-webkit-mask:var(--ad-loader-src) center/contain no-repeat;mask:var(--ad-loader-src) center/contain no-repeat}\n.ad-loader-sweep>i{display:block;width:45%;height:100%;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--ad-loader-color) 65%,white),transparent);transform:translateX(-120%) skewX(-15deg);animation:ad-loader-shine calc(1.6s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=wobble] .ad-loader-img{transform-origin:50% 90%;animation:ad-loader-wobble calc(1.2s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=radar] .ad-loader-img{width:46%;height:46%}\n.ad-loader[data-animation=radar] .ad-loader-ring{background:conic-gradient(from 0deg,transparent 0 70%,color-mix(in srgb,var(--ad-loader-color) 70%,transparent));-webkit-mask:radial-gradient(closest-side,transparent 30%,#000 32%);mask:radial-gradient(closest-side,transparent 30%,#000 32%);animation:ad-loader-spin calc(1.4s/var(--ad-loader-speed)) linear infinite}\n.ad-loader[data-animation=palette] .ad-loader-img{animation:ad-loader-palette-image calc(2.8s/var(--ad-loader-speed)) ease-in-out infinite}\n.ad-loader[data-animation=palette] .ad-loader-ring{width:92%;height:92%;border-radius:44% 56% 52% 48%;background:conic-gradient(from 30deg,transparent,var(--ad-loader-color),var(--ad-loader-color-2),var(--ad-loader-color-3),transparent);filter:blur(calc(var(--ad-loader-size)*.055));opacity:.48;mix-blend-mode:screen;animation:ad-loader-spin calc(3.2s/var(--ad-loader-speed)) linear infinite}\n.ad-loader[data-animation=palette] .ad-loader-ring+.ad-loader-ring{width:72%;height:72%;animation-direction:reverse;animation-duration:calc(2.3s/var(--ad-loader-speed));opacity:.32}\n@keyframes ad-loader-spin{to{transform:rotate(1turn)}}\n@keyframes ad-loader-pulse{50%{transform:scale(.78);opacity:.55}}\n@keyframes ad-loader-breathe{50%{transform:scale(1.12)}}\n@keyframes ad-loader-bounce{from{transform:translateY(-28%)}to{transform:translateY(12%) scale(1.06,.94)}}\n@keyframes ad-loader-shadow{from{transform:scale(.55);opacity:.5}to{transform:scale(1);opacity:1}}\n@keyframes ad-loader-flip{0%{transform:perspective(20rem) rotateY(0)}50%{transform:perspective(20rem) rotateY(180deg)}100%{transform:perspective(20rem) rotateY(360deg)}}\n@keyframes ad-loader-orbit{from{transform:rotate(0) translateX(140%) rotate(0)}to{transform:rotate(1turn) translateX(140%) rotate(-1turn)}}\n@keyframes ad-loader-wave{from{transform:scale(.5);opacity:.9}to{transform:scale(1);opacity:0}}\n@keyframes ad-loader-glow{50%{transform:scale(1.2);opacity:.8}}\n@keyframes ad-loader-fill{0%{transform:translateY(100%)}70%,100%{transform:translateY(0)}}\n@keyframes ad-loader-fill-back{0%{transform:translateY(-100%)}70%,100%{transform:translateY(0)}}\n@keyframes ad-loader-shine{0%,30%{transform:translateX(-120%) skewX(-15deg)}100%{transform:translateX(260%) skewX(-15deg)}}\n@keyframes ad-loader-wobble{0%,100%{transform:rotate(-12deg)}50%{transform:rotate(12deg)}}\n@keyframes ad-loader-palette-image{0%,100%{transform:scale(.94);filter:drop-shadow(0 0 calc(var(--ad-loader-size)*.1) var(--ad-loader-color))}33%{filter:drop-shadow(0 0 calc(var(--ad-loader-size)*.13) var(--ad-loader-color-2))}66%{transform:scale(1.05);filter:drop-shadow(0 0 calc(var(--ad-loader-size)*.13) var(--ad-loader-color-3))}}\n";
|
|
27
|
+
/** A music note, used when no picture is given. */
|
|
28
|
+
export declare const loaderDefaultImage: string;
|
|
29
|
+
/** A loading spinner made of your own picture, with one of the supplied animations. */
|
|
30
|
+
export declare function Loader({ src, animation, size, speed, color, palette, label, style, ...p }: LoaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CommonProps } from "../../../core/base";
|
|
2
|
+
import { type LoaderAnimation } from "../Loader/Loader";
|
|
3
|
+
export interface LoaderSettings {
|
|
4
|
+
src: string;
|
|
5
|
+
animation: LoaderAnimation;
|
|
6
|
+
/** rem */
|
|
7
|
+
size: number;
|
|
8
|
+
speed: number;
|
|
9
|
+
color: string;
|
|
10
|
+
/** Colours extracted from the image for multicolour effects. */
|
|
11
|
+
palette?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface LoaderGeneratorProps extends CommonProps {
|
|
14
|
+
value?: LoaderSettings;
|
|
15
|
+
defaultValue?: Partial<LoaderSettings>;
|
|
16
|
+
onValueChange?: (settings: LoaderSettings) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const loaderGeneratorAnimations: ("flip" | "fill" | "wave" | "palette" | "pulse" | "spin" | "breathe" | "bounce" | "glow" | "shine" | "wobble")[];
|
|
19
|
+
export declare const loaderSizes: {
|
|
20
|
+
readonly xs: 4.5;
|
|
21
|
+
readonly sm: 6.5;
|
|
22
|
+
readonly md: 9;
|
|
23
|
+
readonly lg: 12;
|
|
24
|
+
};
|
|
25
|
+
export declare const loaderRenderKey: ({ animation }: Pick<LoaderSettings, "animation">) => "flip" | "fill" | "wave" | "palette" | "pulse" | "spin" | "breathe" | "bounce" | "orbit" | "glow" | "shine" | "wobble" | "radar";
|
|
26
|
+
/** Removes large, smoothly connected background regions while preserving enclosed logo details. */
|
|
27
|
+
export declare function removeBackgroundPixels(pixels: Uint8ClampedArray, width: number, height: number, signal?: AbortSignal): Promise<Uint8ClampedArray<ArrayBufferLike>>;
|
|
28
|
+
/** Finds a representative visible colour for rings, highlights and image glow. */
|
|
29
|
+
export declare function pickLoaderAccent(pixels: Uint8ClampedArray): string;
|
|
30
|
+
export declare function pickLoaderPalette(pixels: Uint8ClampedArray, signal?: AbortSignal): Promise<string[]>;
|
|
31
|
+
export declare const loaderCode: (settings: LoaderSettings) => string;
|
|
32
|
+
/** A standalone page with just the loader: its markup and the animation it uses. */
|
|
33
|
+
export declare function loaderHtml({ src, animation, size, speed, color, palette }: LoaderSettings): string;
|
|
34
|
+
/**
|
|
35
|
+
* Make a loader from your own picture: upload it, pick an animation from live
|
|
36
|
+
* previews, set size, speed and colour, then copy the code or download a ready page.
|
|
37
|
+
*/
|
|
38
|
+
export declare function LoaderGenerator({ value, defaultValue, onValueChange, ...p }: LoaderGeneratorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* Styles owned by LoaderGenerator (the loader's own animations live in Loader.tsx). */
|
|
2
|
+
.ad-loader-generator {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: var(--ad-space-4);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
}
|
|
7
|
+
.ad-loader-generator-top {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
.ad-loader-generator-stage {
|
|
11
|
+
place-items: center;
|
|
12
|
+
min-height: 14rem;
|
|
13
|
+
border: 0.0625rem solid rgb(from var(--ad-primary) r g b / 0.3);
|
|
14
|
+
border-radius: var(--ad-radius-lg);
|
|
15
|
+
background:
|
|
16
|
+
radial-gradient(circle at 50% 45%, rgb(from var(--ad-primary) r g b / 0.12), transparent 60%),
|
|
17
|
+
var(--ad-neutral-950);
|
|
18
|
+
}
|
|
19
|
+
.ad-loader-generator-controls {
|
|
20
|
+
align-content: start;
|
|
21
|
+
gap: var(--ad-space-3);
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
.ad-loader-generator-grid {
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
padding-block-end: var(--ad-space-1);
|
|
28
|
+
overflow-x: auto;
|
|
29
|
+
overscroll-behavior-inline: contain;
|
|
30
|
+
scrollbar-width: thin;
|
|
31
|
+
scrollbar-color: var(--ad-primary) transparent;
|
|
32
|
+
}
|
|
33
|
+
.ad-loader-generator-option.ad-button {
|
|
34
|
+
flex: 0 0 8.5rem;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
height: auto;
|
|
37
|
+
min-height: 6.5rem;
|
|
38
|
+
justify-items: center;
|
|
39
|
+
gap: var(--ad-space-2);
|
|
40
|
+
padding: var(--ad-space-2);
|
|
41
|
+
border: 0.0625rem solid rgb(from var(--ad-primary) r g b / 0.2);
|
|
42
|
+
border-radius: var(--ad-radius);
|
|
43
|
+
background: var(--ad-neutral-900);
|
|
44
|
+
color: var(--ad-muted);
|
|
45
|
+
font: inherit;
|
|
46
|
+
font-size: var(--ad-font-size-caption);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
transition: border-color var(--ad-duration-fast), background var(--ad-duration-fast);
|
|
49
|
+
}
|
|
50
|
+
.ad-loader-generator-option .ad-button-label {
|
|
51
|
+
display: flex;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
gap: var(--ad-space-2);
|
|
58
|
+
overflow: visible;
|
|
59
|
+
text-overflow: clip;
|
|
60
|
+
white-space: normal;
|
|
61
|
+
}
|
|
62
|
+
.ad-loader-generator-option > :is(.ad-button-fx, .ad-button-orbit) {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
.ad-loader-generator-option:hover {
|
|
66
|
+
border-color: rgb(from var(--ad-primary) r g b / 0.55);
|
|
67
|
+
}
|
|
68
|
+
.ad-loader-generator-option[aria-checked="true"] {
|
|
69
|
+
border-color: var(--ad-primary);
|
|
70
|
+
background: rgb(from var(--ad-primary) r g b / 0.14);
|
|
71
|
+
color: var(--ad-text);
|
|
72
|
+
box-shadow: 0 0 0.9rem rgb(from var(--ad-primary) r g b / 0.3);
|
|
73
|
+
}
|
|
74
|
+
.ad-loader-generator-slider {
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
.ad-loader-generator-toolbar {
|
|
78
|
+
width: 100%;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
padding-block-end: var(--ad-space-1);
|
|
81
|
+
overflow-x: auto;
|
|
82
|
+
overscroll-behavior-inline: contain;
|
|
83
|
+
scrollbar-width: thin;
|
|
84
|
+
scrollbar-color: var(--ad-primary) transparent;
|
|
85
|
+
}
|
|
86
|
+
.ad-loader-generator-toolbar > .ad-switch {
|
|
87
|
+
flex: 0 0 auto;
|
|
88
|
+
min-height: 2.25rem;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
.ad-loader-generator-color {
|
|
92
|
+
flex: 1 0 10rem;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
}
|
|
95
|
+
.ad-loader-generator-size {
|
|
96
|
+
flex: 0 0 14rem;
|
|
97
|
+
}
|
|
98
|
+
.ad-loader-generator-slider {
|
|
99
|
+
flex: 1 0 10rem;
|
|
100
|
+
}
|
|
101
|
+
.ad-loader-generator-size .ad-segmented-control,
|
|
102
|
+
.ad-loader-generator-size .ad-tabs {
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommonProps } from "../../../core/base";
|
|
2
|
+
import { type ThemeConfig } from "./themeConfig";
|
|
3
|
+
export interface ThemeEditorProps extends CommonProps {
|
|
4
|
+
value?: ThemeConfig;
|
|
5
|
+
defaultValue?: ThemeConfig;
|
|
6
|
+
onValueChange?: (config: ThemeConfig) => void;
|
|
7
|
+
/** File name for the exported theme. */
|
|
8
|
+
fileName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Editing a theme. Simple: a ready theme and two colours, everything else is calculated.
|
|
12
|
+
* Advanced: every token — palette, statuses, shape, type, motion — by hand, with search and
|
|
13
|
+
* per-token reset. Either way the theme exports to JSON and imports back.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ThemeEditor({ value: controlled, defaultValue, onValueChange, fileName, ...p }: ThemeEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* Styles owned by ThemeEditor: a toolbar, the simple or the advanced panel, a live sample. */
|
|
2
|
+
.ad-theme-editor {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: var(--ad-space-4);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
}
|
|
7
|
+
.ad-theme-editor-bar,
|
|
8
|
+
.ad-theme-editor-actions,
|
|
9
|
+
.ad-theme-editor-search {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--ad-space-2);
|
|
14
|
+
}
|
|
15
|
+
.ad-theme-editor-bar {
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
}
|
|
18
|
+
/* The import picker shows only its button here. */
|
|
19
|
+
.ad-theme-editor-actions > .ad-file-picker > small {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
.ad-theme-editor-paste {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: var(--ad-space-2);
|
|
25
|
+
width: min(24rem, calc(100vw - 2rem));
|
|
26
|
+
}
|
|
27
|
+
.ad-theme-editor-simple,
|
|
28
|
+
.ad-theme-editor-advanced {
|
|
29
|
+
display: grid;
|
|
30
|
+
gap: var(--ad-space-3);
|
|
31
|
+
}
|
|
32
|
+
.ad-theme-editor-colors {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
35
|
+
align-items: start;
|
|
36
|
+
gap: var(--ad-space-3);
|
|
37
|
+
}
|
|
38
|
+
/* The swap sits between the two fields, level with their boxes. */
|
|
39
|
+
.ad-theme-editor-swap.ad-icon-button {
|
|
40
|
+
margin-top: 1.55rem;
|
|
41
|
+
transition: rotate var(--ad-duration-slow) var(--ad-ease-spring);
|
|
42
|
+
}
|
|
43
|
+
.ad-theme-editor-swap.ad-icon-button:active {
|
|
44
|
+
rotate: 180deg;
|
|
45
|
+
}
|
|
46
|
+
@media (max-width: 30rem) {
|
|
47
|
+
.ad-theme-editor-colors {
|
|
48
|
+
grid-template-columns: minmax(0, 1fr);
|
|
49
|
+
}
|
|
50
|
+
.ad-theme-editor-swap.ad-icon-button {
|
|
51
|
+
justify-self: center;
|
|
52
|
+
margin-top: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.ad-theme-editor-strip {
|
|
56
|
+
display: flex;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
height: 1.75rem;
|
|
59
|
+
border-radius: var(--ad-radius-pill);
|
|
60
|
+
box-shadow: inset 0 0 0 0.0625rem #fff2;
|
|
61
|
+
}
|
|
62
|
+
.ad-theme-editor-strip > i {
|
|
63
|
+
flex: 1;
|
|
64
|
+
}
|
|
65
|
+
.ad-theme-editor-search > .ad-field {
|
|
66
|
+
flex: 1 1 14rem;
|
|
67
|
+
}
|
|
68
|
+
.ad-theme-editor-tokens {
|
|
69
|
+
display: grid;
|
|
70
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
|
|
71
|
+
gap: var(--ad-space-3);
|
|
72
|
+
}
|
|
73
|
+
.ad-theme-editor-token {
|
|
74
|
+
position: relative;
|
|
75
|
+
display: grid;
|
|
76
|
+
gap: 0.15rem;
|
|
77
|
+
padding: var(--ad-space-2);
|
|
78
|
+
border-radius: var(--ad-radius);
|
|
79
|
+
transition: background var(--ad-duration-fast);
|
|
80
|
+
}
|
|
81
|
+
.ad-theme-editor-token[data-changed] {
|
|
82
|
+
background: rgb(from var(--ad-primary) r g b / 0.1);
|
|
83
|
+
box-shadow: inset 0 0 0 0.0625rem rgb(from var(--ad-primary) r g b / 0.35);
|
|
84
|
+
}
|
|
85
|
+
.ad-theme-editor-token > code {
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
color: var(--ad-muted);
|
|
88
|
+
font-family: var(--ad-font-family-mono);
|
|
89
|
+
font-size: var(--ad-font-size-caption);
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
.ad-theme-editor-token > .ad-icon-button {
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: var(--ad-space-1);
|
|
96
|
+
right: var(--ad-space-1);
|
|
97
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Locale } from "../../../core/i18n";
|
|
2
|
+
import { type ThemeName } from "../ThemeProvider/ThemeProvider";
|
|
3
|
+
/**
|
|
4
|
+
* A whole theme as data, ready to save, share and load back. "simple": two colours, the rest is
|
|
5
|
+
* calculated. "advanced": the same plus any token set by hand.
|
|
6
|
+
*/
|
|
7
|
+
export interface ThemeConfig {
|
|
8
|
+
version: 1;
|
|
9
|
+
mode: "simple" | "advanced";
|
|
10
|
+
/** The built-in theme it starts from. */
|
|
11
|
+
theme: ThemeName;
|
|
12
|
+
primary?: string;
|
|
13
|
+
/** Without it (or with `autoSecondary`) the secondary colour is calculated from the primary. */
|
|
14
|
+
secondary?: string;
|
|
15
|
+
autoSecondary?: boolean;
|
|
16
|
+
/** Token overrides by name without the `--ad-` prefix, e.g. `{ "radius": "0.5rem" }`; advanced mode only. */
|
|
17
|
+
tokens?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export type ThemeTokenKind = "color" | "length" | "font" | "number" | "time" | "easing";
|
|
20
|
+
export interface ThemeTokenGroup {
|
|
21
|
+
title: string;
|
|
22
|
+
tokens: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
label: string;
|
|
25
|
+
kind: ThemeTokenKind;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/** Every token the advanced mode can change, in groups. */
|
|
29
|
+
export declare const themeTokenGroups: ThemeTokenGroup[];
|
|
30
|
+
/** A light companion for a primary colour: brighter, a little warmer — for highlights and glints. */
|
|
31
|
+
export declare function deriveSecondary(primary: string): string;
|
|
32
|
+
export declare const defaultThemeConfig: ThemeConfig;
|
|
33
|
+
/** What to hand to ThemeProvider for a config: `<ThemeProvider {...themeProps(config)}>`. */
|
|
34
|
+
export declare function themeProps(config: ThemeConfig): {
|
|
35
|
+
theme: "ruby" | "green" | "violet" | "light";
|
|
36
|
+
primary: string;
|
|
37
|
+
secondary: string;
|
|
38
|
+
tokens: {
|
|
39
|
+
[x: string]: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/** The config as a JSON file's text, stamped so it can be recognised on import. */
|
|
43
|
+
export declare function exportTheme(config: ThemeConfig): string;
|
|
44
|
+
/** Reads a theme back from JSON; throws an Error with a readable message when it is not one. */
|
|
45
|
+
export declare function parseTheme(text: string, locale?: Locale): ThemeConfig;
|
|
46
|
+
/** Current value of a token inside `scope`: colours as #rrggbb, everything else as written. */
|
|
47
|
+
export declare function resolveToken(scope: Element, name: string, kind?: ThemeTokenKind): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CommonProps } from "../../../core/base";
|
|
2
|
+
/** Ready colour pairs: [primary, secondary]. Everything else is derived from the pair. */
|
|
3
|
+
export declare const themes: {
|
|
4
|
+
readonly ruby: readonly ["#ff244c", "#ff7c97"];
|
|
5
|
+
readonly light: readonly ["#e0a43a", "#f3d38f"];
|
|
6
|
+
readonly green: readonly ["#10c99a", "#7cf3d0"];
|
|
7
|
+
readonly violet: readonly ["#9b5cff", "#d3a8ff"];
|
|
8
|
+
};
|
|
9
|
+
export type ThemeName = keyof typeof themes;
|
|
10
|
+
export interface ThemeProviderProps extends CommonProps {
|
|
11
|
+
theme?: ThemeName;
|
|
12
|
+
/** Colour scheme; nested providers inherit it unless they explicitly override it. */
|
|
13
|
+
colorScheme?: "light" | "dark";
|
|
14
|
+
/** Main colour; overrides the theme's. The whole palette is built from it and `secondary`. */
|
|
15
|
+
primary?: string;
|
|
16
|
+
/** Light accent colour for highlights and glints; overrides the theme's. */
|
|
17
|
+
secondary?: string;
|
|
18
|
+
/** Older name for `primary`. */
|
|
19
|
+
accent?: string;
|
|
20
|
+
/** Any token by name (`primary-700`, `neutral-900`, `--ad-text`…), for full control. */
|
|
21
|
+
tokens?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
export declare const useThemePalette: () => {
|
|
24
|
+
theme: ThemeName;
|
|
25
|
+
primary: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Applies a theme: the primary/secondary pair sets the palette, painted artwork (canvas and
|
|
30
|
+
* vector illustrations, drawn in ruby) is turned to the primary's hue.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ThemeProvider: ({ theme, colorScheme, primary, secondary, accent, tokens, style, children, id, className, ...attributes }: ThemeProviderProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* Styles owned by ThemeProvider: switching theme morphs the accent colours instead of snapping. */
|
|
2
|
+
@property --ad-red {
|
|
3
|
+
syntax: "<color>";
|
|
4
|
+
inherits: true;
|
|
5
|
+
initial-value: #ff244c;
|
|
6
|
+
}
|
|
7
|
+
@property --ad-pink {
|
|
8
|
+
syntax: "<color>";
|
|
9
|
+
inherits: true;
|
|
10
|
+
initial-value: #ff7c97;
|
|
11
|
+
}
|
|
12
|
+
@property --ad-focus {
|
|
13
|
+
syntax: "<color>";
|
|
14
|
+
inherits: true;
|
|
15
|
+
initial-value: #ffdce4;
|
|
16
|
+
}
|
|
17
|
+
@property --ad-text {
|
|
18
|
+
syntax: "<color>";
|
|
19
|
+
inherits: true;
|
|
20
|
+
initial-value: #f7f5f8;
|
|
21
|
+
}
|
|
22
|
+
@property --ad-muted {
|
|
23
|
+
syntax: "<color>";
|
|
24
|
+
inherits: true;
|
|
25
|
+
initial-value: #bfc0d9;
|
|
26
|
+
}
|
|
27
|
+
.ad-theme {
|
|
28
|
+
--ad-primary: inherit;
|
|
29
|
+
--ad-secondary: inherit;
|
|
30
|
+
transition:
|
|
31
|
+
--ad-red 0.7s ease,
|
|
32
|
+
--ad-pink 0.7s ease,
|
|
33
|
+
--ad-focus 0.7s ease,
|
|
34
|
+
--ad-text 0.7s ease,
|
|
35
|
+
--ad-muted 0.7s ease;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* A nested provider keeps the active scheme while still recomputing its palette from its own accent. */
|
|
39
|
+
.ad-theme[data-ad-color-scheme="light"] {
|
|
40
|
+
color-scheme: light;
|
|
41
|
+
--ad-neutral-950: oklch(from var(--ad-primary) 0.98 0.006 h);
|
|
42
|
+
--ad-neutral-900: oklch(from var(--ad-primary) 0.965 0.008 h);
|
|
43
|
+
--ad-neutral-850: oklch(from var(--ad-primary) 0.94 0.01 h);
|
|
44
|
+
--ad-neutral-800: oklch(from var(--ad-primary) 0.9 0.012 h);
|
|
45
|
+
--ad-neutral-700: oklch(from var(--ad-primary) 0.82 0.014 h);
|
|
46
|
+
--ad-neutral-600: oklch(from var(--ad-primary) 0.7 0.016 h);
|
|
47
|
+
--ad-neutral-500: oklch(from var(--ad-primary) 0.58 0.018 h);
|
|
48
|
+
--ad-neutral-400: oklch(from var(--ad-primary) 0.46 0.02 h);
|
|
49
|
+
--ad-neutral-300: oklch(from var(--ad-primary) 0.34 0.018 h);
|
|
50
|
+
--ad-neutral-200: oklch(from var(--ad-primary) 0.22 0.014 h);
|
|
51
|
+
--ad-text: #211b1f;
|
|
52
|
+
--ad-muted: #6f6269;
|
|
53
|
+
--ad-surface-input:
|
|
54
|
+
linear-gradient(135deg, var(--ad-neutral-950), var(--ad-neutral-900)) padding-box,
|
|
55
|
+
linear-gradient(125deg, var(--ad-primary), var(--ad-secondary) 50%, var(--ad-primary)) border-box;
|
|
56
|
+
--ad-shadow-input:
|
|
57
|
+
inset 0 0.0625rem 0.125rem rgb(from var(--ad-text) r g b / 0.08),
|
|
58
|
+
0 0.1875rem 0.4375rem rgb(from var(--ad-primary) r g b / 0.12);
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSSProperties, ElementType, ReactNode } from "react";
|
|
2
|
+
import { type CommonProps } from "../../../core/base";
|
|
3
|
+
export type TypographyVariant = "display" | "h1" | "h2" | "h3" | "title" | "subtitle" | "body" | "body-sm" | "label" | "caption" | "eyebrow" | "mono";
|
|
4
|
+
export type TypographyTone = "default" | "muted" | "accent" | "success" | "warning" | "danger";
|
|
5
|
+
export type TypographyWeight = "regular" | "medium" | "semibold" | "bold";
|
|
6
|
+
export interface TypographyProps extends Omit<CommonProps, "tone"> {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
variant?: TypographyVariant;
|
|
9
|
+
tone?: TypographyTone;
|
|
10
|
+
weight?: TypographyWeight;
|
|
11
|
+
align?: CSSProperties["textAlign"];
|
|
12
|
+
truncate?: boolean;
|
|
13
|
+
text?: ReactNode;
|
|
14
|
+
/** Hover text; a truncated plain string shows itself in full by default. */
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Typography({ as, variant, tone, weight, align, truncate, text, title, children, style, ...props }: TypographyProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* Typography owns the complete Neo UI type scale. */
|
|
2
|
+
.ad-typography {
|
|
3
|
+
margin: 0;
|
|
4
|
+
color: var(--ad-text);
|
|
5
|
+
font-family: var(--ad-font-family-sans);
|
|
6
|
+
font-size: var(--ad-font-size-body);
|
|
7
|
+
font-weight: var(--ad-font-weight-regular);
|
|
8
|
+
line-height: var(--ad-line-height-body);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ad-typography[data-ad-variant="display"] {
|
|
12
|
+
font-size: var(--ad-font-size-display);
|
|
13
|
+
font-weight: var(--ad-font-weight-bold);
|
|
14
|
+
line-height: var(--ad-line-height-display);
|
|
15
|
+
letter-spacing: var(--ad-letter-spacing-display);
|
|
16
|
+
}
|
|
17
|
+
.ad-typography[data-ad-variant="h1"] {
|
|
18
|
+
font-size: var(--ad-font-size-h1);
|
|
19
|
+
font-weight: var(--ad-font-weight-bold);
|
|
20
|
+
line-height: var(--ad-line-height-heading);
|
|
21
|
+
letter-spacing: var(--ad-letter-spacing-heading);
|
|
22
|
+
}
|
|
23
|
+
.ad-typography[data-ad-variant="h2"] {
|
|
24
|
+
font-size: var(--ad-font-size-h2);
|
|
25
|
+
font-weight: var(--ad-font-weight-semibold);
|
|
26
|
+
line-height: var(--ad-line-height-heading);
|
|
27
|
+
letter-spacing: var(--ad-letter-spacing-heading);
|
|
28
|
+
}
|
|
29
|
+
.ad-typography[data-ad-variant="h3"] {
|
|
30
|
+
font-size: var(--ad-font-size-h3);
|
|
31
|
+
font-weight: var(--ad-font-weight-semibold);
|
|
32
|
+
line-height: var(--ad-line-height-title);
|
|
33
|
+
letter-spacing: var(--ad-letter-spacing-title);
|
|
34
|
+
}
|
|
35
|
+
.ad-typography[data-ad-variant="title"] {
|
|
36
|
+
font-size: var(--ad-font-size-title);
|
|
37
|
+
font-weight: var(--ad-font-weight-semibold);
|
|
38
|
+
line-height: var(--ad-line-height-title);
|
|
39
|
+
letter-spacing: var(--ad-letter-spacing-title);
|
|
40
|
+
}
|
|
41
|
+
.ad-typography[data-ad-variant="subtitle"] {
|
|
42
|
+
font-size: var(--ad-font-size-subtitle);
|
|
43
|
+
font-weight: var(--ad-font-weight-medium);
|
|
44
|
+
line-height: var(--ad-line-height-body);
|
|
45
|
+
}
|
|
46
|
+
.ad-typography[data-ad-variant="body"] {
|
|
47
|
+
font-size: var(--ad-font-size-body);
|
|
48
|
+
line-height: var(--ad-line-height-body);
|
|
49
|
+
}
|
|
50
|
+
.ad-typography[data-ad-variant="body-sm"] {
|
|
51
|
+
font-size: var(--ad-font-size-body-sm);
|
|
52
|
+
line-height: var(--ad-line-height-body);
|
|
53
|
+
}
|
|
54
|
+
.ad-typography[data-ad-variant="label"] {
|
|
55
|
+
font-size: var(--ad-font-size-label);
|
|
56
|
+
font-weight: var(--ad-font-weight-semibold);
|
|
57
|
+
line-height: var(--ad-line-height-compact);
|
|
58
|
+
letter-spacing: var(--ad-letter-spacing-label);
|
|
59
|
+
}
|
|
60
|
+
.ad-typography[data-ad-variant="caption"] {
|
|
61
|
+
font-size: var(--ad-font-size-caption);
|
|
62
|
+
line-height: var(--ad-line-height-compact);
|
|
63
|
+
}
|
|
64
|
+
.ad-typography[data-ad-variant="eyebrow"] {
|
|
65
|
+
font-size: var(--ad-font-size-caption);
|
|
66
|
+
font-weight: var(--ad-font-weight-bold);
|
|
67
|
+
line-height: var(--ad-line-height-compact);
|
|
68
|
+
letter-spacing: var(--ad-letter-spacing-eyebrow);
|
|
69
|
+
text-transform: uppercase;
|
|
70
|
+
}
|
|
71
|
+
.ad-typography[data-ad-variant="mono"] {
|
|
72
|
+
font-family: var(--ad-font-family-mono);
|
|
73
|
+
font-size: var(--ad-font-size-body-sm);
|
|
74
|
+
line-height: var(--ad-line-height-body);
|
|
75
|
+
font-variant-numeric: tabular-nums;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ad-typography[data-ad-tone="muted"] {
|
|
79
|
+
color: var(--ad-muted);
|
|
80
|
+
}
|
|
81
|
+
.ad-typography[data-ad-tone="accent"] {
|
|
82
|
+
color: var(--ad-pink);
|
|
83
|
+
text-shadow: 0 0 0.875rem rgb(from var(--ad-primary) r g b / 0.3);
|
|
84
|
+
}
|
|
85
|
+
.ad-typography[data-ad-tone="success"] {
|
|
86
|
+
color: var(--ad-success);
|
|
87
|
+
}
|
|
88
|
+
.ad-typography[data-ad-tone="warning"] {
|
|
89
|
+
color: var(--ad-warning);
|
|
90
|
+
}
|
|
91
|
+
.ad-typography[data-ad-tone="danger"] {
|
|
92
|
+
color: var(--ad-secondary);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ad-typography[data-ad-weight="regular"] {
|
|
96
|
+
font-weight: var(--ad-font-weight-regular);
|
|
97
|
+
}
|
|
98
|
+
.ad-typography[data-ad-weight="medium"] {
|
|
99
|
+
font-weight: var(--ad-font-weight-medium);
|
|
100
|
+
}
|
|
101
|
+
.ad-typography[data-ad-weight="semibold"] {
|
|
102
|
+
font-weight: var(--ad-font-weight-semibold);
|
|
103
|
+
}
|
|
104
|
+
.ad-typography[data-ad-weight="bold"] {
|
|
105
|
+
font-weight: var(--ad-font-weight-bold);
|
|
106
|
+
}
|
|
107
|
+
.ad-typography[data-ad-truncate="true"] {
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
}
|
|
112
|
+
/* Titles take the heading font (the text font unless a theme sets a display face). */
|
|
113
|
+
.ad-typography:is([data-ad-variant="display"], [data-ad-variant="h1"], [data-ad-variant="h2"], [data-ad-variant="h3"]) {
|
|
114
|
+
font-family: var(--ad-font-family-heading);
|
|
115
|
+
}
|