sv5ui-plus 5.0.4 → 5.0.6
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 +6 -6
- package/dist/adapters/notify.d.ts +1 -1
- package/dist/adapters/notify.js +18 -18
- package/dist/compat.d.ts +2 -2
- package/dist/compat.js +2 -2
- package/dist/components/BentoGrid/BentoCard.svelte +33 -33
- package/dist/components/BentoGrid/BentoCard.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.types.d.ts +2 -2
- package/dist/components/BentoGrid/bento-grid.variants.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.variants.js +10 -10
- package/dist/components/BentoGrid/index.d.ts +4 -4
- package/dist/components/BentoGrid/index.js +4 -4
- package/dist/components/Chart/Chart.svelte +1 -1
- package/dist/components/Chart/Chart.svelte.d.ts +1 -1
- package/dist/components/Chart/chart.types.d.ts +3 -3
- package/dist/components/Chart/index.d.ts +2 -2
- package/dist/components/Chart/index.js +2 -2
- package/dist/components/Chat/ChatBubble.svelte +19 -19
- package/dist/components/Chat/ChatBubble.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatInput.svelte +26 -27
- package/dist/components/Chat/ChatInput.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatMessage.svelte +1 -1
- package/dist/components/Chat/ChatMessage.svelte.d.ts +1 -1
- package/dist/components/Chat/chat.types.d.ts +6 -6
- package/dist/components/Chat/chat.variants.d.ts +1 -1
- package/dist/components/Chat/chat.variants.js +29 -29
- package/dist/components/Chat/index.d.ts +5 -5
- package/dist/components/Chat/index.js +5 -5
- package/dist/components/CodeBlock/CodeBlock.svelte +15 -15
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.types.d.ts +5 -5
- package/dist/components/CodeBlock/code-block.variants.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.variants.js +40 -40
- package/dist/components/CodeBlock/index.d.ts +2 -2
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte +93 -97
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.js +9 -9
- package/dist/components/ConfirmDialog/confirm.types.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.js +2 -2
- package/dist/components/DatePickerField/DatePickerField.svelte +11 -11
- package/dist/components/DatePickerField/DatePickerField.svelte.d.ts +2 -2
- package/dist/components/DatePickerField/date-picker-field.types.d.ts +1 -1
- package/dist/components/DatePickerField/index.d.ts +2 -2
- package/dist/components/DatePickerField/index.js +1 -1
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte +26 -26
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte.d.ts +2 -2
- package/dist/components/DateRangePickerField/date-range-picker-field.types.d.ts +1 -1
- package/dist/components/DateRangePickerField/index.d.ts +2 -2
- package/dist/components/DateRangePickerField/index.js +1 -1
- package/dist/components/Fonts/Fonts.svelte +12 -12
- package/dist/components/Fonts/Fonts.svelte.d.ts +1 -1
- package/dist/components/Fonts/fonts.d.ts +1 -1
- package/dist/components/Fonts/fonts.js +42 -42
- package/dist/components/Fonts/fonts.types.d.ts +6 -6
- package/dist/components/Fonts/index.d.ts +3 -3
- package/dist/components/Fonts/index.js +2 -2
- package/dist/components/FormSelect/FormSelect.svelte +4 -4
- package/dist/components/FormSelect/FormSelect.svelte.d.ts +2 -2
- package/dist/components/FormSelect/form-select.types.d.ts +3 -3
- package/dist/components/FormSelect/index.d.ts +2 -2
- package/dist/components/FormSelect/index.js +1 -1
- package/dist/components/List/List.svelte +1 -1
- package/dist/components/List/List.svelte.d.ts +1 -1
- package/dist/components/List/ListItem.svelte +31 -39
- package/dist/components/List/ListItem.svelte.d.ts +1 -1
- package/dist/components/List/index.d.ts +4 -4
- package/dist/components/List/index.js +4 -4
- package/dist/components/List/list.types.d.ts +4 -4
- package/dist/components/List/list.variants.d.ts +1 -1
- package/dist/components/List/list.variants.js +22 -22
- package/dist/components/LocaleButton/LocaleButton.svelte +104 -108
- package/dist/components/LocaleButton/LocaleButton.svelte.d.ts +1 -1
- package/dist/components/LocaleButton/index.d.ts +2 -2
- package/dist/components/LocaleButton/index.js +1 -1
- package/dist/components/LocaleButton/locale-button.types.d.ts +12 -12
- package/dist/components/LocaleButton/locale-button.variants.d.ts +2 -2
- package/dist/components/LocaleButton/locale-button.variants.js +68 -68
- package/dist/components/Marquee/Marquee.svelte +34 -34
- package/dist/components/Marquee/Marquee.svelte.d.ts +1 -1
- package/dist/components/Marquee/index.d.ts +3 -3
- package/dist/components/Marquee/index.js +3 -3
- package/dist/components/Marquee/marquee.types.d.ts +4 -4
- package/dist/components/Marquee/marquee.variants.d.ts +1 -1
- package/dist/components/Marquee/marquee.variants.js +15 -15
- package/dist/components/NavigationMenu/NavigationMenu.svelte +366 -379
- package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +1 -1
- package/dist/components/NavigationMenu/index.d.ts +2 -2
- package/dist/components/NavigationMenu/index.js +1 -1
- package/dist/components/NavigationMenu/navigation-menu.types.d.ts +17 -17
- package/dist/components/NavigationMenu/navigation-menu.variants.d.ts +1 -1
- package/dist/components/NavigationMenu/navigation-menu.variants.js +177 -177
- package/dist/components/NumberTicker/NumberTicker.svelte +1 -5
- package/dist/components/NumberTicker/NumberTicker.svelte.d.ts +1 -1
- package/dist/components/NumberTicker/index.d.ts +3 -3
- package/dist/components/NumberTicker/index.js +3 -3
- package/dist/components/NumberTicker/number-ticker.types.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.js +3 -3
- package/dist/components/PasswordInput/PasswordInput.svelte +58 -58
- package/dist/components/PasswordInput/PasswordInput.svelte.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts +2 -2
- package/dist/components/PasswordInput/index.js +1 -1
- package/dist/components/PasswordInput/password-input.types.d.ts +9 -9
- package/dist/components/PasswordInput/password-input.variants.d.ts +2 -2
- package/dist/components/PasswordInput/password-input.variants.js +62 -62
- package/dist/components/Prose/Prose.svelte +5 -5
- package/dist/components/Prose/Prose.svelte.d.ts +1 -1
- package/dist/components/Prose/index.d.ts +3 -3
- package/dist/components/Prose/index.js +3 -3
- package/dist/components/Prose/prose.types.d.ts +4 -4
- package/dist/components/Prose/prose.variants.d.ts +1 -1
- package/dist/components/Prose/prose.variants.js +27 -27
- package/dist/components/{Resizable/Resizable.svelte → ResizeContainer/ResizeContainer.svelte} +3 -3
- package/dist/components/ResizeContainer/ResizeContainer.svelte.d.ts +4 -0
- package/dist/components/ResizeContainer/index.d.ts +4 -0
- package/dist/components/ResizeContainer/index.js +4 -0
- package/dist/components/ResizeContainer/resize-container.types.d.ts +18 -0
- package/dist/components/ResizeContainer/resize-container.variants.d.ts +30 -0
- package/dist/components/ResizeContainer/resize-container.variants.js +17 -0
- package/dist/components/SafeTable/SafeTable.svelte +74 -74
- package/dist/components/SafeTable/SafeTable.svelte.d.ts +2 -2
- package/dist/components/SafeTable/index.d.ts +2 -2
- package/dist/components/SafeTable/index.js +1 -1
- package/dist/components/SafeTable/safe-table.types.d.ts +1 -1
- package/dist/components/Search/Search.svelte +63 -63
- package/dist/components/Search/Search.svelte.d.ts +1 -1
- package/dist/components/Search/index.d.ts +2 -2
- package/dist/components/Search/index.js +1 -1
- package/dist/components/Search/search.types.d.ts +5 -5
- package/dist/components/SortableGroup/SortableGroup.svelte +16 -10
- package/dist/components/SortableGroup/SortableGroup.svelte.d.ts +3 -3
- package/dist/components/SortableGroup/index.d.ts +1 -1
- package/dist/components/SortableGroup/index.js +1 -1
- package/dist/components/SortableList/SortableList.svelte +49 -46
- package/dist/components/SortableList/SortableList.svelte.d.ts +2 -2
- package/dist/components/SortableList/index.d.ts +2 -2
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/SortableList/sortable-list.types.d.ts +3 -3
- package/dist/components/Spotlight/Spotlight.svelte +13 -13
- package/dist/components/Spotlight/Spotlight.svelte.d.ts +1 -1
- package/dist/components/Spotlight/index.d.ts +3 -3
- package/dist/components/Spotlight/index.js +3 -3
- package/dist/components/Spotlight/spotlight.types.d.ts +2 -2
- package/dist/components/Spotlight/spotlight.variants.d.ts +1 -1
- package/dist/components/Spotlight/spotlight.variants.js +5 -5
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte +23 -23
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte.d.ts +1 -1
- package/dist/components/TableBulkActionBar/index.d.ts +2 -2
- package/dist/components/TableBulkActionBar/index.js +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.types.d.ts +3 -3
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.d.ts +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.js +7 -7
- package/dist/components/TreeView/TreeView.svelte +59 -59
- package/dist/components/TreeView/TreeView.svelte.d.ts +1 -1
- package/dist/components/TreeView/index.d.ts +3 -3
- package/dist/components/TreeView/index.js +2 -2
- package/dist/components/TreeView/tree-view.types.d.ts +4 -4
- package/dist/components/TreeView/tree-view.variants.d.ts +1 -1
- package/dist/components/TreeView/tree-view.variants.js +19 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +28 -28
- package/dist/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/dist/form/resolve-form-field-name.js +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +1 -1
- package/dist/hooks/internal/SortableProvider.svelte +16 -11
- package/dist/hooks/internal/SortableProvider.svelte.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.js +1 -1
- package/dist/hooks/internal/sortable-context.d.ts +6 -6
- package/dist/hooks/internal/sortable-context.js +2 -2
- package/dist/hooks/useDragDrop/index.d.ts +1 -1
- package/dist/hooks/useDragDrop/index.js +1 -1
- package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +3 -3
- package/dist/hooks/useDragDrop/useDragDrop.svelte.js +15 -15
- package/dist/hooks/useSortable/index.d.ts +2 -2
- package/dist/hooks/useSortable/index.js +2 -2
- package/dist/hooks/useSortable/useSortable.svelte.d.ts +4 -4
- package/dist/hooks/useSortable/useSortable.svelte.js +23 -23
- package/dist/hooks/utils.js +1 -1
- package/dist/index.d.ts +29 -31
- package/dist/index.js +28 -30
- package/dist/mcp/install-template.mjs +44 -44
- package/dist/mcp/server.mjs +262 -263
- package/dist/mcp/sv5ui-plus-docs.data.json +4 -10
- package/package.json +17 -14
- package/dist/components/ColorPicker/ColorPicker.svelte +0 -109
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +0 -4
- package/dist/components/ColorPicker/color-picker.types.d.ts +0 -26
- package/dist/components/ColorPicker/color-picker.variants.d.ts +0 -69
- package/dist/components/ColorPicker/color-picker.variants.js +0 -13
- package/dist/components/ColorPicker/index.d.ts +0 -4
- package/dist/components/ColorPicker/index.js +0 -4
- package/dist/components/Resizable/Resizable.svelte.d.ts +0 -4
- package/dist/components/Resizable/index.d.ts +0 -4
- package/dist/components/Resizable/index.js +0 -4
- package/dist/components/Resizable/resizable.types.d.ts +0 -18
- package/dist/components/Resizable/resizable.types.js +0 -1
- package/dist/components/Resizable/resizable.variants.d.ts +0 -48
- package/dist/components/Resizable/resizable.variants.js +0 -17
- package/dist/components/ScrollArea/ScrollArea.svelte +0 -54
- package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +0 -4
- package/dist/components/ScrollArea/index.d.ts +0 -4
- package/dist/components/ScrollArea/index.js +0 -4
- package/dist/components/ScrollArea/scroll-area.types.d.ts +0 -27
- package/dist/components/ScrollArea/scroll-area.types.js +0 -1
- package/dist/components/ScrollArea/scroll-area.variants.d.ts +0 -45
- package/dist/components/ScrollArea/scroll-area.variants.js +0 -27
- /package/dist/components/{ColorPicker/color-picker.types.js → ResizeContainer/resize-container.types.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const numberTickerVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base:
|
|
5
|
-
}
|
|
4
|
+
base: "inline-block font-mono tracking-wider tabular-nums text-surface-900 dark:text-surface-50",
|
|
5
|
+
},
|
|
6
6
|
});
|
|
@@ -119,64 +119,64 @@ const classes = $derived({
|
|
|
119
119
|
</script>
|
|
120
120
|
|
|
121
121
|
<div class={classes.root}>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
122
|
+
{#if useMaskChar && name}
|
|
123
|
+
<input type="hidden" {name} value={value ?? ""} />
|
|
124
|
+
{/if}
|
|
125
|
+
<div class={classes.inputWrapper}>
|
|
126
|
+
<Input
|
|
127
|
+
{...restProps}
|
|
128
|
+
bind:ref
|
|
129
|
+
name={useMaskChar ? undefined : name}
|
|
130
|
+
value={useMaskChar ? displayValue : value}
|
|
131
|
+
{size}
|
|
132
|
+
{color}
|
|
133
|
+
{variant}
|
|
134
|
+
type={useMaskChar || isVisible ? "text" : "password"}
|
|
135
|
+
class="w-full"
|
|
136
|
+
oninput={handleInput}
|
|
137
|
+
ui={{
|
|
138
|
+
base: ui?.base,
|
|
139
|
+
root: ui?.inputRoot,
|
|
140
|
+
leading: ui?.leading,
|
|
141
|
+
leadingIcon: ui?.leadingIcon,
|
|
142
|
+
trailing: ui?.trailing,
|
|
143
|
+
trailingIcon: ui?.trailingIcon,
|
|
144
|
+
}}
|
|
145
|
+
trailing
|
|
146
|
+
/>
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
class={classes.toggleBtn}
|
|
151
|
+
onclick={toggleVisibility}
|
|
152
|
+
aria-label={isVisible ? hideLabel : showLabel}
|
|
153
|
+
aria-pressed={isVisible}
|
|
154
|
+
>
|
|
155
|
+
{#if isVisible}
|
|
156
|
+
<Icon name={hideIcon} class={classes.toggleIcon} />
|
|
157
|
+
{:else}
|
|
158
|
+
<Icon name={showIcon} class={classes.toggleIcon} />
|
|
159
|
+
{/if}
|
|
160
|
+
</button>
|
|
161
|
+
</div>
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
163
|
+
{#if showStrength && String(value ?? "").length > 0}
|
|
164
|
+
<div>
|
|
165
|
+
<div class={classes.meterWrapper}>
|
|
166
|
+
{#each { length: 4 } as _, i (i)}
|
|
167
|
+
{#if segmentIcon}
|
|
168
|
+
<Icon
|
|
169
|
+
name={segmentIcon}
|
|
170
|
+
class="{classes.meterIcon} {getSegmentTextColor(i, strength)}"
|
|
171
|
+
/>
|
|
172
|
+
{:else}
|
|
173
|
+
<div class="{classes.meterSegment} {getSegmentBgColor(i, strength)}"></div>
|
|
174
|
+
{/if}
|
|
175
|
+
{/each}
|
|
176
|
+
</div>
|
|
177
|
+
<p class={classes.strengthText}>
|
|
178
|
+
{strengthLabels[Math.max(0, strength)]}
|
|
179
|
+
</p>
|
|
180
|
+
</div>
|
|
181
|
+
{/if}
|
|
182
182
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PasswordInputProps } from
|
|
1
|
+
import type { PasswordInputProps } from "./password-input.types.js";
|
|
2
2
|
export type Props = PasswordInputProps;
|
|
3
3
|
declare const PasswordInput: import("svelte").Component<PasswordInputProps, {}, "value" | "ref">;
|
|
4
4
|
type PasswordInput = ReturnType<typeof PasswordInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as PasswordInput } from
|
|
2
|
-
export type { PasswordInputProps } from
|
|
1
|
+
export { default as PasswordInput } from "./PasswordInput.svelte";
|
|
2
|
+
export type { PasswordInputProps } from "./password-input.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as PasswordInput } from
|
|
1
|
+
export { default as PasswordInput } from "./PasswordInput.svelte";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ClassNameValue } from
|
|
2
|
-
import type { InputProps } from
|
|
3
|
-
import type { PasswordInputSlots, PasswordInputVariantProps } from
|
|
1
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
2
|
+
import type { InputProps } from "sv5ui";
|
|
3
|
+
import type { PasswordInputSlots, PasswordInputVariantProps } from "./password-input.variants.js";
|
|
4
4
|
/**
|
|
5
5
|
* All slots available for class overrides in PasswordInput.
|
|
6
6
|
* Combines PasswordInput-specific slots with a subset of the inner
|
|
@@ -8,10 +8,10 @@ import type { PasswordInputSlots, PasswordInputVariantProps } from './password-i
|
|
|
8
8
|
*/
|
|
9
9
|
export type PasswordInputUISlots = PasswordInputSlots
|
|
10
10
|
/** Root wrapper of the inner `<Input>` component. */
|
|
11
|
-
|
|
|
11
|
+
| "inputRoot"
|
|
12
12
|
/** The `<input>` element base class inside the inner `<Input>`. */
|
|
13
|
-
|
|
|
14
|
-
export type PasswordInputProps = Omit<InputProps,
|
|
13
|
+
| "base" | "leading" | "leadingIcon" | "trailing" | "trailingIcon";
|
|
14
|
+
export type PasswordInputProps = Omit<InputProps, "type"> & {
|
|
15
15
|
/**
|
|
16
16
|
* Bind a reference to the underlying HTMLInputElement.
|
|
17
17
|
*/
|
|
@@ -80,20 +80,20 @@ export type PasswordInputProps = Omit<InputProps, 'type'> & {
|
|
|
80
80
|
* Also scales the toggle button icon and strength meter segments to match.
|
|
81
81
|
* @default 'md'
|
|
82
82
|
*/
|
|
83
|
-
size?: NonNullable<PasswordInputVariantProps[
|
|
83
|
+
size?: NonNullable<PasswordInputVariantProps["size"]>;
|
|
84
84
|
/**
|
|
85
85
|
* Controls the visual style of the input field.
|
|
86
86
|
* Mirrors `<Input>` variants — the value is forwarded directly to the inner Input.
|
|
87
87
|
* @default 'outline'
|
|
88
88
|
*/
|
|
89
|
-
variant?: NonNullable<InputProps[
|
|
89
|
+
variant?: NonNullable<InputProps["variant"]>;
|
|
90
90
|
/**
|
|
91
91
|
* Sets the color scheme for focus ring and highlight.
|
|
92
92
|
* Also applied to the toggle button's focus ring for visual consistency.
|
|
93
93
|
* Automatically overridden with `'error'` when inside a FormField with an error.
|
|
94
94
|
* @default 'primary'
|
|
95
95
|
*/
|
|
96
|
-
color?: NonNullable<InputProps[
|
|
96
|
+
color?: NonNullable<InputProps["color"]>;
|
|
97
97
|
/**
|
|
98
98
|
* Additional CSS classes for the root element.
|
|
99
99
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const passwordInputVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
size: {
|
|
4
4
|
xs: {
|
|
@@ -265,7 +265,7 @@ export type PasswordInputVariantProps = VariantProps<typeof passwordInputVariant
|
|
|
265
265
|
export type PasswordInputSlots = keyof ReturnType<typeof passwordInputVariants>;
|
|
266
266
|
export declare const passwordInputDefaults: {
|
|
267
267
|
defaultVariants: {
|
|
268
|
-
color?: "primary" | "surface" | "error" | "
|
|
268
|
+
color?: "primary" | "surface" | "error" | "warning" | "info" | "success" | "secondary" | "tertiary" | undefined;
|
|
269
269
|
variant?: "none" | "outline" | "soft" | "subtle" | "ghost" | undefined;
|
|
270
270
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
271
271
|
};
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const passwordInputVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
root:
|
|
5
|
-
inputWrapper:
|
|
4
|
+
root: "flex flex-col gap-2 w-full",
|
|
5
|
+
inputWrapper: "relative flex items-center w-full",
|
|
6
6
|
toggleBtn: [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
"absolute end-0 inset-y-0 flex items-center justify-center",
|
|
8
|
+
"text-on-surface-variant/75 hover:text-on-surface",
|
|
9
|
+
"focus:outline-none focus-visible:ring-2 rounded-sm",
|
|
10
|
+
"transition-colors select-none",
|
|
11
11
|
],
|
|
12
|
-
toggleIcon:
|
|
13
|
-
meterWrapper:
|
|
14
|
-
meterSegment:
|
|
15
|
-
meterIcon:
|
|
16
|
-
strengthText:
|
|
12
|
+
toggleIcon: "shrink-0",
|
|
13
|
+
meterWrapper: "flex items-center gap-1 w-full mt-1",
|
|
14
|
+
meterSegment: "flex-1 rounded-full transition-colors duration-300",
|
|
15
|
+
meterIcon: "shrink-0 transition-colors duration-300",
|
|
16
|
+
strengthText: "text-xs text-on-surface-variant mt-1 text-right",
|
|
17
17
|
// maskOverlay covers the transparent input text with icon rows.
|
|
18
18
|
// ps-* aligns with the input's own horizontal padding;
|
|
19
19
|
// end-* stops before the toggle button.
|
|
20
20
|
maskOverlay: [
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
"absolute inset-y-0 start-0 flex items-center",
|
|
22
|
+
"gap-0.5 overflow-hidden pointer-events-none select-none",
|
|
23
23
|
],
|
|
24
|
-
maskIconItem:
|
|
24
|
+
maskIconItem: "shrink-0 text-on-surface/80",
|
|
25
25
|
},
|
|
26
26
|
variants: {
|
|
27
27
|
// ==================== SIZE ====================
|
|
28
28
|
size: {
|
|
29
29
|
xs: {
|
|
30
|
-
toggleBtn:
|
|
31
|
-
toggleIcon:
|
|
32
|
-
meterSegment:
|
|
33
|
-
meterIcon:
|
|
34
|
-
maskOverlay:
|
|
35
|
-
maskIconItem:
|
|
30
|
+
toggleBtn: "w-7",
|
|
31
|
+
toggleIcon: "size-3.5",
|
|
32
|
+
meterSegment: "h-1",
|
|
33
|
+
meterIcon: "size-3",
|
|
34
|
+
maskOverlay: "ps-2 end-7",
|
|
35
|
+
maskIconItem: "size-2",
|
|
36
36
|
},
|
|
37
37
|
sm: {
|
|
38
|
-
toggleBtn:
|
|
39
|
-
toggleIcon:
|
|
40
|
-
meterSegment:
|
|
41
|
-
meterIcon:
|
|
42
|
-
maskOverlay:
|
|
43
|
-
maskIconItem:
|
|
38
|
+
toggleBtn: "w-8",
|
|
39
|
+
toggleIcon: "size-4",
|
|
40
|
+
meterSegment: "h-1.5",
|
|
41
|
+
meterIcon: "size-3.5",
|
|
42
|
+
maskOverlay: "ps-2.5 end-8",
|
|
43
|
+
maskIconItem: "size-2.5",
|
|
44
44
|
},
|
|
45
45
|
md: {
|
|
46
|
-
toggleBtn:
|
|
47
|
-
toggleIcon:
|
|
48
|
-
meterSegment:
|
|
49
|
-
meterIcon:
|
|
50
|
-
maskOverlay:
|
|
51
|
-
maskIconItem:
|
|
46
|
+
toggleBtn: "w-9",
|
|
47
|
+
toggleIcon: "size-5",
|
|
48
|
+
meterSegment: "h-1.5",
|
|
49
|
+
meterIcon: "size-4",
|
|
50
|
+
maskOverlay: "ps-3 end-9",
|
|
51
|
+
maskIconItem: "size-3",
|
|
52
52
|
},
|
|
53
53
|
lg: {
|
|
54
|
-
toggleBtn:
|
|
55
|
-
toggleIcon:
|
|
56
|
-
meterSegment:
|
|
57
|
-
meterIcon:
|
|
58
|
-
maskOverlay:
|
|
59
|
-
maskIconItem:
|
|
54
|
+
toggleBtn: "w-10",
|
|
55
|
+
toggleIcon: "size-5",
|
|
56
|
+
meterSegment: "h-2",
|
|
57
|
+
meterIcon: "size-5",
|
|
58
|
+
maskOverlay: "ps-4 end-10",
|
|
59
|
+
maskIconItem: "size-3.5",
|
|
60
60
|
},
|
|
61
61
|
xl: {
|
|
62
|
-
toggleBtn:
|
|
63
|
-
toggleIcon:
|
|
64
|
-
meterSegment:
|
|
65
|
-
meterIcon:
|
|
66
|
-
maskOverlay:
|
|
67
|
-
maskIconItem:
|
|
68
|
-
}
|
|
62
|
+
toggleBtn: "w-12",
|
|
63
|
+
toggleIcon: "size-6",
|
|
64
|
+
meterSegment: "h-2",
|
|
65
|
+
meterIcon: "size-6",
|
|
66
|
+
maskOverlay: "ps-5 end-12",
|
|
67
|
+
maskIconItem: "size-4",
|
|
68
|
+
},
|
|
69
69
|
},
|
|
70
70
|
// ==================== COLOR ====================
|
|
71
71
|
// Controls the toggle button's focus ring color to match the input's color.
|
|
72
72
|
color: {
|
|
73
|
-
primary: { toggleBtn:
|
|
74
|
-
secondary: { toggleBtn:
|
|
75
|
-
tertiary: { toggleBtn:
|
|
76
|
-
success: { toggleBtn:
|
|
77
|
-
warning: { toggleBtn:
|
|
78
|
-
error: { toggleBtn:
|
|
79
|
-
info: { toggleBtn:
|
|
80
|
-
surface: { toggleBtn:
|
|
73
|
+
primary: { toggleBtn: "focus-visible:ring-primary" },
|
|
74
|
+
secondary: { toggleBtn: "focus-visible:ring-secondary" },
|
|
75
|
+
tertiary: { toggleBtn: "focus-visible:ring-tertiary" },
|
|
76
|
+
success: { toggleBtn: "focus-visible:ring-success" },
|
|
77
|
+
warning: { toggleBtn: "focus-visible:ring-warning" },
|
|
78
|
+
error: { toggleBtn: "focus-visible:ring-error" },
|
|
79
|
+
info: { toggleBtn: "focus-visible:ring-info" },
|
|
80
|
+
surface: { toggleBtn: "focus-visible:ring-surface-foreground" },
|
|
81
81
|
},
|
|
82
82
|
// ==================== VARIANT ====================
|
|
83
83
|
// Kept for API symmetry with <Input>; visual differences are handled by
|
|
@@ -88,18 +88,18 @@ export const passwordInputVariants = tv({
|
|
|
88
88
|
soft: {},
|
|
89
89
|
subtle: {},
|
|
90
90
|
ghost: {},
|
|
91
|
-
none: {}
|
|
92
|
-
}
|
|
91
|
+
none: {},
|
|
92
|
+
},
|
|
93
93
|
},
|
|
94
94
|
defaultVariants: {
|
|
95
|
-
size:
|
|
96
|
-
color:
|
|
97
|
-
variant:
|
|
98
|
-
}
|
|
95
|
+
size: "md",
|
|
96
|
+
color: "primary",
|
|
97
|
+
variant: "outline",
|
|
98
|
+
},
|
|
99
99
|
});
|
|
100
100
|
export const passwordInputDefaults = {
|
|
101
101
|
defaultVariants: {
|
|
102
|
-
...passwordInputVariants.defaultVariants
|
|
102
|
+
...passwordInputVariants.defaultVariants,
|
|
103
103
|
},
|
|
104
|
-
slots: {}
|
|
104
|
+
slots: {},
|
|
105
105
|
};
|
|
@@ -5,9 +5,9 @@ let styles = $derived(proseVariants({ size }));
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<div class={twMerge(styles.base() as string, className)} {...restProps}>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
{#if html}
|
|
9
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
10
|
+
{@html html}
|
|
11
|
+
{/if}
|
|
12
|
+
{@render children?.()}
|
|
13
13
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Prose from
|
|
1
|
+
import Prose from "./Prose.svelte";
|
|
2
2
|
export { Prose };
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
3
|
+
export * from "./prose.types.js";
|
|
4
|
+
export * from "./prose.variants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Prose from
|
|
1
|
+
import Prose from "./Prose.svelte";
|
|
2
2
|
export { Prose };
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
3
|
+
export * from "./prose.types.js";
|
|
4
|
+
export * from "./prose.variants.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import type { ProseVariantProps } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { ProseVariantProps } from "./prose.variants.js";
|
|
4
4
|
export interface ProseProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
6
|
* Size of the typography text.
|
|
7
7
|
* @default 'base'
|
|
8
8
|
*/
|
|
9
|
-
size?: ProseVariantProps[
|
|
9
|
+
size?: ProseVariantProps["size"];
|
|
10
10
|
/**
|
|
11
11
|
* Html string to render. Usually coming from a markdown parser.
|
|
12
12
|
*/
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const proseVariants = tv({
|
|
3
3
|
slots: {
|
|
4
4
|
base: [
|
|
5
|
-
|
|
5
|
+
"text-surface-900 dark:text-surface-50 max-w-none",
|
|
6
6
|
// Paragraphs
|
|
7
|
-
|
|
7
|
+
"[&_p]:leading-7 [&_p]:mb-6 [&_p:last-child]:mb-0",
|
|
8
8
|
// Headings
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
"[&_h1]:text-4xl [&_h1]:font-extrabold [&_h1]:tracking-tight [&_h1]:mt-0 [&_h1]:mb-6",
|
|
10
|
+
"[&_h2]:text-3xl [&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:mt-10 [&_h2]:mb-4",
|
|
11
|
+
"[&_h3]:text-2xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3]:mt-8 [&_h3]:mb-4",
|
|
12
|
+
"[&_h4]:text-xl [&_h4]:font-semibold [&_h4]:tracking-tight [&_h4]:mt-8 [&_h4]:mb-4",
|
|
13
13
|
// Links
|
|
14
|
-
|
|
14
|
+
"[&_a]:font-medium [&_a]:text-primary-600 dark:[&_a]:text-primary-400 [&_a]:underline [&_a]:underline-offset-4 hover:[&_a]:text-primary-500",
|
|
15
15
|
// Blockquotes
|
|
16
|
-
|
|
16
|
+
"[&_blockquote]:mt-6 [&_blockquote]:mb-6 [&_blockquote]:border-l-4 [&_blockquote]:border-primary-500 [&_blockquote]:pl-6 [&_blockquote]:italic [&_blockquote]:text-surface-700 dark:[&_blockquote]:text-surface-300",
|
|
17
17
|
// Lists
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"[&_ul]:my-6 [&_ul]:ml-6 [&_ul]:list-disc [&_ul>li]:mt-2",
|
|
19
|
+
"[&_ol]:my-6 [&_ol]:ml-6 [&_ol]:list-decimal [&_ol>li]:mt-2",
|
|
20
20
|
// Code & Pre
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
"[&_code]:relative [&_code]:rounded [&_code]:bg-surface-200 dark:[&_code]:bg-surface-800 [&_code]:px-[0.3rem] [&_code]:py-[0.2rem] [&_code]:font-mono [&_code]:text-sm [&_code]:font-semibold",
|
|
22
|
+
"[&_pre]:mb-6 [&_pre]:mt-6 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-surface-900 [&_pre]:py-4 [&_pre]:dark:bg-surface-800",
|
|
23
|
+
"[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-surface-50 [&_pre_code]:font-normal",
|
|
24
24
|
// Images & Media
|
|
25
|
-
|
|
25
|
+
"[&_img]:rounded-lg [&_img]:border [&_img]:border-outline-variant [&_video]:rounded-lg",
|
|
26
26
|
// Tables
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
"[&_table]:w-full [&_table]:my-6 [&_table]:overflow-y-auto [&_table]:text-left",
|
|
28
|
+
"[&_th]:border [&_th]:border-outline-variant [&_th]:px-4 [&_th]:py-2 [&_th]:font-semibold [&_th]:bg-surface-100 dark:[&_th]:bg-surface-800",
|
|
29
|
+
"[&_td]:border [&_td]:border-outline-variant [&_td]:px-4 [&_td]:py-2",
|
|
30
|
+
"[&_tr:nth-child(even)]:bg-surface-50 dark:[&_tr:nth-child(even)]:bg-surface-900/50",
|
|
31
31
|
// HR
|
|
32
|
-
|
|
33
|
-
]
|
|
32
|
+
"[&_hr]:my-8 [&_hr]:border-outline-variant",
|
|
33
|
+
],
|
|
34
34
|
},
|
|
35
35
|
variants: {
|
|
36
36
|
size: {
|
|
37
|
-
sm: { base:
|
|
38
|
-
base: { base:
|
|
39
|
-
lg: { base:
|
|
40
|
-
}
|
|
37
|
+
sm: { base: "text-sm [&_h1]:text-3xl [&_h2]:text-2xl [&_h3]:text-xl" },
|
|
38
|
+
base: { base: "text-base" },
|
|
39
|
+
lg: { base: "text-lg [&_h1]:text-5xl [&_h2]:text-4xl [&_h3]:text-3xl" },
|
|
40
|
+
},
|
|
41
41
|
},
|
|
42
42
|
defaultVariants: {
|
|
43
|
-
size:
|
|
44
|
-
}
|
|
43
|
+
size: "base",
|
|
44
|
+
},
|
|
45
45
|
});
|
package/dist/components/{Resizable/Resizable.svelte → ResizeContainer/ResizeContainer.svelte}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import { twMerge } from "tailwind-merge";
|
|
2
|
-
import {
|
|
2
|
+
import { resizeContainerVariants } from "./resize-container.variants.js";
|
|
3
3
|
let { direction = "both", class: className, children, ...restProps } = $props();
|
|
4
|
-
let styles = $derived(
|
|
4
|
+
let styles = $derived(resizeContainerVariants({ direction }));
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<div class={twMerge(styles.base(), className)} {...restProps}>
|
|
8
|
-
|
|
8
|
+
{@render children?.()}
|
|
9
9
|
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { ResizeContainerVariantProps } from "./resize-container.variants.js";
|
|
4
|
+
export interface ResizeContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The direction in which the element can be resized.
|
|
7
|
+
* @default 'both'
|
|
8
|
+
*/
|
|
9
|
+
direction?: ResizeContainerVariantProps["direction"];
|
|
10
|
+
/**
|
|
11
|
+
* Additional CSS classes.
|
|
12
|
+
*/
|
|
13
|
+
class?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Content inside the resizable container.
|
|
16
|
+
*/
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const resizeContainerVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
direction: {
|
|
4
|
+
both: "resize";
|
|
5
|
+
horizontal: "resize-x";
|
|
6
|
+
vertical: "resize-y";
|
|
7
|
+
none: "resize-none";
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
base: string;
|
|
11
|
+
}, undefined, {
|
|
12
|
+
direction: {
|
|
13
|
+
both: "resize";
|
|
14
|
+
horizontal: "resize-x";
|
|
15
|
+
vertical: "resize-y";
|
|
16
|
+
none: "resize-none";
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
base: string;
|
|
20
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
21
|
+
direction: {
|
|
22
|
+
both: "resize";
|
|
23
|
+
horizontal: "resize-x";
|
|
24
|
+
vertical: "resize-y";
|
|
25
|
+
none: "resize-none";
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
base: string;
|
|
29
|
+
}>>;
|
|
30
|
+
export type ResizeContainerVariantProps = VariantProps<typeof resizeContainerVariants>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export const resizeContainerVariants = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: "overflow-hidden",
|
|
5
|
+
},
|
|
6
|
+
variants: {
|
|
7
|
+
direction: {
|
|
8
|
+
both: "resize",
|
|
9
|
+
horizontal: "resize-x",
|
|
10
|
+
vertical: "resize-y",
|
|
11
|
+
none: "resize-none",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
direction: "both",
|
|
16
|
+
},
|
|
17
|
+
});
|