@flightlesslabs/dodo-ui 0.20.0 → 0.22.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 +2 -205
- package/dist/components/Form/Button/ButtonAsAnchor.svelte +1 -1
- package/dist/components/Form/DatePicker/DatePicker.scss +0 -26
- package/dist/components/Form/DatePicker/DatePicker.svelte +8 -1
- package/dist/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +3 -1
- package/dist/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +1 -1
- package/dist/components/Form/InputEnclosure/InputEnclosure.scss +34 -0
- package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte +11 -11
- package/dist/components/Form/Label/Label.svelte +1 -1
- package/dist/components/Form/Select/Select.scss +0 -27
- package/dist/components/Form/Select/SelectInput.svelte +4 -1
- package/dist/components/Form/TextInput/TextInput.svelte +3 -3
- package/dist/components/Layout/Card/Card.stories.svelte +1 -2
- package/dist/components/Layout/Card/Card.svelte +1 -1
- package/dist/components/Layout/Card/Card.svelte.d.ts +1 -1
- package/dist/components/Layout/Grid/Column/Column.scss +78 -0
- package/dist/components/Layout/Grid/Column/Column.stories.svelte +66 -0
- package/dist/components/Layout/Grid/Column/Column.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Column/Column.svelte +79 -0
- package/dist/components/Layout/Grid/Column/Column.svelte.d.ts +33 -0
- package/dist/components/Layout/Grid/Grid.scss +8 -0
- package/dist/components/Layout/Grid/Grid.stories.svelte +177 -0
- package/dist/components/Layout/Grid/Grid.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Grid.svelte +32 -0
- package/dist/components/Layout/Grid/Grid.svelte.d.ts +12 -0
- package/dist/components/Layout/Grid/Row/Row.scss +7 -0
- package/dist/components/Layout/Grid/Row/Row.stories.svelte +39 -0
- package/dist/components/Layout/Grid/Row/Row.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Row/Row.svelte +21 -0
- package/dist/components/Layout/Grid/Row/Row.svelte.d.ts +10 -0
- package/dist/components/Layout/Theme/ThemeSystem/index.mdx +53 -53
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/styles/components.css +478 -68
- package/dist/styles/components.css.map +1 -1
- package/dist/styles/components.scss +3 -1
- package/package.json +1 -1
- package/src/lib/components/Form/Button/ButtonAsAnchor.svelte +1 -1
- package/src/lib/components/Form/DatePicker/DatePicker.scss +0 -26
- package/src/lib/components/Form/DatePicker/DatePicker.svelte +8 -1
- package/src/lib/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +3 -1
- package/src/lib/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +1 -1
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.scss +34 -0
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.stories.svelte +11 -11
- package/src/lib/components/Form/Label/Label.svelte +1 -1
- package/src/lib/components/Form/Select/Select.scss +0 -27
- package/src/lib/components/Form/Select/SelectInput.svelte +4 -1
- package/src/lib/components/Form/TextInput/TextInput.svelte +3 -3
- package/src/lib/components/Layout/Card/Card.stories.svelte +1 -2
- package/src/lib/components/Layout/Card/Card.svelte +1 -1
- package/src/lib/components/Layout/Grid/Column/Column.scss +78 -0
- package/src/lib/components/Layout/Grid/Column/Column.stories.svelte +66 -0
- package/src/lib/components/Layout/Grid/Column/Column.svelte +79 -0
- package/src/lib/components/Layout/Grid/Grid.scss +8 -0
- package/src/lib/components/Layout/Grid/Grid.stories.svelte +177 -0
- package/src/lib/components/Layout/Grid/Grid.svelte +32 -0
- package/src/lib/components/Layout/Grid/Row/Row.scss +7 -0
- package/src/lib/components/Layout/Grid/Row/Row.stories.svelte +39 -0
- package/src/lib/components/Layout/Grid/Row/Row.svelte +21 -0
- package/src/lib/components/Layout/Theme/ThemeSystem/index.mdx +53 -53
- package/src/lib/index.ts +17 -0
- package/src/lib/styles/components.scss +3 -1
- package/dist/components/Form/TextInput/TextInput.scss +0 -34
- package/src/lib/components/Form/TextInput/TextInput.scss +0 -34
package/README.md
CHANGED
|
@@ -4,209 +4,6 @@ Opinionated UI framework for Svelte, based on [Bits UI](https://bits-ui.com/)
|
|
|
4
4
|
|
|
5
5
|
[Github](https://github.com/flightlesslabs/dodo-ui) | [npm](https://www.npmjs.com/package/@flightlesslabs/dodo-ui)
|
|
6
6
|
|
|
7
|
-
# Develop
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
1. `pnpm i`
|
|
12
|
-
2. `pnpm dev`
|
|
13
|
-
|
|
14
|
-
## Build app
|
|
15
|
-
|
|
16
|
-
1. `pnpm check`
|
|
17
|
-
2. `pnpm build`
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
# Library Guide
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
# 🧩 Creating a New Component
|
|
26
|
-
|
|
27
|
-
This guide explains how to add a new UI component to the `dodo-ui` library.
|
|
28
|
-
Components are grouped by **category** (e.g. `Form`, `Layout`, `DataDisplay`, etc.).
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Use Scaffolding script
|
|
33
|
-
|
|
34
|
-
### ▶️ Usage
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pnpm create:component Form Checkbox
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
This will generate:
|
|
41
|
-
|
|
42
|
-
```txt
|
|
43
|
-
src/lib/components/Form/Checkbox/
|
|
44
|
-
├── Checkbox.svelte
|
|
45
|
-
├── Checkbox.scss
|
|
46
|
-
└── Checkbox.stories.svelte
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
And auto-append:
|
|
50
|
-
|
|
51
|
-
```scss
|
|
52
|
-
@use '../components/Form/Checkbox/Checkbox.scss';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
to:
|
|
56
|
-
|
|
57
|
-
```txt
|
|
58
|
-
src/lib/styles/components.scss
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## 📁 Folder Structure
|
|
64
|
-
|
|
65
|
-
All components follow this structure:
|
|
66
|
-
|
|
67
|
-
```txt
|
|
68
|
-
components/<Category>/<ComponentName>/
|
|
69
|
-
├── ComponentName.svelte
|
|
70
|
-
├── ComponentName.stories.svelte
|
|
71
|
-
└── ComponentName.scss
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Examples
|
|
75
|
-
|
|
76
|
-
```txt
|
|
77
|
-
components/Form/TextInput/
|
|
78
|
-
components/Form/Button/
|
|
79
|
-
components/Layout/Stack/
|
|
80
|
-
components/Layout/Container/
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
✅ Rules
|
|
84
|
-
|
|
85
|
-
- Use PascalCase for component names
|
|
86
|
-
- ategory names should be PascalCase (e.g. Form, Layout)
|
|
87
|
-
- Folder and file names must match the component name exactly
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## 🎨 Register Component Styles
|
|
92
|
-
|
|
93
|
-
All component styles must be imported into:
|
|
94
|
-
|
|
95
|
-
**styles/components.scss**
|
|
96
|
-
|
|
97
|
-
```scss
|
|
98
|
-
// Form
|
|
99
|
-
@use '../components/Form/Button/Button.scss';
|
|
100
|
-
@use '../components/Form/InputEnclosure/InputEnclosure.scss';
|
|
101
|
-
@use '../components/Form/TextInput/TextInput.scss';
|
|
102
|
-
|
|
103
|
-
// Layout (future example)
|
|
104
|
-
// @use '../components/Layout/Stack/Stack.scss';
|
|
105
|
-
|
|
106
|
-
// Add new components here
|
|
107
|
-
@use '../components/<Category>/<ComponentName>/<ComponentName>.scss';
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
⚠️ If you forget to register the SCSS here, the styles will not be bundled or published.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 🧱 Component Template
|
|
115
|
-
|
|
116
|
-
Replace `ComponentName` and `<Category>` everywhere.
|
|
117
|
-
|
|
118
|
-
ComponentName.svelte
|
|
119
|
-
|
|
120
|
-
```svelte
|
|
121
|
-
<script lang="ts" module>
|
|
122
|
-
import type { Snippet } from 'svelte';
|
|
123
|
-
|
|
124
|
-
export interface ComponentNameProps {
|
|
125
|
-
class?: string;
|
|
126
|
-
disabled?: boolean;
|
|
127
|
-
children?: Snippet;
|
|
128
|
-
}
|
|
129
|
-
</script>
|
|
130
|
-
|
|
131
|
-
<script lang="ts">
|
|
132
|
-
let {
|
|
133
|
-
class: className = '',
|
|
134
|
-
disabled = false,
|
|
135
|
-
children,
|
|
136
|
-
...restProps
|
|
137
|
-
}: ComponentNameProps = $props();
|
|
138
|
-
|
|
139
|
-
const classes = $derived(['dodo-ui-ComponentName', className].filter(Boolean));
|
|
140
|
-
</script>
|
|
141
|
-
|
|
142
|
-
<div class={classes.join(' ')} aria-disabled={disabled} {...restProps}>
|
|
143
|
-
{@render children?.()}
|
|
144
|
-
</div>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
ComponentName.scss
|
|
148
|
-
|
|
149
|
-
```scss
|
|
150
|
-
.dodo-ui-ComponentName {
|
|
151
|
-
display: inline-flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
justify-content: center;
|
|
154
|
-
|
|
155
|
-
font-family: inherit;
|
|
156
|
-
font-size: 1rem;
|
|
157
|
-
|
|
158
|
-
padding: var(--dodo-ui-space-small);
|
|
159
|
-
border-radius: var(--dodo-ui-radius-1);
|
|
160
|
-
|
|
161
|
-
background: var(--dodo-ui-color-surface);
|
|
162
|
-
color: var(--dodo-ui-color-text);
|
|
163
|
-
|
|
164
|
-
&[aria-disabled='true'] {
|
|
165
|
-
opacity: 0.6;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
ComponentName.stories.svelte
|
|
172
|
-
|
|
173
|
-
```svelte
|
|
174
|
-
<script module lang="ts">
|
|
175
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
176
|
-
import ComponentName from './ComponentName.svelte';
|
|
177
|
-
import type { ComponentNameProps } from './ComponentName.svelte';
|
|
178
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
179
|
-
|
|
180
|
-
export const componentNameArgTypes: Partial<ArgTypes<ComponentNameProps>> = {
|
|
181
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
182
|
-
disabled: {
|
|
183
|
-
control: { type: 'boolean' },
|
|
184
|
-
table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const { Story } = defineMeta({
|
|
189
|
-
component: ComponentName,
|
|
190
|
-
tags: ['autodocs'],
|
|
191
|
-
argTypes: componentNameArgTypes,
|
|
192
|
-
});
|
|
193
|
-
</script>
|
|
194
|
-
|
|
195
|
-
<Story name="Default">
|
|
196
|
-
<ComponentName>Default Component</ComponentName>
|
|
197
|
-
</Story>
|
|
198
|
-
|
|
199
|
-
<Story name="Disabled" args={{ disabled: true }}>
|
|
200
|
-
<ComponentName>Disabled Component</ComponentName>
|
|
201
|
-
</Story>
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## ✅ Checklist
|
|
205
|
-
|
|
206
|
-
- [ ] Folder created under correct category
|
|
207
|
-
- [ ] ComponentName.svelte created
|
|
208
|
-
- [ ] ComponentName.scss created
|
|
209
|
-
- [ ] ComponentName.stories.svelte created
|
|
210
|
-
- [ ] SCSS imported into styles/components.scss
|
|
211
|
-
- [ ] Storybook renders correctly
|
|
212
|
-
- [ ] publint passes
|
|
8
|
+
* [Develop](./docs/Develop.md)
|
|
9
|
+
* [Library Guide](./docs/LibraryGuide.md)
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
type WithoutChildren,
|
|
17
17
|
} from 'bits-ui';
|
|
18
18
|
|
|
19
|
-
let { children, ref = $bindable(null),
|
|
19
|
+
let { children, ref = $bindable(null), ...restProps }: ButtonAsAnchorProps = $props();
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<BitsUiButton.Root {...restProps} bind:ref>
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
.dodo-ui-DatePicker {
|
|
4
2
|
button[data-popover-trigger] {
|
|
5
3
|
font-size: 1.4em;
|
|
6
4
|
}
|
|
7
5
|
|
|
8
6
|
[data-date-field-input] {
|
|
9
|
-
flex: 1;
|
|
10
|
-
border: 0;
|
|
11
|
-
outline: 0;
|
|
12
|
-
height: 100%;
|
|
13
|
-
background-color: transparent;
|
|
14
|
-
font-family: inherit;
|
|
15
|
-
color: inherit;
|
|
16
|
-
letter-spacing: 0.3px;
|
|
17
|
-
margin: 0;
|
|
18
7
|
display: flex;
|
|
19
8
|
align-items: center;
|
|
20
9
|
}
|
|
@@ -34,11 +23,6 @@
|
|
|
34
23
|
// ----------------------------------------
|
|
35
24
|
&.size {
|
|
36
25
|
&--normal {
|
|
37
|
-
[data-date-field-input] {
|
|
38
|
-
font-size: 1rem;
|
|
39
|
-
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
26
|
button[data-popover-trigger] {
|
|
43
27
|
margin: 0 calc(var(--dodo-ui-space) / 2.5);
|
|
44
28
|
}
|
|
@@ -49,11 +33,6 @@
|
|
|
49
33
|
}
|
|
50
34
|
|
|
51
35
|
&--small {
|
|
52
|
-
[data-date-field-input] {
|
|
53
|
-
padding: 0 var(--dodo-ui-space);
|
|
54
|
-
font-size: 0.9rem;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
36
|
button[data-popover-trigger] {
|
|
58
37
|
margin: 0 calc(var(--dodo-ui-space--small) / 2.5);
|
|
59
38
|
}
|
|
@@ -64,11 +43,6 @@
|
|
|
64
43
|
}
|
|
65
44
|
|
|
66
45
|
&--large {
|
|
67
|
-
[data-date-field-input] {
|
|
68
|
-
font-size: 1.1rem;
|
|
69
|
-
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
46
|
button[data-popover-trigger] {
|
|
73
47
|
margin: 0 calc(var(--dodo-ui-space--large) / 2.5);
|
|
74
48
|
}
|
|
@@ -109,7 +109,14 @@
|
|
|
109
109
|
}: DatePickerProps = $props();
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
|
-
<DatePickerBitsUi.Root
|
|
112
|
+
<DatePickerBitsUi.Root
|
|
113
|
+
{...restProps}
|
|
114
|
+
bind:value
|
|
115
|
+
bind:open
|
|
116
|
+
{weekdayFormat}
|
|
117
|
+
{weekStartsOn}
|
|
118
|
+
{fixedWeeks}
|
|
119
|
+
>
|
|
113
120
|
<DatepickerInput
|
|
114
121
|
{size}
|
|
115
122
|
{roundness}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
error = false,
|
|
35
35
|
focused: forcedFocused = false,
|
|
36
36
|
placeholder,
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
38
|
after,
|
|
38
39
|
dateFieldInputProps,
|
|
39
40
|
datePickerTriggerProps,
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
isFocused = false;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
const classes = $derived(['dodo-ui-DatePicker',
|
|
55
|
+
const classes = $derived(['dodo-ui-DatePicker', className].filter(Boolean));
|
|
55
56
|
|
|
56
57
|
const triggerClasses = $derived(
|
|
57
58
|
[
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
onfocus={handleFocus}
|
|
79
80
|
onblur={handleBlur}
|
|
80
81
|
{placeholder}
|
|
82
|
+
class="InputBox"
|
|
81
83
|
{...dateFieldInputProps}
|
|
82
84
|
>
|
|
83
85
|
{#snippet children({ segments })}
|
|
@@ -62,6 +62,19 @@ $states: (
|
|
|
62
62
|
border-color: var(--dodo-ui-InputEnclosure-border-color);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// input tag is styled here
|
|
66
|
+
.InputBox {
|
|
67
|
+
flex: 1;
|
|
68
|
+
border: 0;
|
|
69
|
+
outline: 0;
|
|
70
|
+
height: 100%;
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
font-family: inherit;
|
|
73
|
+
color: inherit;
|
|
74
|
+
letter-spacing: 0.3px;
|
|
75
|
+
margin: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
65
78
|
// ----------------------------------------
|
|
66
79
|
// Visual states (focused, error)
|
|
67
80
|
// ----------------------------------------
|
|
@@ -90,6 +103,27 @@ $states: (
|
|
|
90
103
|
height: $height;
|
|
91
104
|
}
|
|
92
105
|
}
|
|
106
|
+
|
|
107
|
+
&--normal {
|
|
108
|
+
.InputBox {
|
|
109
|
+
font-size: 1rem;
|
|
110
|
+
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--small {
|
|
115
|
+
.InputBox {
|
|
116
|
+
padding: 0 var(--dodo-ui-space);
|
|
117
|
+
font-size: 0.9rem;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&--large {
|
|
122
|
+
.InputBox {
|
|
123
|
+
font-size: 1.1rem;
|
|
124
|
+
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
93
127
|
}
|
|
94
128
|
|
|
95
129
|
// ----------------------------------------
|
|
@@ -88,31 +88,31 @@
|
|
|
88
88
|
<!-- ------------------------------ -->
|
|
89
89
|
|
|
90
90
|
<Story name="Default (Outlined)">
|
|
91
|
-
<input placeholder="Type something…" />
|
|
91
|
+
<input placeholder="Type something…" class="InputBox" />
|
|
92
92
|
</Story>
|
|
93
93
|
|
|
94
94
|
<Story name="No Outline" args={{ outline: false }}>
|
|
95
|
-
<input placeholder="No outline…" />
|
|
95
|
+
<input placeholder="No outline…" class="InputBox" />
|
|
96
96
|
</Story>
|
|
97
97
|
|
|
98
98
|
<Story name="Focused" args={{ focused: true }}>
|
|
99
|
-
<input placeholder="Focused state…" />
|
|
99
|
+
<input placeholder="Focused state…" class="InputBox" />
|
|
100
100
|
</Story>
|
|
101
101
|
|
|
102
102
|
<Story name="Error" args={{ error: true }}>
|
|
103
|
-
<input placeholder="Error state…" />
|
|
103
|
+
<input placeholder="Error state…" class="InputBox" />
|
|
104
104
|
</Story>
|
|
105
105
|
|
|
106
106
|
<Story name="Disabled" args={{ disabled: true }}>
|
|
107
|
-
<input placeholder="Disabled state…" disabled />
|
|
107
|
+
<input placeholder="Disabled state…" disabled class="InputBox" />
|
|
108
108
|
</Story>
|
|
109
109
|
|
|
110
110
|
<Story name="Large" args={{ size: 'large' }}>
|
|
111
|
-
<input placeholder="Large input…" />
|
|
111
|
+
<input placeholder="Large input…" class="InputBox" />
|
|
112
112
|
</Story>
|
|
113
113
|
|
|
114
114
|
<Story name="Pill Shape" args={{ roundness: 'pill' }}>
|
|
115
|
-
<input placeholder="Pill shaped input…" />
|
|
115
|
+
<input placeholder="Pill shaped input…" class="InputBox" />
|
|
116
116
|
</Story>
|
|
117
117
|
|
|
118
118
|
<Story name="With Before (Icon Prefix)" asChild>
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<span style="color: #888;">🔍</span>
|
|
122
122
|
{/snippet}
|
|
123
123
|
|
|
124
|
-
<input placeholder="Search…" />
|
|
124
|
+
<input placeholder="Search…" class="InputBox" />
|
|
125
125
|
</InputEnclosure>
|
|
126
126
|
</Story>
|
|
127
127
|
|
|
@@ -131,14 +131,14 @@
|
|
|
131
131
|
<span style="color: #888;">.com</span>
|
|
132
132
|
{/snippet}
|
|
133
133
|
|
|
134
|
-
<input placeholder="Website" />
|
|
134
|
+
<input placeholder="Website" class="InputBox" />
|
|
135
135
|
</InputEnclosure>
|
|
136
136
|
</Story>
|
|
137
137
|
|
|
138
138
|
<Story name="Light Theme" asChild>
|
|
139
139
|
<Theme type="light">
|
|
140
140
|
<InputEnclosure>
|
|
141
|
-
<input placeholder="Type something…" />
|
|
141
|
+
<input placeholder="Type something…" class="InputBox" />
|
|
142
142
|
</InputEnclosure>
|
|
143
143
|
</Theme>
|
|
144
144
|
</Story>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
|
|
147
147
|
<Theme type="dark">
|
|
148
148
|
<InputEnclosure>
|
|
149
|
-
<input placeholder="Type something…" />
|
|
149
|
+
<input placeholder="Type something…" class="InputBox" />
|
|
150
150
|
</InputEnclosure>
|
|
151
151
|
</Theme>
|
|
152
152
|
</Story>
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
const classes = $derived(['dodo-ui-Label', className].filter(Boolean));
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
|
-
<LabelBitUi.Root {...restProps} class=
|
|
32
|
+
<LabelBitUi.Root {...restProps} class={classes.join(' ')} bind:ref>
|
|
33
33
|
{@render children?.()}
|
|
34
34
|
</LabelBitUi.Root>
|
|
@@ -15,50 +15,23 @@
|
|
|
15
15
|
font-size: 1.5em;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
input[data-combobox-input] {
|
|
19
|
-
flex: 1;
|
|
20
|
-
border: 0;
|
|
21
|
-
outline: 0;
|
|
22
|
-
height: 100%;
|
|
23
|
-
background-color: transparent;
|
|
24
|
-
font-family: inherit;
|
|
25
|
-
color: inherit;
|
|
26
|
-
letter-spacing: 0.3px;
|
|
27
|
-
margin: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
18
|
// ----------------------------------------
|
|
31
19
|
// Sizes
|
|
32
20
|
// ----------------------------------------
|
|
33
21
|
&.size {
|
|
34
22
|
&--normal {
|
|
35
|
-
input[data-combobox-input] {
|
|
36
|
-
font-size: 1rem;
|
|
37
|
-
padding: 0 calc(var(--dodo-ui-space-small) * 2);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
23
|
button[data-combobox-trigger] {
|
|
41
24
|
margin: 0 calc(var(--dodo-ui-space) / 2.5);
|
|
42
25
|
}
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
&--small {
|
|
46
|
-
input[data-combobox-input] {
|
|
47
|
-
padding: 0 var(--dodo-ui-space);
|
|
48
|
-
font-size: 0.9rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
29
|
button[data-combobox-trigger] {
|
|
52
30
|
margin: 0 calc(var(--dodo-ui-space--small) / 2.5);
|
|
53
31
|
}
|
|
54
32
|
}
|
|
55
33
|
|
|
56
34
|
&--large {
|
|
57
|
-
input[data-combobox-input] {
|
|
58
|
-
font-size: 1.1rem;
|
|
59
|
-
padding: 0 calc(var(--dodo-ui-space) * 2);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
35
|
button[data-combobox-trigger] {
|
|
63
36
|
margin: 0 calc(var(--dodo-ui-space--large) / 2.5);
|
|
64
37
|
}
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
placeholder,
|
|
41
41
|
comboboxInputProps,
|
|
42
42
|
comboboxTriggerProps,
|
|
43
|
+
// eslint-disable-next-line no-useless-assignment
|
|
43
44
|
searchValue = $bindable<string>(''),
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
46
|
after,
|
|
45
47
|
updateOpenState,
|
|
46
48
|
value,
|
|
@@ -84,6 +86,7 @@
|
|
|
84
86
|
{...restProps}
|
|
85
87
|
>
|
|
86
88
|
<Combobox.Input
|
|
89
|
+
{...comboboxInputProps}
|
|
87
90
|
oninput={(e) => {
|
|
88
91
|
searchValue = e.currentTarget.value;
|
|
89
92
|
}}
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
onclick={!searchable && !disabled ? () => updateOpenState(true) : undefined}
|
|
94
97
|
{placeholder}
|
|
95
98
|
{defaultValue}
|
|
96
|
-
|
|
99
|
+
class="InputBox"
|
|
97
100
|
/>
|
|
98
101
|
|
|
99
102
|
{#snippet after()}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
/**
|
|
116
116
|
* Computed class list for the InputEnclosure component.
|
|
117
117
|
*/
|
|
118
|
-
const classes = $derived(['dodo-ui-TextInput',
|
|
118
|
+
const classes = $derived(['dodo-ui-TextInput', className].filter(Boolean));
|
|
119
119
|
</script>
|
|
120
120
|
|
|
121
121
|
<InputEnclosure
|
|
@@ -125,16 +125,16 @@
|
|
|
125
125
|
{disabled}
|
|
126
126
|
{error}
|
|
127
127
|
focused={forcedFocused || isFocused}
|
|
128
|
-
class={
|
|
128
|
+
class={classes.join(' ')}
|
|
129
129
|
{before}
|
|
130
130
|
{after}
|
|
131
131
|
>
|
|
132
132
|
<input
|
|
133
133
|
{...restProps}
|
|
134
|
-
class={classes.join(' ')}
|
|
135
134
|
bind:this={ref}
|
|
136
135
|
{disabled}
|
|
137
136
|
onfocus={handleFocus}
|
|
138
137
|
onblur={handleBlur}
|
|
138
|
+
class="InputBox"
|
|
139
139
|
/>
|
|
140
140
|
</InputEnclosure>
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import { componentVariantOptions } from '../../../attributes/variant.js';
|
|
7
7
|
import { componentRoundnessOptions } from '../../../attributes/roundness.js';
|
|
8
8
|
import { ComponentShadowOptions } from '../../../attributes/shadow.js';
|
|
9
|
-
import
|
|
10
|
-
import { componentThemeColorsOptions, componentThemeOptions } from '../../../attributes/theme.js';
|
|
9
|
+
import { componentThemeColorsOptions } from '../../../attributes/theme.js';
|
|
11
10
|
|
|
12
11
|
// ------------------------------
|
|
13
12
|
// Storybook ArgTypes
|
|
@@ -25,7 +25,7 @@ export interface CardProps {
|
|
|
25
25
|
outline?: boolean;
|
|
26
26
|
/** Add mouse hover and active effects */
|
|
27
27
|
active?: boolean;
|
|
28
|
-
/** Custom CSS class names applied to the
|
|
28
|
+
/** Custom CSS class names applied to the Card */
|
|
29
29
|
class?: string;
|
|
30
30
|
/** Visual variant (e.g. solid, text) */
|
|
31
31
|
variant?: ComponentVariant;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Grid-Column
|
|
2
|
+
@use '../../../../styles/global/breakpoints' as breakpoints;
|
|
3
|
+
@use 'sass:math';
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
|
|
6
|
+
// ----------------------------------------
|
|
7
|
+
// Config
|
|
8
|
+
// ----------------------------------------
|
|
9
|
+
|
|
10
|
+
$grid-columns: 12;
|
|
11
|
+
|
|
12
|
+
$breakpoint-keys: (default, sm, md, lg, xl, xxl);
|
|
13
|
+
|
|
14
|
+
// ----------------------------------------
|
|
15
|
+
// Function
|
|
16
|
+
// ----------------------------------------
|
|
17
|
+
|
|
18
|
+
@function col($n) {
|
|
19
|
+
@return math.div(100%, $grid-columns) * $n;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ----------------------------------------
|
|
23
|
+
// Column map
|
|
24
|
+
// ----------------------------------------
|
|
25
|
+
|
|
26
|
+
$column-size: ();
|
|
27
|
+
|
|
28
|
+
@for $i from 1 through $grid-columns {
|
|
29
|
+
$column-size: map.set($column-size, $i, col($i));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ----------------------------------------
|
|
33
|
+
// Mixin (core logic)
|
|
34
|
+
// ----------------------------------------
|
|
35
|
+
|
|
36
|
+
@mixin column-styles($bp) {
|
|
37
|
+
@each $name, $size in $column-size {
|
|
38
|
+
&--#{$name} {
|
|
39
|
+
@if $bp == default {
|
|
40
|
+
width: $size;
|
|
41
|
+
flex: initial;
|
|
42
|
+
} @else {
|
|
43
|
+
@include breakpoints.up($bp) {
|
|
44
|
+
width: $size;
|
|
45
|
+
flex: initial;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--flex {
|
|
52
|
+
@if $bp == default {
|
|
53
|
+
flex: 1;
|
|
54
|
+
} @else {
|
|
55
|
+
@include breakpoints.up($bp) {
|
|
56
|
+
flex: 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ----------------------------------------
|
|
63
|
+
// Component
|
|
64
|
+
// ----------------------------------------
|
|
65
|
+
|
|
66
|
+
.dodo-ui-Grid-Column {
|
|
67
|
+
display: block;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
padding: calc(var(--dodo-ui-space) * var(--Grid-gap));
|
|
70
|
+
|
|
71
|
+
&.column-size {
|
|
72
|
+
@each $bp in $breakpoint-keys {
|
|
73
|
+
&--#{$bp} {
|
|
74
|
+
@include column-styles($bp);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|