@flightlesslabs/dodo-ui 0.22.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Home.mdx +25 -36
- package/dist/components/Form/Button/Button.stories.svelte +33 -23
- package/dist/components/Form/Button/Button.svelte +0 -25
- package/dist/components/Form/Button/Button.svelte.d.ts +0 -16
- package/dist/components/Form/Checkbox/Checkbox.stories.svelte +25 -16
- package/dist/components/Form/Checkbox/Checkbox.svelte +0 -3
- package/dist/components/Form/DatePicker/DatePicker.stories.svelte +26 -2
- package/dist/components/Form/DatePicker/DatePickerPopup/DatePickerPopup.svelte +1 -1
- package/dist/components/Form/FormField/FormField.stories.svelte +15 -10
- package/dist/components/Form/FormField/FormField.svelte +0 -3
- package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte +21 -7
- package/dist/components/Form/InputEnclosure/InputEnclosure.svelte +0 -21
- package/dist/components/Form/InputEnclosure/InputEnclosure.svelte.d.ts +0 -12
- package/dist/components/Form/Select/Select.stories.svelte +18 -3
- package/dist/components/Form/Select/Select.svelte +0 -6
- package/dist/components/Form/Select/Select.svelte.d.ts +0 -6
- package/dist/components/Form/Switch/Switch.stories.svelte +17 -8
- package/dist/components/Form/TextInput/TextInput.stories.svelte +19 -16
- package/dist/components/Form/TextInput/TextInput.svelte +0 -3
- package/dist/components/Form/UtilityButton/UtilityButton.stories.svelte +42 -33
- package/dist/components/Form/UtilityButton/UtilityButton.svelte +0 -36
- package/dist/components/Form/UtilityButton/UtilityButton.svelte.d.ts +0 -27
- package/dist/components/Info/Calendar/Calendar.scss +20 -10
- package/dist/components/Info/Calendar/Calendar.stories.svelte +22 -1
- package/dist/components/Layout/Card/Card.stories.svelte +17 -2
- package/dist/components/Layout/Grid/Grid.stories.svelte +15 -0
- package/dist/components/Layout/Theme/Theme.stories.svelte +16 -2
- package/dist/components/Layout/Theme/ThemeSystem/index.mdx +8 -26
- package/dist/styles/components.css +13 -6
- package/dist/styles/components.css.map +1 -1
- package/dist/utils/time/date-creator/createDate/createDate.mdx +13 -38
- package/dist/utils/time/date-creator/createDateFactory/createDateFactory.mdx +11 -34
- package/dist/utils/time/timeout/timeout.mdx +19 -39
- package/package.json +1 -1
- package/src/lib/Home.mdx +25 -36
- package/src/lib/components/Form/Button/Button.stories.svelte +33 -23
- package/src/lib/components/Form/Button/Button.svelte +0 -25
- package/src/lib/components/Form/Checkbox/Checkbox.stories.svelte +25 -16
- package/src/lib/components/Form/Checkbox/Checkbox.svelte +0 -3
- package/src/lib/components/Form/DatePicker/DatePicker.stories.svelte +26 -2
- package/src/lib/components/Form/DatePicker/DatePickerPopup/DatePickerPopup.svelte +1 -1
- package/src/lib/components/Form/FormField/FormField.stories.svelte +15 -10
- package/src/lib/components/Form/FormField/FormField.svelte +0 -3
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.stories.svelte +21 -7
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.svelte +0 -21
- package/src/lib/components/Form/Select/Select.stories.svelte +18 -3
- package/src/lib/components/Form/Select/Select.svelte +0 -6
- package/src/lib/components/Form/Switch/Switch.stories.svelte +17 -8
- package/src/lib/components/Form/TextInput/TextInput.stories.svelte +19 -16
- package/src/lib/components/Form/TextInput/TextInput.svelte +0 -3
- package/src/lib/components/Form/UtilityButton/UtilityButton.stories.svelte +42 -33
- package/src/lib/components/Form/UtilityButton/UtilityButton.svelte +0 -36
- package/src/lib/components/Info/Calendar/Calendar.scss +20 -10
- package/src/lib/components/Info/Calendar/Calendar.stories.svelte +22 -1
- package/src/lib/components/Layout/Card/Card.stories.svelte +17 -2
- package/src/lib/components/Layout/Grid/Grid.stories.svelte +15 -0
- package/src/lib/components/Layout/Theme/Theme.stories.svelte +16 -2
- package/src/lib/components/Layout/Theme/ThemeSystem/index.mdx +8 -26
- package/src/lib/utils/time/date-creator/createDate/createDate.mdx +13 -38
- package/src/lib/utils/time/date-creator/createDateFactory/createDateFactory.mdx +11 -34
- package/src/lib/utils/time/timeout/timeout.mdx +19 -39
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
import { componentVariantOptions } from '$lib/attributes/variant.js';
|
|
11
11
|
|
|
12
|
+
const description = `
|
|
13
|
+
A simple Checkbox component based on bits-ui [checkbox](https://bits-ui.com/docs/components/checkbox).
|
|
14
|
+
|
|
15
|
+
\`\`\`ts
|
|
16
|
+
import { Checkbox } from '@flightlesslabs/dodo-ui';
|
|
17
|
+
\`\`\`
|
|
18
|
+
`;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Storybook controls for Checkbox
|
|
14
22
|
*/
|
|
@@ -62,6 +70,13 @@
|
|
|
62
70
|
component: Checkbox,
|
|
63
71
|
tags: ['autodocs'],
|
|
64
72
|
argTypes: CheckboxArgTypes,
|
|
73
|
+
parameters: {
|
|
74
|
+
docs: {
|
|
75
|
+
description: {
|
|
76
|
+
component: description,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
65
80
|
});
|
|
66
81
|
|
|
67
82
|
let myValue = $state<boolean>(true);
|
|
@@ -73,18 +88,10 @@
|
|
|
73
88
|
|
|
74
89
|
<Story name="Default" args={{ id: 'Default' }}>Check this text</Story>
|
|
75
90
|
|
|
76
|
-
<Story name="
|
|
91
|
+
<Story name="Controlled" asChild>
|
|
77
92
|
<Checkbox id="Checked" bind:checked={myValue}>Check this text</Checkbox>
|
|
78
93
|
</Story>
|
|
79
94
|
|
|
80
|
-
<Story name="Solid" args={{ id: 'Solid', variant: 'solid', checked: true }}>Check this text</Story>
|
|
81
|
-
|
|
82
|
-
<Story name="NoOutline" args={{ id: 'Outline', outline: false }}>Check this text</Story>
|
|
83
|
-
|
|
84
|
-
<Story name="Indeterminate" args={{ id: 'indeterminate', indeterminate: true }}>
|
|
85
|
-
Check this text
|
|
86
|
-
</Story>
|
|
87
|
-
|
|
88
95
|
<Story
|
|
89
96
|
name="OnChange (Actions)"
|
|
90
97
|
args={{
|
|
@@ -98,17 +105,19 @@
|
|
|
98
105
|
Check this text
|
|
99
106
|
</Story>
|
|
100
107
|
|
|
101
|
-
<Story name="
|
|
108
|
+
<Story name="Indeterminate" args={{ id: 'indeterminate', indeterminate: true }}>
|
|
109
|
+
Check this text
|
|
110
|
+
</Story>
|
|
102
111
|
|
|
103
|
-
<Story name="
|
|
112
|
+
<Story name="Color" args={{ id: 'Safe', color: 'safe' }}>Check this text</Story>
|
|
104
113
|
|
|
105
|
-
<Story name="
|
|
114
|
+
<Story name="Solid" args={{ id: 'Solid', variant: 'solid', checked: true }}>Check this text</Story>
|
|
106
115
|
|
|
107
|
-
<Story name="
|
|
116
|
+
<Story name="NoOutline" args={{ id: 'Outline', outline: false }}>Check this text</Story>
|
|
108
117
|
|
|
109
|
-
<Story name="
|
|
110
|
-
|
|
111
|
-
</Story>
|
|
118
|
+
<Story name="Size" args={{ id: 'Size', size: 'large' }}>Check this text</Story>
|
|
119
|
+
|
|
120
|
+
<Story name="Disabled" args={{ disabled: true }}>Check this text</Story>
|
|
112
121
|
|
|
113
122
|
<Story name="Light Theme" asChild>
|
|
114
123
|
<Theme type="light">
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
import { CalendarDate, type DateValue } from '@internationalized/date';
|
|
10
10
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
11
11
|
|
|
12
|
+
const description = `
|
|
13
|
+
A sleek, plug and play Date Picker based on bits-ui [date-picker](https://bits-ui.com/docs/components/date-picker).
|
|
14
|
+
\`\`\`ts
|
|
15
|
+
import { DatePicker } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
|
|
17
|
+
import { CalendarDate, type DateValue } from '@internationalized/date';
|
|
18
|
+
\`\`\`
|
|
19
|
+
`;
|
|
20
|
+
|
|
12
21
|
// ------------------------------
|
|
13
22
|
// Storybook ArgTypes
|
|
14
23
|
// ------------------------------
|
|
@@ -86,6 +95,14 @@
|
|
|
86
95
|
component: DatePicker,
|
|
87
96
|
tags: ['autodocs'],
|
|
88
97
|
argTypes: storyDatePickerArgTypes,
|
|
98
|
+
parameters: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: {
|
|
101
|
+
component: description,
|
|
102
|
+
},
|
|
103
|
+
story: { height: '420px' },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
89
106
|
});
|
|
90
107
|
|
|
91
108
|
let myValue = $state<DateValue>(new CalendarDate(2026, 4, 7));
|
|
@@ -97,11 +114,18 @@
|
|
|
97
114
|
|
|
98
115
|
<Story name="Default" />
|
|
99
116
|
|
|
100
|
-
|
|
101
|
-
<Story name="Selected" asChild>
|
|
117
|
+
<Story name="Controlled" asChild>
|
|
102
118
|
<DatePicker bind:value={myValue} />
|
|
103
119
|
</Story>
|
|
104
120
|
|
|
121
|
+
<Story name="Starts On Sunday" args={{ weekStartsOn: 0 }} />
|
|
122
|
+
|
|
123
|
+
<Story name="Date Format" args={{ dateFormat: 'mm/dd/yyyy' }} />
|
|
124
|
+
|
|
125
|
+
<Story name="Min Date" args={{ minValue: new CalendarDate(2026, 4, 7) }} />
|
|
126
|
+
|
|
127
|
+
<Story name="Max Date" args={{ maxValue: new CalendarDate(2026, 4, 7) }} />
|
|
128
|
+
|
|
105
129
|
<Story name="Light Theme" asChild>
|
|
106
130
|
<Theme type="light">
|
|
107
131
|
<DatePicker />
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
6
|
import TextInput from '../TextInput/TextInput.svelte';
|
|
7
7
|
|
|
8
|
+
const description = `
|
|
9
|
+
a form control for input tags and more.
|
|
10
|
+
\`\`\`ts
|
|
11
|
+
import { FormField } from '@flightlesslabs/dodo-ui';
|
|
12
|
+
\`\`\`
|
|
13
|
+
`;
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* Storybook controls for FormField
|
|
10
17
|
*/
|
|
@@ -22,6 +29,13 @@
|
|
|
22
29
|
component: FormField,
|
|
23
30
|
tags: ['autodocs'],
|
|
24
31
|
argTypes: FormFieldArgTypes,
|
|
32
|
+
parameters: {
|
|
33
|
+
docs: {
|
|
34
|
+
description: {
|
|
35
|
+
component: description,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
25
39
|
});
|
|
26
40
|
</script>
|
|
27
41
|
|
|
@@ -29,15 +43,6 @@
|
|
|
29
43
|
<!-- Stories -->
|
|
30
44
|
<!-- ------------------------------ -->
|
|
31
45
|
|
|
32
|
-
<Story name="
|
|
46
|
+
<Story name="Defualt" args={{ label: 'Name:', for: 'name' }}>
|
|
33
47
|
<TextInput placeholder="Type something…" name="name" />
|
|
34
48
|
</Story>
|
|
35
|
-
|
|
36
|
-
<Story name="CustomLabel" asChild>
|
|
37
|
-
<FormField for="name2">
|
|
38
|
-
{#snippet label()}
|
|
39
|
-
Custom Label
|
|
40
|
-
{/snippet}
|
|
41
|
-
<TextInput placeholder="Type something…" name="name2" />
|
|
42
|
-
</FormField>
|
|
43
|
-
</Story>
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
|
|
11
|
+
const description = `
|
|
12
|
+
An extensive wrappwer for input boxes.
|
|
13
|
+
|
|
14
|
+
\`\`\`ts
|
|
15
|
+
import { InputEnclosure } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
|
|
17
|
+
// apply 'InputBox' class to the input
|
|
18
|
+
<input class="InputBox" />
|
|
19
|
+
\`\`\`
|
|
20
|
+
`;
|
|
21
|
+
|
|
11
22
|
// ------------------------------
|
|
12
23
|
// Storybook ArgTypes
|
|
13
24
|
// ------------------------------
|
|
@@ -80,6 +91,13 @@
|
|
|
80
91
|
component: InputEnclosure,
|
|
81
92
|
tags: ['autodocs'],
|
|
82
93
|
argTypes: storyInputEnclosureArgTypes,
|
|
94
|
+
parameters: {
|
|
95
|
+
docs: {
|
|
96
|
+
description: {
|
|
97
|
+
component: description,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
83
101
|
});
|
|
84
102
|
</script>
|
|
85
103
|
|
|
@@ -87,7 +105,7 @@
|
|
|
87
105
|
<!-- Stories -->
|
|
88
106
|
<!-- ------------------------------ -->
|
|
89
107
|
|
|
90
|
-
<Story name="Default
|
|
108
|
+
<Story name="Default">
|
|
91
109
|
<input placeholder="Type something…" class="InputBox" />
|
|
92
110
|
</Story>
|
|
93
111
|
|
|
@@ -111,14 +129,10 @@
|
|
|
111
129
|
<input placeholder="Large input…" class="InputBox" />
|
|
112
130
|
</Story>
|
|
113
131
|
|
|
114
|
-
<Story name="Pill Shape" args={{ roundness: 'pill' }}>
|
|
115
|
-
<input placeholder="Pill shaped input…" class="InputBox" />
|
|
116
|
-
</Story>
|
|
117
|
-
|
|
118
132
|
<Story name="With Before (Icon Prefix)" asChild>
|
|
119
133
|
<InputEnclosure>
|
|
120
134
|
{#snippet before()}
|
|
121
|
-
<span style="color: #888;">🔍</span>
|
|
135
|
+
<span style="color: #888; padding-left: 8px">🔍</span>
|
|
122
136
|
{/snippet}
|
|
123
137
|
|
|
124
138
|
<input placeholder="Search…" class="InputBox" />
|
|
@@ -128,7 +142,7 @@
|
|
|
128
142
|
<Story name="With After (Suffix Text)" asChild>
|
|
129
143
|
<InputEnclosure>
|
|
130
144
|
{#snippet after()}
|
|
131
|
-
<span style="color: #888;">.com</span>
|
|
145
|
+
<span style="color: #888; padding-right: 8px">.com</span>
|
|
132
146
|
{/snippet}
|
|
133
147
|
|
|
134
148
|
<input placeholder="Website" class="InputBox" />
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Shared base props for the InputEnclosure component.
|
|
7
|
-
*
|
|
8
|
-
* These props apply to the root <div> wrapper that visually encloses
|
|
9
|
-
* form controls such as inputs, selects, or custom fields.
|
|
10
|
-
*/
|
|
11
5
|
interface InputEnclosureBaseProps {
|
|
12
6
|
/** InputEnclosure contents (typically an input or control slot) */
|
|
13
7
|
children?: Snippet;
|
|
@@ -62,12 +56,6 @@
|
|
|
62
56
|
after?: Snippet;
|
|
63
57
|
}
|
|
64
58
|
|
|
65
|
-
/**
|
|
66
|
-
* InputEnclosure component props.
|
|
67
|
-
*
|
|
68
|
-
* Renders a semantic <div> wrapper around form controls.
|
|
69
|
-
* Inherits all native HTML div attributes (e.g. id, style, data-*, aria-*).
|
|
70
|
-
*/
|
|
71
59
|
export type InputEnclosureProps = InputEnclosureBaseProps & HTMLAttributes<HTMLDivElement>;
|
|
72
60
|
</script>
|
|
73
61
|
|
|
@@ -76,12 +64,6 @@
|
|
|
76
64
|
import type { ComponentRoundnessShape } from '$lib/attributes/roundness.js';
|
|
77
65
|
import InputAffix from './InputAffix.svelte';
|
|
78
66
|
|
|
79
|
-
/**
|
|
80
|
-
* InputEnclosure component runtime props.
|
|
81
|
-
*
|
|
82
|
-
* These props are destructured from `$props()` and mapped to
|
|
83
|
-
* CSS utility classes that control visual appearance.
|
|
84
|
-
*/
|
|
85
67
|
let {
|
|
86
68
|
children,
|
|
87
69
|
size = 'normal',
|
|
@@ -97,9 +79,6 @@
|
|
|
97
79
|
...restProps
|
|
98
80
|
}: InputEnclosureProps = $props();
|
|
99
81
|
|
|
100
|
-
/**
|
|
101
|
-
* Computed class list for the InputEnclosure component.
|
|
102
|
-
*/
|
|
103
82
|
const classes = $derived(
|
|
104
83
|
[
|
|
105
84
|
'dodo-ui-InputEnclosure',
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
|
|
11
|
+
const description = `
|
|
12
|
+
A searchable Select component based on bits-ui [combobox](https://bits-ui.com/docs/components/combobox).
|
|
13
|
+
|
|
14
|
+
\`\`\`ts
|
|
15
|
+
import { Select } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
\`\`\`
|
|
17
|
+
`;
|
|
18
|
+
|
|
11
19
|
const options = [
|
|
12
20
|
{ value: 'one', label: 'One' },
|
|
13
21
|
{ value: 'two', label: 'Two' },
|
|
@@ -118,6 +126,13 @@
|
|
|
118
126
|
args: {
|
|
119
127
|
options,
|
|
120
128
|
},
|
|
129
|
+
parameters: {
|
|
130
|
+
docs: {
|
|
131
|
+
description: {
|
|
132
|
+
component: description,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
121
136
|
});
|
|
122
137
|
|
|
123
138
|
let myValue = $state<string | undefined>(options[1].value);
|
|
@@ -131,12 +146,10 @@
|
|
|
131
146
|
|
|
132
147
|
<Story name="Searchable" args={{ searchable: true, placeholder: 'Search a number' }} />
|
|
133
148
|
|
|
134
|
-
<Story name="
|
|
149
|
+
<Story name="Controlled" asChild>
|
|
135
150
|
<Select {options} bind:value={myValue} />
|
|
136
151
|
</Story>
|
|
137
152
|
|
|
138
|
-
<Story name="Disabled" args={{ placeholder: 'Select an option', disabled: true }} />
|
|
139
|
-
|
|
140
153
|
<Story
|
|
141
154
|
name="OnChange (Actions)"
|
|
142
155
|
args={{
|
|
@@ -147,6 +160,8 @@
|
|
|
147
160
|
}}
|
|
148
161
|
/>
|
|
149
162
|
|
|
163
|
+
<Story name="Disabled" args={{ placeholder: 'Select an option', disabled: true }} />
|
|
164
|
+
|
|
150
165
|
<Story name="Light Theme" asChild>
|
|
151
166
|
<Theme type="light">
|
|
152
167
|
<Select {options} />
|
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
label: string;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* Shared base props for the Select component.
|
|
11
|
-
*
|
|
12
|
-
* These props control the visual wrapper (InputEnclosure) and
|
|
13
|
-
* common text-input behaviors.
|
|
14
|
-
*/
|
|
15
9
|
type BaseProps = Omit<ComboboxSingleRootPropsWithoutHTML, 'type'> &
|
|
16
10
|
Omit<SelectSingleRootPropsWithoutHTML, 'type'>;
|
|
17
11
|
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
import { componentVariantOptions } from '$lib/attributes/variant.js';
|
|
11
11
|
|
|
12
|
+
const description = `
|
|
13
|
+
A Switch/toggle component based on bits-ui [switch](https://bits-ui.com/docs/components/switch).
|
|
14
|
+
|
|
15
|
+
\`\`\`ts
|
|
16
|
+
import { Switch } from '@flightlesslabs/dodo-ui';
|
|
17
|
+
\`\`\`
|
|
18
|
+
`;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Storybook controls for Switch
|
|
14
22
|
*/
|
|
@@ -62,6 +70,13 @@
|
|
|
62
70
|
component: Switch,
|
|
63
71
|
tags: ['autodocs'],
|
|
64
72
|
argTypes: SwitchArgTypes,
|
|
73
|
+
parameters: {
|
|
74
|
+
docs: {
|
|
75
|
+
description: {
|
|
76
|
+
component: description,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
65
80
|
});
|
|
66
81
|
|
|
67
82
|
let myValue = $state<boolean>(true);
|
|
@@ -73,7 +88,7 @@
|
|
|
73
88
|
|
|
74
89
|
<Story name="Default" args={{ id: 'Default' }}>Check this text</Story>
|
|
75
90
|
|
|
76
|
-
<Story name="
|
|
91
|
+
<Story name="Controlled" asChild>
|
|
77
92
|
<Switch id="Checked" bind:checked={myValue}>Check this text</Switch>
|
|
78
93
|
</Story>
|
|
79
94
|
|
|
@@ -94,18 +109,12 @@
|
|
|
94
109
|
Check this text
|
|
95
110
|
</Story>
|
|
96
111
|
|
|
97
|
-
<Story name="
|
|
112
|
+
<Story name="Color" args={{ id: 'Safe', color: 'safe' }}>Check this text</Story>
|
|
98
113
|
|
|
99
114
|
<Story name="Large" args={{ id: 'Large', size: 'large' }}>Check this text</Story>
|
|
100
115
|
|
|
101
116
|
<Story name="Disabled" args={{ disabled: true }}>Check this text</Story>
|
|
102
117
|
|
|
103
|
-
<Story name="Safe" args={{ id: 'Safe', color: 'safe' }}>Check this text</Story>
|
|
104
|
-
|
|
105
|
-
<Story name="Danger / Outline" args={{ id: 'Danger-Outline', color: 'danger' }}>
|
|
106
|
-
Check this text
|
|
107
|
-
</Story>
|
|
108
|
-
|
|
109
118
|
<Story name="Light Theme" asChild>
|
|
110
119
|
<Theme type="light">
|
|
111
120
|
<Switch id="Light_Theme">Check this text</Switch>
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
|
|
11
|
+
const description = `
|
|
12
|
+
Input box with powers ⚡
|
|
13
|
+
|
|
14
|
+
\`\`\`ts
|
|
15
|
+
import { TextInput } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
\`\`\`
|
|
17
|
+
`;
|
|
18
|
+
|
|
11
19
|
// ------------------------------
|
|
12
20
|
// Storybook ArgTypes
|
|
13
21
|
// ------------------------------
|
|
@@ -99,6 +107,13 @@
|
|
|
99
107
|
component: TextInput,
|
|
100
108
|
tags: ['autodocs'],
|
|
101
109
|
argTypes: storyTextInputArgTypes,
|
|
110
|
+
parameters: {
|
|
111
|
+
docs: {
|
|
112
|
+
description: {
|
|
113
|
+
component: description,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
102
117
|
});
|
|
103
118
|
</script>
|
|
104
119
|
|
|
@@ -112,16 +127,16 @@
|
|
|
112
127
|
|
|
113
128
|
<Story name="Error" args={{ placeholder: 'Error state…', error: true }} />
|
|
114
129
|
|
|
115
|
-
<Story name="Disabled" args={{ placeholder: 'Disabled state…', disabled: true }} />
|
|
116
|
-
|
|
117
130
|
<Story name="Large" args={{ placeholder: 'Type something…', size: 'large' }} />
|
|
118
131
|
|
|
119
132
|
<Story name="Pill Shape" args={{ placeholder: 'Type something…', roundness: 'pill' }} />
|
|
120
133
|
|
|
134
|
+
<Story name="Disabled" args={{ placeholder: 'Disabled state…', disabled: true }} />
|
|
135
|
+
|
|
121
136
|
<Story name="With Before (Prefix Icon)" asChild>
|
|
122
137
|
<TextInput placeholder="Search…">
|
|
123
138
|
{#snippet before()}
|
|
124
|
-
<span style="color: #888;">🔍</span>
|
|
139
|
+
<span style="color: #888; padding-left: 8px">🔍</span>
|
|
125
140
|
{/snippet}
|
|
126
141
|
</TextInput>
|
|
127
142
|
</Story>
|
|
@@ -129,19 +144,7 @@
|
|
|
129
144
|
<Story name="With After (Suffix Text)" asChild>
|
|
130
145
|
<TextInput placeholder="Website">
|
|
131
146
|
{#snippet after()}
|
|
132
|
-
<span style="color: #888;">.com</span>
|
|
133
|
-
{/snippet}
|
|
134
|
-
</TextInput>
|
|
135
|
-
</Story>
|
|
136
|
-
|
|
137
|
-
<Story name="With Before + After" asChild>
|
|
138
|
-
<TextInput placeholder="Amount">
|
|
139
|
-
{#snippet before()}
|
|
140
|
-
<span style="opacity: 0.6;">$</span>
|
|
141
|
-
{/snippet}
|
|
142
|
-
|
|
143
|
-
{#snippet after()}
|
|
144
|
-
<span style="opacity: 0.6;">USD</span>
|
|
147
|
+
<span style="color: #888; padding-right: 8px">.com</span>
|
|
145
148
|
{/snippet}
|
|
146
149
|
</TextInput>
|
|
147
150
|
</Story>
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
9
9
|
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
10
10
|
|
|
11
|
+
const description = `
|
|
12
|
+
A flexible small sized button component based on bits-ui [button](https://bits-ui.com/docs/components/button).
|
|
13
|
+
|
|
14
|
+
\`\`\`ts
|
|
15
|
+
import { UtilityButton } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
\`\`\`
|
|
17
|
+
`;
|
|
18
|
+
|
|
11
19
|
// ------------------------------
|
|
12
20
|
// Storybook ArgTypes
|
|
13
21
|
// ------------------------------
|
|
@@ -83,6 +91,13 @@
|
|
|
83
91
|
component: UtilityButton,
|
|
84
92
|
tags: ['autodocs'],
|
|
85
93
|
argTypes: storyUtilityButtonArgTypes,
|
|
94
|
+
parameters: {
|
|
95
|
+
docs: {
|
|
96
|
+
description: {
|
|
97
|
+
component: description,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
86
101
|
});
|
|
87
102
|
</script>
|
|
88
103
|
|
|
@@ -90,65 +105,59 @@
|
|
|
90
105
|
<!-- Stories -->
|
|
91
106
|
<!-- ------------------------------ -->
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
<Story name="Primary">Click me!</Story>
|
|
108
|
+
<Story name="Default">Click me!</Story>
|
|
95
109
|
|
|
96
|
-
<Story
|
|
110
|
+
<Story
|
|
111
|
+
name="Link Button"
|
|
112
|
+
args={{
|
|
113
|
+
href: 'https://www.w3schools.com/tags/tag_a.asp',
|
|
114
|
+
target: '_blank',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
Click me!
|
|
118
|
+
</Story>
|
|
97
119
|
|
|
98
120
|
<Story
|
|
99
121
|
name="OnClick (Actions)"
|
|
100
122
|
args={{
|
|
101
123
|
onclick: (e: Event) => {
|
|
102
124
|
const target = e.target as HTMLButtonElement;
|
|
103
|
-
alert('
|
|
104
|
-
console.log('
|
|
125
|
+
alert('Button Clicked');
|
|
126
|
+
console.log('Button Clicked', target);
|
|
105
127
|
},
|
|
106
128
|
}}
|
|
107
129
|
>
|
|
108
130
|
Click me
|
|
109
131
|
</Story>
|
|
110
132
|
|
|
133
|
+
<Story name="Color" args={{ color: 'safe' }}>Click me</Story>
|
|
134
|
+
|
|
111
135
|
<Story name="Outline" args={{ outline: true }}>Click me!</Story>
|
|
112
136
|
|
|
113
|
-
<Story name="
|
|
137
|
+
<Story name="Size" args={{ size: 'large' }}>Click me!</Story>
|
|
114
138
|
|
|
115
139
|
<Story name="Disabled" args={{ disabled: true }}>Click me!</Story>
|
|
116
140
|
|
|
117
|
-
<Story name="
|
|
141
|
+
<Story name="Submit Button" args={{ type: 'submit' }}>Click me!</Story>
|
|
118
142
|
|
|
119
|
-
<Story
|
|
143
|
+
<Story
|
|
144
|
+
name="Compact"
|
|
145
|
+
args={{
|
|
146
|
+
compact: true,
|
|
147
|
+
'aria-label': 'Add item',
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
+
|
|
151
|
+
</Story>
|
|
120
152
|
|
|
121
153
|
<Story name="Light Theme" asChild>
|
|
122
154
|
<Theme type="light">
|
|
123
|
-
<UtilityButton>
|
|
155
|
+
<UtilityButton>Click me!</UtilityButton>
|
|
124
156
|
</Theme>
|
|
125
157
|
</Story>
|
|
126
158
|
|
|
127
159
|
<Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
|
|
128
160
|
<Theme type="dark">
|
|
129
|
-
<UtilityButton>
|
|
161
|
+
<UtilityButton>Click me!</UtilityButton>
|
|
130
162
|
</Theme>
|
|
131
163
|
</Story>
|
|
132
|
-
|
|
133
|
-
<Story name="Submit UtilityButton" args={{ type: 'submit' }}>Submit Form</Story>
|
|
134
|
-
|
|
135
|
-
<Story
|
|
136
|
-
name="Link UtilityButton"
|
|
137
|
-
args={{
|
|
138
|
-
href: 'https://www.w3schools.com/tags/tag_a.asp',
|
|
139
|
-
target: '_blank',
|
|
140
|
-
}}
|
|
141
|
-
>
|
|
142
|
-
External Link
|
|
143
|
-
</Story>
|
|
144
|
-
|
|
145
|
-
<Story
|
|
146
|
-
name="Icon Only (A11y Example)"
|
|
147
|
-
args={{
|
|
148
|
-
compact: true,
|
|
149
|
-
roundness: 'full',
|
|
150
|
-
'aria-label': 'Add item',
|
|
151
|
-
}}
|
|
152
|
-
>
|
|
153
|
-
+
|
|
154
|
-
</Story>
|