@scalewing/react 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +13 -2
- package/dist/components/Accordion.d.ts +8 -0
- package/dist/components/Accordion.js +14 -0
- package/dist/components/AppHeader.d.ts +5 -0
- package/dist/components/AppHeader.js +7 -0
- package/dist/components/Badge.d.ts +13 -0
- package/dist/components/Badge.js +7 -0
- package/dist/components/BarChart.d.ts +16 -0
- package/dist/components/BarChart.js +13 -0
- package/dist/components/Box.d.ts +1 -1
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Dialog.d.ts +8 -0
- package/dist/components/Dialog.js +36 -0
- package/dist/components/Field.d.ts +4 -1
- package/dist/components/Field.js +2 -2
- package/dist/components/Nav.d.ts +3 -0
- package/dist/components/Nav.js +7 -0
- package/dist/components/SegmentedControl.d.ts +19 -0
- package/dist/components/SegmentedControl.js +28 -0
- package/dist/components/Select.d.ts +17 -0
- package/dist/components/Select.js +107 -0
- package/dist/components/Split.d.ts +8 -0
- package/dist/components/Split.js +117 -0
- package/dist/components/Table.d.ts +32 -0
- package/dist/components/Table.js +24 -0
- package/dist/components/Text.d.ts +3 -3
- package/dist/components/Text.js +2 -1
- package/dist/components/Toast.d.ts +10 -0
- package/dist/components/Toast.js +61 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +11 -0
- package/dist/palette/amber.css +21 -0
- package/dist/palette/capri.css +21 -0
- package/dist/palette/cerulean.css +21 -0
- package/dist/palette/cornflower.css +21 -0
- package/dist/palette/fuchsia.css +21 -0
- package/dist/palette/harvest.css +31 -0
- package/dist/palette/ink.css +21 -0
- package/dist/palette/mocha.css +31 -0
- package/dist/palette/navy.css +21 -0
- package/dist/palette/postcard.css +31 -0
- package/dist/palette/raspberry.css +21 -0
- package/dist/palette/sky.css +21 -0
- package/dist/palette/soft-blue.css +21 -0
- package/dist/palette/sunburst.css +31 -0
- package/dist/palette/synthwave.css +26 -0
- package/dist/palette/tangerine.css +21 -0
- package/dist/select-list.d.ts +7 -0
- package/dist/select-list.js +24 -0
- package/dist/split-size.d.ts +18 -0
- package/dist/split-size.js +94 -0
- package/dist/styles.css +1084 -12
- package/dist/theme/ThemeProvider.d.ts +4 -3
- package/dist/theme/ThemeProvider.js +8 -3
- package/dist/toast-travel.d.ts +16 -0
- package/dist/toast-travel.js +42 -0
- package/package.json +10 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, } from 'react';
|
|
3
|
+
import { cx } from '../class-names.js';
|
|
4
|
+
export const Table = forwardRef(function Table({ children, className, density = 'comfortable', stickyHeader = true, ...rest }, ref) {
|
|
5
|
+
return (_jsx("div", { className: "sw-table-wrap", children: _jsx("table", { ref: ref, className: cx('sw-table', density === 'compact' && 'sw-table-compact', stickyHeader && 'sw-table-sticky', className), ...rest, children: children }) }));
|
|
6
|
+
});
|
|
7
|
+
export const TableHeader = forwardRef(function TableHeader({ className, ...rest }, ref) {
|
|
8
|
+
return _jsx("thead", { ref: ref, className: className, ...rest });
|
|
9
|
+
});
|
|
10
|
+
export const TableBody = forwardRef(function TableBody({ className, ...rest }, ref) {
|
|
11
|
+
return _jsx("tbody", { ref: ref, className: className, ...rest });
|
|
12
|
+
});
|
|
13
|
+
export const TableRow = forwardRef(function TableRow({ className, selected = false, ...rest }, ref) {
|
|
14
|
+
return (_jsx("tr", { ref: ref, "aria-selected": selected || undefined, className: cx(selected && 'sw-table-row-selected', className), ...rest }));
|
|
15
|
+
});
|
|
16
|
+
export const TableCell = forwardRef(function TableCell({ align = 'start', as = 'td', className, numeric = false, truncate = false, ...rest }, ref) {
|
|
17
|
+
const Component = as;
|
|
18
|
+
const alignmentClass = numeric
|
|
19
|
+
? 'sw-table-numeric'
|
|
20
|
+
: align === 'end'
|
|
21
|
+
? 'sw-table-end'
|
|
22
|
+
: undefined;
|
|
23
|
+
return (_jsx(Component, { ref: ref, className: cx(alignmentClass, truncate && 'sw-table-clip', className), ...rest }));
|
|
24
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type SemanticColorKey, type TypographyVariant } from '@scalewing/tokens';
|
|
2
|
-
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type HTMLAttributes, type LabelHTMLAttributes } from 'react';
|
|
3
3
|
export type TextElement = 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'label' | 'strong';
|
|
4
|
-
export type TextProps = HTMLAttributes<HTMLElement> & {
|
|
4
|
+
export type TextProps = HTMLAttributes<HTMLElement> & Pick<LabelHTMLAttributes<HTMLLabelElement>, 'htmlFor'> & {
|
|
5
5
|
as?: TextElement;
|
|
6
6
|
color?: SemanticColorKey;
|
|
7
7
|
truncate?: boolean;
|
|
8
8
|
variant?: TypographyVariant;
|
|
9
9
|
};
|
|
10
|
-
export declare const Text: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
10
|
+
export declare const Text: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & Pick<LabelHTMLAttributes<HTMLLabelElement>, "htmlFor"> & {
|
|
11
11
|
as?: TextElement;
|
|
12
12
|
color?: SemanticColorKey;
|
|
13
13
|
truncate?: boolean;
|
package/dist/components/Text.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, } from 'react';
|
|
3
3
|
import { cx } from '../class-names.js';
|
|
4
4
|
const defaultElement = {
|
|
5
5
|
body: 'p',
|
|
6
6
|
caption: 'span',
|
|
7
|
+
data: 'span',
|
|
7
8
|
display: 'h1',
|
|
8
9
|
heading: 'h2',
|
|
9
10
|
label: 'span',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type ToastProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'popover'> & {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
anchor?: Element | null;
|
|
7
|
+
target?: Element | null;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function Toast({ anchor, children, className, onOpenChange, open, target, timeoutMs, ...rest }: ToastProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useEffect, useRef, } from 'react';
|
|
4
|
+
import { cx } from '../class-names.js';
|
|
5
|
+
import { spacingClassNames } from '../spacing-classes.js';
|
|
6
|
+
import { applyTravelVars, clearTravelVars, travelTranslate, } from '../toast-travel.js';
|
|
7
|
+
const DEFAULT_TIMEOUT_MS = 800;
|
|
8
|
+
function travels(anchor, target) {
|
|
9
|
+
return Boolean(anchor && target);
|
|
10
|
+
}
|
|
11
|
+
export function Toast({ anchor = null, children, className, onOpenChange, open, target = null, timeoutMs = DEFAULT_TIMEOUT_MS, ...rest }) {
|
|
12
|
+
const nodeRef = useRef(null);
|
|
13
|
+
const moving = travels(anchor, target);
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
const node = nodeRef.current;
|
|
16
|
+
if (!node || typeof node.showPopover !== 'function') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!open) {
|
|
20
|
+
if (node.matches(':popover-open')) {
|
|
21
|
+
node.hidePopover();
|
|
22
|
+
}
|
|
23
|
+
clearTravelVars(node);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (moving && anchor && target) {
|
|
27
|
+
if (!node.matches(':popover-open')) {
|
|
28
|
+
node.showPopover();
|
|
29
|
+
}
|
|
30
|
+
applyTravelVars(node, travelTranslate(anchor.getBoundingClientRect(), target.getBoundingClientRect(), node.getBoundingClientRect()));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
clearTravelVars(node);
|
|
34
|
+
if (!node.matches(':popover-open')) {
|
|
35
|
+
node.showPopover();
|
|
36
|
+
}
|
|
37
|
+
}, [anchor, moving, open, target]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!open) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const reducedMotion = typeof window.matchMedia === 'function' &&
|
|
43
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
44
|
+
if (moving && !reducedMotion) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const timer = window.setTimeout(() => {
|
|
48
|
+
onOpenChange(false);
|
|
49
|
+
}, timeoutMs);
|
|
50
|
+
return () => {
|
|
51
|
+
window.clearTimeout(timer);
|
|
52
|
+
};
|
|
53
|
+
}, [moving, open, onOpenChange, timeoutMs]);
|
|
54
|
+
function onAnimationEnd(event) {
|
|
55
|
+
if (event.target !== event.currentTarget || !moving) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
onOpenChange(false);
|
|
59
|
+
}
|
|
60
|
+
return (_jsx("div", { ...rest, ref: nodeRef, className: cx('sw-toast', moving && 'sw-toast-travel', ...spacingClassNames({ padding: 3 }), className), onAnimationEnd: onAnimationEnd, popover: "manual", role: "status", children: children }));
|
|
61
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
+
export { Accordion } from './components/Accordion.js';
|
|
2
|
+
export type { AccordionProps } from './components/Accordion.js';
|
|
3
|
+
export { AppHeader, type AppHeaderProps } from './components/AppHeader.js';
|
|
4
|
+
export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, } from './components/Badge.js';
|
|
5
|
+
export { BarChart, type BarChartItem, type BarChartProps, } from './components/BarChart.js';
|
|
1
6
|
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, } from './components/Button.js';
|
|
2
7
|
export { Box, type BoxElement, type BoxProps } from './components/Box.js';
|
|
3
8
|
export { Card, type CardProps, type CardVariant } from './components/Card.js';
|
|
4
|
-
export {
|
|
9
|
+
export { Dialog } from './components/Dialog.js';
|
|
10
|
+
export type { DialogProps } from './components/Dialog.js';
|
|
11
|
+
export { Toast } from './components/Toast.js';
|
|
12
|
+
export type { ToastProps } from './components/Toast.js';
|
|
13
|
+
export { Field, type FieldProps, type FieldSize } from './components/Field.js';
|
|
5
14
|
export { Inline, type InlineProps } from './components/Inline.js';
|
|
15
|
+
export { Split } from './components/Split.js';
|
|
16
|
+
export type { SplitProps } from './components/Split.js';
|
|
17
|
+
export { Nav, type NavProps } from './components/Nav.js';
|
|
18
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
19
|
+
export { Select } from './components/Select.js';
|
|
20
|
+
export type { SelectAction, SelectOption, SelectProps, } from './components/Select.js';
|
|
6
21
|
export { Stack, type Align, type Justify, type StackProps, } from './components/Stack.js';
|
|
22
|
+
export { Table, TableBody, TableCell, TableHeader, TableRow, type TableBodyProps, type TableCellProps, type TableDensity, type TableHeaderProps, type TableProps, type TableRowProps, } from './components/Table.js';
|
|
7
23
|
export { Text, type TextElement, type TextProps } from './components/Text.js';
|
|
8
24
|
export { ThemeProvider, useTheme, type ThemeProviderProps, } from './theme/ThemeProvider.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
export { Accordion } from './components/Accordion.js';
|
|
2
|
+
export { AppHeader } from './components/AppHeader.js';
|
|
3
|
+
export { Badge, } from './components/Badge.js';
|
|
4
|
+
export { BarChart, } from './components/BarChart.js';
|
|
1
5
|
export { Button, } from './components/Button.js';
|
|
2
6
|
export { Box } from './components/Box.js';
|
|
3
7
|
export { Card } from './components/Card.js';
|
|
8
|
+
export { Dialog } from './components/Dialog.js';
|
|
9
|
+
export { Toast } from './components/Toast.js';
|
|
4
10
|
export { Field } from './components/Field.js';
|
|
5
11
|
export { Inline } from './components/Inline.js';
|
|
12
|
+
export { Split } from './components/Split.js';
|
|
13
|
+
export { Nav } from './components/Nav.js';
|
|
14
|
+
export { SegmentedControl, } from './components/SegmentedControl.js';
|
|
15
|
+
export { Select } from './components/Select.js';
|
|
6
16
|
export { Stack, } from './components/Stack.js';
|
|
17
|
+
export { Table, TableBody, TableCell, TableHeader, TableRow, } from './components/Table.js';
|
|
7
18
|
export { Text } from './components/Text.js';
|
|
8
19
|
export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #B45309;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #FCD34D;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(68, 61, 38, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(254, 237, 184, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(254, 246, 219, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #0077B6;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #48CAE4;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(36, 59, 66, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(182, 234, 244, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(218, 244, 250, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #0066CC;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #5AC8FA;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(39, 59, 70, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(189, 233, 253, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(222, 244, 254, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #4F6BED;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #93A4FF;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(49, 52, 71, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(212, 219, 255, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(233, 237, 255, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #C026D3;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #E879F9;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(65, 45, 69, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(246, 201, 253, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(250, 228, 254, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-background: #E3DCC8;
|
|
5
|
+
--sw-color-surface: #EBE6D6;
|
|
6
|
+
--sw-color-text: #1D1D1F;
|
|
7
|
+
--sw-color-muted: #5C5346;
|
|
8
|
+
--sw-color-accent: #3E3E24;
|
|
9
|
+
--sw-color-onAccent: #FFFFFF;
|
|
10
|
+
--sw-color-border: #C9C2AE;
|
|
11
|
+
--sw-glass-blur: 24px;
|
|
12
|
+
--sw-glass-saturate: 1;
|
|
13
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
14
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
15
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-theme='dark'] {
|
|
19
|
+
--sw-color-background: #263E24;
|
|
20
|
+
--sw-color-surface: #2F4A2C;
|
|
21
|
+
--sw-color-text: #E3DCC8;
|
|
22
|
+
--sw-color-muted: #B8B090;
|
|
23
|
+
--sw-color-accent: #CEA453;
|
|
24
|
+
--sw-color-onAccent: #101214;
|
|
25
|
+
--sw-color-border: #3D5238;
|
|
26
|
+
--sw-glass-blur: 24px;
|
|
27
|
+
--sw-glass-saturate: 1.8;
|
|
28
|
+
--sw-glass-fill: rgba(60, 52, 40, 0.72);
|
|
29
|
+
--sw-glass-border: rgba(235, 219, 186, 0.22);
|
|
30
|
+
--sw-glass-specular: rgba(245, 237, 221, 0.28);
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #1D1D1F;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #F5F5F7;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(67, 67, 69, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(251, 251, 252, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(253, 253, 253, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-background: #F3E3C3;
|
|
5
|
+
--sw-color-surface: #F8EEE0;
|
|
6
|
+
--sw-color-text: #473333;
|
|
7
|
+
--sw-color-muted: #6B5348;
|
|
8
|
+
--sw-color-accent: #473333;
|
|
9
|
+
--sw-color-onAccent: #FFFFFF;
|
|
10
|
+
--sw-color-border: #E0CBA8;
|
|
11
|
+
--sw-glass-blur: 24px;
|
|
12
|
+
--sw-glass-saturate: 1;
|
|
13
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
14
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
15
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-theme='dark'] {
|
|
19
|
+
--sw-color-background: #473333;
|
|
20
|
+
--sw-color-surface: #5A4242;
|
|
21
|
+
--sw-color-text: #F3E3C3;
|
|
22
|
+
--sw-color-muted: #D4C4A8;
|
|
23
|
+
--sw-color-accent: #E8C69F;
|
|
24
|
+
--sw-color-onAccent: #101214;
|
|
25
|
+
--sw-color-border: #6B5353;
|
|
26
|
+
--sw-glass-blur: 24px;
|
|
27
|
+
--sw-glass-saturate: 1.8;
|
|
28
|
+
--sw-glass-fill: rgba(65, 59, 53, 0.72);
|
|
29
|
+
--sw-glass-border: rgba(246, 232, 217, 0.22);
|
|
30
|
+
--sw-glass-specular: rgba(250, 244, 236, 0.28);
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #0A2540;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #7EB8FF;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(46, 56, 71, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(203, 227, 255, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(229, 241, 255, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-background: #E4E4CC;
|
|
5
|
+
--sw-color-surface: #EEEEDD;
|
|
6
|
+
--sw-color-text: #1B2130;
|
|
7
|
+
--sw-color-muted: #5C5346;
|
|
8
|
+
--sw-color-accent: #A33B2B;
|
|
9
|
+
--sw-color-onAccent: #FFFFFF;
|
|
10
|
+
--sw-color-border: #D0D0B8;
|
|
11
|
+
--sw-glass-blur: 24px;
|
|
12
|
+
--sw-glass-saturate: 1;
|
|
13
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
14
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
15
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-theme='dark'] {
|
|
19
|
+
--sw-color-background: #1B2130;
|
|
20
|
+
--sw-color-surface: #252B40;
|
|
21
|
+
--sw-color-text: #E4E4CC;
|
|
22
|
+
--sw-color-muted: #B8B49A;
|
|
23
|
+
--sw-color-accent: #EEAF90;
|
|
24
|
+
--sw-color-onAccent: #101214;
|
|
25
|
+
--sw-color-border: #3A4158;
|
|
26
|
+
--sw-glass-blur: 24px;
|
|
27
|
+
--sw-glass-saturate: 1.8;
|
|
28
|
+
--sw-glass-fill: rgba(66, 54, 51, 0.72);
|
|
29
|
+
--sw-glass-border: rgba(248, 223, 211, 0.22);
|
|
30
|
+
--sw-glass-specular: rgba(252, 239, 233, 0.28);
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #DB2777;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #F472B6;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(67, 43, 57, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(251, 199, 226, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(253, 227, 240, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #0369A1;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #38BDF8;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(33, 57, 69, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(175, 229, 252, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(215, 242, 254, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #3B6FD4;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #8BB8FF;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(48, 56, 71, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(209, 227, 255, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(232, 241, 255, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-background: #F6DCAC;
|
|
5
|
+
--sw-color-surface: #FBF0D8;
|
|
6
|
+
--sw-color-text: #1D1D1F;
|
|
7
|
+
--sw-color-muted: #5C5346;
|
|
8
|
+
--sw-color-accent: #A33B20;
|
|
9
|
+
--sw-color-onAccent: #FFFFFF;
|
|
10
|
+
--sw-color-border: #E5C48A;
|
|
11
|
+
--sw-glass-blur: 24px;
|
|
12
|
+
--sw-glass-saturate: 1;
|
|
13
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
14
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
15
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-theme='dark'] {
|
|
19
|
+
--sw-color-background: #012D4E;
|
|
20
|
+
--sw-color-surface: #0A3D5C;
|
|
21
|
+
--sw-color-text: #F6DCAC;
|
|
22
|
+
--sw-color-muted: #C4A882;
|
|
23
|
+
--sw-color-accent: #FAA968;
|
|
24
|
+
--sw-color-onAccent: #101214;
|
|
25
|
+
--sw-color-border: #1A5A70;
|
|
26
|
+
--sw-glass-blur: 24px;
|
|
27
|
+
--sw-glass-saturate: 1.8;
|
|
28
|
+
--sw-glass-fill: rgba(68, 53, 43, 0.72);
|
|
29
|
+
--sw-glass-border: rgba(253, 221, 195, 0.22);
|
|
30
|
+
--sw-glass-specular: rgba(254, 238, 225, 0.28);
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #D81B60;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-background: #1A0533;
|
|
15
|
+
--sw-color-surface: #241043;
|
|
16
|
+
--sw-color-text: #F5F5F7;
|
|
17
|
+
--sw-color-muted: #C9B8E8;
|
|
18
|
+
--sw-color-accent: #FF2A6D;
|
|
19
|
+
--sw-color-onAccent: #101214;
|
|
20
|
+
--sw-color-border: #4A2C6A;
|
|
21
|
+
--sw-glass-blur: 24px;
|
|
22
|
+
--sw-glass-saturate: 1.8;
|
|
23
|
+
--sw-glass-fill: rgba(69, 31, 44, 0.72);
|
|
24
|
+
--sw-glass-border: rgba(255, 170, 197, 0.22);
|
|
25
|
+
--sw-glass-specular: rgba(255, 212, 226, 0.28);
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Generated by @scalewing/tokens. Do not edit by hand. */
|
|
2
|
+
:root,
|
|
3
|
+
[data-theme='light'] {
|
|
4
|
+
--sw-color-accent: #C2410C;
|
|
5
|
+
--sw-color-onAccent: #FFFFFF;
|
|
6
|
+
--sw-glass-blur: 24px;
|
|
7
|
+
--sw-glass-saturate: 1;
|
|
8
|
+
--sw-glass-fill: rgba(255, 255, 255, 1);
|
|
9
|
+
--sw-glass-border: rgba(210, 210, 215, 1);
|
|
10
|
+
--sw-glass-specular: rgba(255, 255, 255, 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-theme='dark'] {
|
|
14
|
+
--sw-color-accent: #FB923C;
|
|
15
|
+
--sw-color-onAccent: #101214;
|
|
16
|
+
--sw-glass-blur: 24px;
|
|
17
|
+
--sw-glass-saturate: 1.8;
|
|
18
|
+
--sw-glass-fill: rgba(68, 49, 35, 0.72);
|
|
19
|
+
--sw-glass-border: rgba(253, 211, 177, 0.22);
|
|
20
|
+
--sw-glass-specular: rgba(254, 233, 216, 0.28);
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SelectOption = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function selectedSelectIndex(options: readonly SelectOption[], value: string): number;
|
|
6
|
+
export declare function nextSelectIndex(current: number, delta: number, length: number): number;
|
|
7
|
+
export declare function selectIndexForKey(key: string, current: number, length: number): number | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function selectedSelectIndex(options, value) {
|
|
2
|
+
const index = options.findIndex((option) => option.value === value);
|
|
3
|
+
return index < 0 ? 0 : index;
|
|
4
|
+
}
|
|
5
|
+
export function nextSelectIndex(current, delta, length) {
|
|
6
|
+
if (length <= 0) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
return Math.min(length - 1, Math.max(0, current + delta));
|
|
10
|
+
}
|
|
11
|
+
export function selectIndexForKey(key, current, length) {
|
|
12
|
+
switch (key) {
|
|
13
|
+
case 'ArrowDown':
|
|
14
|
+
return nextSelectIndex(current, 1, length);
|
|
15
|
+
case 'ArrowUp':
|
|
16
|
+
return nextSelectIndex(current, -1, length);
|
|
17
|
+
case 'Home':
|
|
18
|
+
return 0;
|
|
19
|
+
case 'End':
|
|
20
|
+
return Math.max(0, length - 1);
|
|
21
|
+
default:
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SplitMetrics = {
|
|
2
|
+
min: number;
|
|
3
|
+
max: number;
|
|
4
|
+
step: number;
|
|
5
|
+
};
|
|
6
|
+
export type SplitSnapshot = {
|
|
7
|
+
collapsed: boolean;
|
|
8
|
+
width: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function cssLengthToPx(value: string, remPx?: number): number;
|
|
11
|
+
export declare function readSplitMetrics(read: (name: string) => string, remPx?: number): SplitMetrics & {
|
|
12
|
+
defaultWidth: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function clampSplitSize(size: number, min: number, max: number): number;
|
|
15
|
+
export declare function splitPercent(width: number, min: number, max: number): number;
|
|
16
|
+
export declare function effectiveSplitMax(tokenMax: number, parentWidth: number, handleWidth: number, min: number): number;
|
|
17
|
+
export declare function applySplitDrag(start: SplitSnapshot, deltaX: number, metrics: SplitMetrics): SplitSnapshot;
|
|
18
|
+
export declare function applySplitKey(key: string, start: SplitSnapshot, metrics: SplitMetrics): SplitSnapshot | null;
|