seblify 0.2.1 → 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/README.md +145 -49
- package/dist/components/AppShell.svelte +1 -1
- package/dist/components/Banner.svelte +3 -3
- package/dist/components/Button.svelte +4 -4
- package/dist/components/action/button/button/Button.svelte +1041 -0
- package/dist/components/action/button/button/Button.svelte.d.ts +28 -0
- package/dist/components/action/button/button-group/ButtonGroup.svelte +146 -0
- package/dist/components/action/button/button-group/ButtonGroup.svelte.d.ts +14 -0
- package/dist/components/action/button/floating-action-button/FloatingActionButton.svelte +1102 -0
- package/dist/components/action/button/floating-action-button/FloatingActionButton.svelte.d.ts +26 -0
- package/dist/components/action/button/icon-button/IconButton.svelte +954 -0
- package/dist/components/action/button/icon-button/IconButton.svelte.d.ts +22 -0
- package/dist/components/action/button/timed-button/TimedButton.svelte +1143 -0
- package/dist/components/action/button/timed-button/TimedButton.svelte.d.ts +32 -0
- package/dist/components/action/button/toggle-button/ToggleButton.svelte +1109 -0
- package/dist/components/action/button/toggle-button/ToggleButton.svelte.d.ts +28 -0
- package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.svelte +242 -0
- package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.svelte.d.ts +19 -0
- package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.test.svelte +36 -0
- package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.test.svelte.d.ts +11 -0
- package/dist/components/action/button/toggle-button-group/context.d.ts +8 -0
- package/dist/components/action/button/toggle-button-group/context.js +8 -0
- package/dist/components/action/input/field/pin-input/PinInput.svelte +4 -4
- package/dist/components/action/input/select/checkbox/Checkbox.svelte +4704 -25
- package/dist/components/action/input/select/checkbox/Checkbox.svelte.d.ts +28 -0
- package/dist/components/action/input/select/checkbox/checkbox-relations.svelte.d.ts +46 -0
- package/dist/components/action/input/select/checkbox/checkbox-relations.svelte.js +202 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.html +27 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.js +13 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.html +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.js +13 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.html +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.js +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.html +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.js +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.html +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.js +13 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.html +27 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.js +13 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.html +27 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.js +13 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.d.ts +1 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.html +12 -0
- package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.js +278 -0
- package/dist/components/action/input/select/{theme-switch/ThemeSwitch.svelte → color-mode-switch/ColorModeSwitch.svelte} +8 -8
- package/dist/components/action/input/select/color-mode-switch/ColorModeSwitch.svelte.d.ts +10 -0
- package/dist/components/action/input/select/segment-control/SegmentControl.svelte +2 -2
- package/dist/components/action/input/select/slider/Slider.svelte +1 -1
- package/dist/components/action/input/select/switch/Switch.svelte +1004 -99
- package/dist/components/action/input/select/switch/Switch.svelte.d.ts +8 -3
- package/dist/components/display/annotation/badge/Badge.svelte +732 -63
- package/dist/components/display/annotation/badge/Badge.svelte.d.ts +1 -1
- package/dist/components/display/annotation/tag/Tag.svelte +670 -58
- package/dist/components/display/annotation/tag/Tag.svelte.d.ts +3 -1
- package/dist/components/display/data-display/metric/date-time/DateTimeValue.svelte +59 -0
- package/dist/components/display/data-display/metric/date-time/DateTimeValue.svelte.d.ts +13 -0
- package/dist/components/display/data-display/metric/date-time/DateValue.svelte +52 -0
- package/dist/components/display/data-display/metric/date-time/DateValue.svelte.d.ts +11 -0
- package/dist/components/display/data-display/metric/date-time/TimeValue.svelte +55 -0
- package/dist/components/display/data-display/metric/date-time/TimeValue.svelte.d.ts +12 -0
- package/dist/components/display/data-display/metric/duration/Duration.svelte +64 -0
- package/dist/components/display/data-display/metric/duration/Duration.svelte.d.ts +16 -0
- package/dist/components/display/data-display/metric/relative-time/RelativeTime.svelte +121 -0
- package/dist/components/display/data-display/metric/relative-time/RelativeTime.svelte.d.ts +21 -0
- package/dist/components/display/data-display/metric/timestamp-card/TimestampCard.svelte +121 -0
- package/dist/components/display/data-display/metric/timestamp-card/TimestampCard.svelte.d.ts +25 -0
- package/dist/components/display/data-display/visual/timeline/TimelineItem.svelte +660 -51
- package/dist/components/display/data-display/visual/timeline/context.d.ts +1 -1
- package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte +657 -48
- package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte.d.ts +1 -1
- package/dist/components/display/feedback/loading/spinner/Spinner.svelte +657 -48
- package/dist/components/display/feedback/loading/spinner/Spinner.svelte.d.ts +1 -1
- package/dist/components/display/motion/collapse/Collapse.svelte +115 -0
- package/dist/components/display/motion/collapse/Collapse.svelte.d.ts +17 -0
- package/dist/components/display/typography/accordion/Accordion.svelte +347 -0
- package/dist/components/display/typography/accordion/Accordion.svelte.d.ts +13 -0
- package/dist/components/display/typography/accordion/AccordionGroup.svelte +132 -0
- package/dist/components/display/typography/accordion/AccordionGroup.svelte.d.ts +11 -0
- package/dist/components/display/typography/accordion/context.d.ts +8 -0
- package/dist/components/display/typography/accordion/context.js +8 -0
- package/dist/components/display/typography/code-snippet/CodeSnippet.svelte +3 -3
- package/dist/components/display/typography/eyebrow/Eyebrow.svelte +2 -2
- package/dist/components/display/typography/highlight/Highlight.svelte +719 -59
- package/dist/components/display/typography/highlight/Highlight.svelte.d.ts +1 -1
- package/dist/components/framework/layout/container/app-shell/AppShell.svelte +16 -2
- package/dist/components/framework/navigation/context/breadcrumb/Breadcrumb.svelte +1 -1
- package/dist/components/framework/navigation/sidebar/sidebar/Sidebar.svelte +35 -10
- package/dist/components/framework/navigation/sidebar/sidenav/Sidenav.svelte +5 -5
- package/dist/components/framework/overlay/tooltip/Tooltip.svelte +1011 -0
- package/dist/components/framework/overlay/tooltip/Tooltip.svelte.d.ts +31 -0
- package/dist/components/framework/surface/paper/Paper.svelte +730 -87
- package/dist/components/framework/surface/paper/Paper.svelte.d.ts +1 -1
- package/dist/components/utility/format/date-time/formatDateTime.d.ts +23 -0
- package/dist/components/utility/format/date-time/formatDateTime.js +33 -0
- package/dist/components/utility/format/duration/formatDuration.d.ts +15 -0
- package/dist/components/utility/format/duration/formatDuration.js +218 -0
- package/dist/components/utility/format/relative-time/formatRelativeTime.d.ts +42 -0
- package/dist/components/utility/format/relative-time/formatRelativeTime.js +530 -0
- package/dist/design-system/inheritance/tokens.js +6 -0
- package/dist/design-system/reserved-props/allowed-options.d.ts +9 -4
- package/dist/design-system/theme/tokens.d.ts +72 -2
- package/dist/design-system/theme/tokens.js +173 -134
- package/dist/icons/generated/check-thick.svelte +16 -0
- package/dist/icons/generated/check-thick.svelte.d.ts +7 -0
- package/dist/icons/generated/check.svelte +16 -0
- package/dist/icons/generated/check.svelte.d.ts +7 -0
- package/dist/icons/generated/close-thick.svelte +16 -0
- package/dist/icons/generated/close-thick.svelte.d.ts +7 -0
- package/dist/icons/generated/close.svelte +16 -0
- package/dist/icons/generated/close.svelte.d.ts +7 -0
- package/dist/icons/generated/index.d.ts +4 -0
- package/dist/icons/generated/index.js +4 -0
- package/dist/icons/generated/manifest.js +28 -0
- package/dist/index.d.ts +22 -2
- package/dist/index.js +22 -2
- package/dist/styles/tone-context.css +656 -46
- package/dist/theme.css +1 -161
- package/dist/themes/canopy.css +373 -0
- package/dist/themes/cobalt.css +373 -0
- package/dist/themes/iris.css +373 -0
- package/dist/themes/lumen.css +373 -0
- package/dist/themes/mono.css +373 -0
- package/dist/themes/moss.css +373 -0
- package/dist/themes/noir.css +373 -0
- package/dist/themes/plain.css +373 -0
- package/dist/themes/pulse.css +373 -0
- package/dist/themes/signal.css +373 -0
- package/dist/themes/slate.css +373 -0
- package/dist/themes/solar.css +373 -0
- package/dist/themes/sorbet.css +373 -0
- package/dist/themes/studio.css +369 -0
- package/dist/themes/vesper.css +373 -0
- package/package.json +32 -4
- package/dist/components/action/input/select/theme-switch/ThemeSwitch.svelte.d.ts +0 -10
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CustomCssSize } from 'seblify';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'full' | CustomCssSize;
|
|
4
|
+
type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | CustomCssSize;
|
|
5
|
+
type ButtonTone = 'neutral' | 'strong' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
6
|
+
type ButtonSurface = 'default' | 'inverse';
|
|
7
|
+
type ButtonVariant = 'solid' | 'soft' | 'tint' | 'outline' | 'plain';
|
|
8
|
+
declare const Button: import("svelte").Component<{
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
ariaLabel?: string | undefined;
|
|
11
|
+
children?: Snippet | undefined;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
end?: Snippet | undefined;
|
|
15
|
+
fullWidth?: boolean | undefined;
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
loading?: boolean | undefined;
|
|
18
|
+
loadingLabel?: string | undefined;
|
|
19
|
+
radius?: ButtonRadius | undefined;
|
|
20
|
+
size?: ButtonSize | undefined;
|
|
21
|
+
start?: Snippet | undefined;
|
|
22
|
+
surface?: ButtonSurface | undefined;
|
|
23
|
+
tone?: ButtonTone | undefined;
|
|
24
|
+
type?: "Guard: `type` prop not allowed. Use `variant` instead" | undefined;
|
|
25
|
+
variant?: ButtonVariant | undefined;
|
|
26
|
+
}, {}, "">;
|
|
27
|
+
type Button = ReturnType<typeof Button>;
|
|
28
|
+
export default Button;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CustomCssSize, SeblifyProps } from 'seblify';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
6
|
+
type ButtonGroupRadius =
|
|
7
|
+
| 'none'
|
|
8
|
+
| 'sm'
|
|
9
|
+
| 'md'
|
|
10
|
+
| 'lg'
|
|
11
|
+
| 'full'
|
|
12
|
+
| CustomCssSize;
|
|
13
|
+
|
|
14
|
+
type Props = SeblifyProps<{
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
class?: string;
|
|
19
|
+
orientation?: ButtonGroupOrientation;
|
|
20
|
+
radius?: ButtonGroupRadius;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
const BUTTON_GROUP_RADIUS_MAP: Record<
|
|
24
|
+
Exclude<ButtonGroupRadius, CustomCssSize>,
|
|
25
|
+
string
|
|
26
|
+
> = {
|
|
27
|
+
none: '0',
|
|
28
|
+
sm: '0.25rem',
|
|
29
|
+
md: '0.375rem',
|
|
30
|
+
lg: '0.5rem',
|
|
31
|
+
full: '999px',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
let {
|
|
35
|
+
ariaLabel,
|
|
36
|
+
children,
|
|
37
|
+
class: className,
|
|
38
|
+
orientation = 'horizontal',
|
|
39
|
+
radius = 'md',
|
|
40
|
+
...restProps
|
|
41
|
+
}: Props = $props();
|
|
42
|
+
|
|
43
|
+
function cssSize(value: CustomCssSize): string {
|
|
44
|
+
return typeof value === 'number' ? `${value}px` : value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function resolveRadiusValue(value: ButtonGroupRadius): string {
|
|
48
|
+
if (typeof value === 'number') {
|
|
49
|
+
return cssSize(value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return BUTTON_GROUP_RADIUS_MAP[
|
|
53
|
+
value as keyof typeof BUTTON_GROUP_RADIUS_MAP
|
|
54
|
+
] ?? value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const radiusValue = $derived(resolveRadiusValue(radius));
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
{...restProps}
|
|
62
|
+
aria-label={ariaLabel}
|
|
63
|
+
class={`button-group${className ? ` ${className}` : ''}`}
|
|
64
|
+
data-orientation={orientation}
|
|
65
|
+
role="group"
|
|
66
|
+
style:--button-group-radius={radiusValue}
|
|
67
|
+
>
|
|
68
|
+
{#if children}
|
|
69
|
+
{@render children()}
|
|
70
|
+
{/if}
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<style>
|
|
74
|
+
.button-group {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
align-items: stretch;
|
|
78
|
+
vertical-align: middle;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.button-group[data-orientation='horizontal'] {
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.button-group[data-orientation='vertical'] {
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
width: fit-content;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.button-group :global(.button),
|
|
91
|
+
.button-group :global(.icon-button) {
|
|
92
|
+
position: relative;
|
|
93
|
+
border-radius: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.button-group :global(.button:focus-visible),
|
|
97
|
+
.button-group :global(.icon-button:focus-visible) {
|
|
98
|
+
z-index: 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.button-group[data-orientation='horizontal'] :global(.button),
|
|
102
|
+
.button-group[data-orientation='horizontal'] :global(.icon-button) {
|
|
103
|
+
margin-inline-start: -1px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.button-group[data-orientation='horizontal']
|
|
107
|
+
:global(.button:first-child),
|
|
108
|
+
.button-group[data-orientation='horizontal']
|
|
109
|
+
:global(.icon-button:first-child) {
|
|
110
|
+
margin-inline-start: 0;
|
|
111
|
+
border-start-start-radius: var(--button-group-radius);
|
|
112
|
+
border-end-start-radius: var(--button-group-radius);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.button-group[data-orientation='horizontal']
|
|
116
|
+
:global(.button:last-child),
|
|
117
|
+
.button-group[data-orientation='horizontal']
|
|
118
|
+
:global(.icon-button:last-child) {
|
|
119
|
+
border-start-end-radius: var(--button-group-radius);
|
|
120
|
+
border-end-end-radius: var(--button-group-radius);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.button-group[data-orientation='vertical'] :global(.button),
|
|
124
|
+
.button-group[data-orientation='vertical'] :global(.icon-button) {
|
|
125
|
+
margin-block-start: -1px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.button-group[data-orientation='vertical'] :global(.button) {
|
|
129
|
+
width: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.button-group[data-orientation='vertical'] :global(.button:first-child),
|
|
133
|
+
.button-group[data-orientation='vertical']
|
|
134
|
+
:global(.icon-button:first-child) {
|
|
135
|
+
margin-block-start: 0;
|
|
136
|
+
border-start-start-radius: var(--button-group-radius);
|
|
137
|
+
border-start-end-radius: var(--button-group-radius);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.button-group[data-orientation='vertical'] :global(.button:last-child),
|
|
141
|
+
.button-group[data-orientation='vertical']
|
|
142
|
+
:global(.icon-button:last-child) {
|
|
143
|
+
border-end-start-radius: var(--button-group-radius);
|
|
144
|
+
border-end-end-radius: var(--button-group-radius);
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CustomCssSize } from 'seblify';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
type ButtonGroupRadius = 'none' | 'sm' | 'md' | 'lg' | 'full' | CustomCssSize;
|
|
5
|
+
declare const ButtonGroup: import("svelte").Component<{
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
ariaLabel?: string | undefined;
|
|
8
|
+
children?: Snippet | undefined;
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
orientation?: ButtonGroupOrientation | undefined;
|
|
11
|
+
radius?: ButtonGroupRadius | undefined;
|
|
12
|
+
}, {}, "">;
|
|
13
|
+
type ButtonGroup = ReturnType<typeof ButtonGroup>;
|
|
14
|
+
export default ButtonGroup;
|