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.
Files changed (141) hide show
  1. package/README.md +145 -49
  2. package/dist/components/AppShell.svelte +1 -1
  3. package/dist/components/Banner.svelte +3 -3
  4. package/dist/components/Button.svelte +4 -4
  5. package/dist/components/action/button/button/Button.svelte +1041 -0
  6. package/dist/components/action/button/button/Button.svelte.d.ts +28 -0
  7. package/dist/components/action/button/button-group/ButtonGroup.svelte +146 -0
  8. package/dist/components/action/button/button-group/ButtonGroup.svelte.d.ts +14 -0
  9. package/dist/components/action/button/floating-action-button/FloatingActionButton.svelte +1102 -0
  10. package/dist/components/action/button/floating-action-button/FloatingActionButton.svelte.d.ts +26 -0
  11. package/dist/components/action/button/icon-button/IconButton.svelte +954 -0
  12. package/dist/components/action/button/icon-button/IconButton.svelte.d.ts +22 -0
  13. package/dist/components/action/button/timed-button/TimedButton.svelte +1143 -0
  14. package/dist/components/action/button/timed-button/TimedButton.svelte.d.ts +32 -0
  15. package/dist/components/action/button/toggle-button/ToggleButton.svelte +1109 -0
  16. package/dist/components/action/button/toggle-button/ToggleButton.svelte.d.ts +28 -0
  17. package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.svelte +242 -0
  18. package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.svelte.d.ts +19 -0
  19. package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.test.svelte +36 -0
  20. package/dist/components/action/button/toggle-button-group/ToggleButtonGroup.test.svelte.d.ts +11 -0
  21. package/dist/components/action/button/toggle-button-group/context.d.ts +8 -0
  22. package/dist/components/action/button/toggle-button-group/context.js +8 -0
  23. package/dist/components/action/input/field/pin-input/PinInput.svelte +4 -4
  24. package/dist/components/action/input/select/checkbox/Checkbox.svelte +4704 -25
  25. package/dist/components/action/input/select/checkbox/Checkbox.svelte.d.ts +28 -0
  26. package/dist/components/action/input/select/checkbox/checkbox-relations.svelte.d.ts +46 -0
  27. package/dist/components/action/input/select/checkbox/checkbox-relations.svelte.js +202 -0
  28. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.d.ts +1 -0
  29. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.html +27 -0
  30. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bounce.js +13 -0
  31. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.d.ts +1 -0
  32. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.html +12 -0
  33. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/bump.js +13 -0
  34. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.d.ts +1 -0
  35. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.html +12 -0
  36. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/draw.js +12 -0
  37. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.d.ts +1 -0
  38. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.html +12 -0
  39. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/fade.js +12 -0
  40. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.d.ts +1 -0
  41. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.html +12 -0
  42. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/pop.js +13 -0
  43. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.d.ts +1 -0
  44. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.html +27 -0
  45. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/rise.js +13 -0
  46. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.d.ts +1 -0
  47. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.html +27 -0
  48. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/scale.js +13 -0
  49. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.d.ts +1 -0
  50. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.html +12 -0
  51. package/dist/components/action/input/select/checkbox/tests/visual-fixtures/visual-state.js +278 -0
  52. package/dist/components/action/input/select/{theme-switch/ThemeSwitch.svelte → color-mode-switch/ColorModeSwitch.svelte} +8 -8
  53. package/dist/components/action/input/select/color-mode-switch/ColorModeSwitch.svelte.d.ts +10 -0
  54. package/dist/components/action/input/select/segment-control/SegmentControl.svelte +2 -2
  55. package/dist/components/action/input/select/slider/Slider.svelte +1 -1
  56. package/dist/components/action/input/select/switch/Switch.svelte +1004 -99
  57. package/dist/components/action/input/select/switch/Switch.svelte.d.ts +8 -3
  58. package/dist/components/display/annotation/badge/Badge.svelte +732 -63
  59. package/dist/components/display/annotation/badge/Badge.svelte.d.ts +1 -1
  60. package/dist/components/display/annotation/tag/Tag.svelte +670 -58
  61. package/dist/components/display/annotation/tag/Tag.svelte.d.ts +3 -1
  62. package/dist/components/display/data-display/metric/date-time/DateTimeValue.svelte +59 -0
  63. package/dist/components/display/data-display/metric/date-time/DateTimeValue.svelte.d.ts +13 -0
  64. package/dist/components/display/data-display/metric/date-time/DateValue.svelte +52 -0
  65. package/dist/components/display/data-display/metric/date-time/DateValue.svelte.d.ts +11 -0
  66. package/dist/components/display/data-display/metric/date-time/TimeValue.svelte +55 -0
  67. package/dist/components/display/data-display/metric/date-time/TimeValue.svelte.d.ts +12 -0
  68. package/dist/components/display/data-display/metric/duration/Duration.svelte +64 -0
  69. package/dist/components/display/data-display/metric/duration/Duration.svelte.d.ts +16 -0
  70. package/dist/components/display/data-display/metric/relative-time/RelativeTime.svelte +121 -0
  71. package/dist/components/display/data-display/metric/relative-time/RelativeTime.svelte.d.ts +21 -0
  72. package/dist/components/display/data-display/metric/timestamp-card/TimestampCard.svelte +121 -0
  73. package/dist/components/display/data-display/metric/timestamp-card/TimestampCard.svelte.d.ts +25 -0
  74. package/dist/components/display/data-display/visual/timeline/TimelineItem.svelte +660 -51
  75. package/dist/components/display/data-display/visual/timeline/context.d.ts +1 -1
  76. package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte +657 -48
  77. package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte.d.ts +1 -1
  78. package/dist/components/display/feedback/loading/spinner/Spinner.svelte +657 -48
  79. package/dist/components/display/feedback/loading/spinner/Spinner.svelte.d.ts +1 -1
  80. package/dist/components/display/motion/collapse/Collapse.svelte +115 -0
  81. package/dist/components/display/motion/collapse/Collapse.svelte.d.ts +17 -0
  82. package/dist/components/display/typography/accordion/Accordion.svelte +347 -0
  83. package/dist/components/display/typography/accordion/Accordion.svelte.d.ts +13 -0
  84. package/dist/components/display/typography/accordion/AccordionGroup.svelte +132 -0
  85. package/dist/components/display/typography/accordion/AccordionGroup.svelte.d.ts +11 -0
  86. package/dist/components/display/typography/accordion/context.d.ts +8 -0
  87. package/dist/components/display/typography/accordion/context.js +8 -0
  88. package/dist/components/display/typography/code-snippet/CodeSnippet.svelte +3 -3
  89. package/dist/components/display/typography/eyebrow/Eyebrow.svelte +2 -2
  90. package/dist/components/display/typography/highlight/Highlight.svelte +719 -59
  91. package/dist/components/display/typography/highlight/Highlight.svelte.d.ts +1 -1
  92. package/dist/components/framework/layout/container/app-shell/AppShell.svelte +16 -2
  93. package/dist/components/framework/navigation/context/breadcrumb/Breadcrumb.svelte +1 -1
  94. package/dist/components/framework/navigation/sidebar/sidebar/Sidebar.svelte +35 -10
  95. package/dist/components/framework/navigation/sidebar/sidenav/Sidenav.svelte +5 -5
  96. package/dist/components/framework/overlay/tooltip/Tooltip.svelte +1011 -0
  97. package/dist/components/framework/overlay/tooltip/Tooltip.svelte.d.ts +31 -0
  98. package/dist/components/framework/surface/paper/Paper.svelte +730 -87
  99. package/dist/components/framework/surface/paper/Paper.svelte.d.ts +1 -1
  100. package/dist/components/utility/format/date-time/formatDateTime.d.ts +23 -0
  101. package/dist/components/utility/format/date-time/formatDateTime.js +33 -0
  102. package/dist/components/utility/format/duration/formatDuration.d.ts +15 -0
  103. package/dist/components/utility/format/duration/formatDuration.js +218 -0
  104. package/dist/components/utility/format/relative-time/formatRelativeTime.d.ts +42 -0
  105. package/dist/components/utility/format/relative-time/formatRelativeTime.js +530 -0
  106. package/dist/design-system/inheritance/tokens.js +6 -0
  107. package/dist/design-system/reserved-props/allowed-options.d.ts +9 -4
  108. package/dist/design-system/theme/tokens.d.ts +72 -2
  109. package/dist/design-system/theme/tokens.js +173 -134
  110. package/dist/icons/generated/check-thick.svelte +16 -0
  111. package/dist/icons/generated/check-thick.svelte.d.ts +7 -0
  112. package/dist/icons/generated/check.svelte +16 -0
  113. package/dist/icons/generated/check.svelte.d.ts +7 -0
  114. package/dist/icons/generated/close-thick.svelte +16 -0
  115. package/dist/icons/generated/close-thick.svelte.d.ts +7 -0
  116. package/dist/icons/generated/close.svelte +16 -0
  117. package/dist/icons/generated/close.svelte.d.ts +7 -0
  118. package/dist/icons/generated/index.d.ts +4 -0
  119. package/dist/icons/generated/index.js +4 -0
  120. package/dist/icons/generated/manifest.js +28 -0
  121. package/dist/index.d.ts +22 -2
  122. package/dist/index.js +22 -2
  123. package/dist/styles/tone-context.css +656 -46
  124. package/dist/theme.css +1 -161
  125. package/dist/themes/canopy.css +373 -0
  126. package/dist/themes/cobalt.css +373 -0
  127. package/dist/themes/iris.css +373 -0
  128. package/dist/themes/lumen.css +373 -0
  129. package/dist/themes/mono.css +373 -0
  130. package/dist/themes/moss.css +373 -0
  131. package/dist/themes/noir.css +373 -0
  132. package/dist/themes/plain.css +373 -0
  133. package/dist/themes/pulse.css +373 -0
  134. package/dist/themes/signal.css +373 -0
  135. package/dist/themes/slate.css +373 -0
  136. package/dist/themes/solar.css +373 -0
  137. package/dist/themes/sorbet.css +373 -0
  138. package/dist/themes/studio.css +369 -0
  139. package/dist/themes/vesper.css +373 -0
  140. package/package.json +32 -4
  141. 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;