@vev/silke 1.1.6 → 1.1.7
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/CHANGELOG.md +8 -0
- package/dist/index.js +35 -35
- package/dist/index.js.LEGAL.txt +12 -12
- package/dist/styles.css +4416 -4020
- package/dist/types/components/index.d.ts +3 -2
- package/dist/types/components/silke-button/silke-dropdown-button.d.ts +8 -13
- package/dist/types/components/silke-card/silke-card-grid.d.ts +33 -1
- package/dist/types/components/silke-command-text-field/image-utils.d.ts +20 -0
- package/dist/types/components/silke-command-text-field/index.d.ts +4 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.d.ts +3 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.spec.d.ts +1 -0
- package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +46 -0
- package/dist/types/components/silke-command-text-field/utils.d.ts +61 -0
- package/dist/types/components/silke-command-text-field/utils.spec.d.ts +1 -0
- package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +1 -0
- package/dist/types/components/silke-image/silke-image.d.ts +2 -1
- package/dist/types/components/silke-list/index.d.ts +1 -0
- package/dist/types/components/silke-list/silke-list-item.d.ts +24 -6
- package/dist/types/components/silke-list/silke-list.d.ts +9 -9
- package/dist/types/components/silke-list/types.d.ts +19 -0
- package/dist/types/components/silke-list/utils.d.ts +3 -0
- package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +1 -0
- package/dist/types/components/silke-overflow-menu/silke-overflow-menu.d.ts +6 -1
- package/dist/types/components/silke-popover-native/silke-popover-native.d.ts +3 -1
- package/dist/types/components/silke-shortcut-button/index.d.ts +1 -0
- package/dist/types/components/silke-shortcut-button/silke-shortcut-button.d.ts +15 -0
- package/dist/types/components/silke-tag/silke-tag.d.ts +1 -1
- package/dist/types/icons.d.ts +30 -0
- package/jest.config.js +2 -3
- package/package.json +7 -2
- package/src/_variables.scss +125 -129
- package/src/components/index.ts +3 -2
- package/src/components/silke-action-box/silke-action-box.scss +2 -3
- package/src/components/silke-alert-banner/silke-alert-banner.scss +9 -10
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +2 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -12
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +3 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +63 -44
- package/src/components/silke-box/silke-box.mdx +321 -21
- package/src/components/silke-box/silke-box.scss +5 -5
- package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +147 -9
- package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
- package/src/components/silke-button/silke-big-button.scss +1 -1
- package/src/components/silke-button/silke-button.scss +24 -15
- package/src/components/silke-button/silke-dropdown-button.mdx +67 -0
- package/src/components/silke-button/silke-dropdown-button.tsx +40 -122
- package/src/components/silke-card/silke-card-grid.tsx +5 -3
- package/src/components/silke-card/silke-card.scss +8 -7
- package/src/components/silke-card/silke-card.tsx +7 -1
- package/src/components/silke-checkbox/silke-checkbox.mdx +139 -14
- package/src/components/silke-checkbox/silke-checkbox.scss +11 -11
- package/src/components/silke-color-picker/color-picker.scss +8 -8
- package/src/components/silke-color-swatches/silke-color-swatches.mdx +130 -0
- package/src/components/silke-command-text-field/image-utils.ts +71 -0
- package/src/components/silke-command-text-field/index.ts +12 -0
- package/src/components/silke-command-text-field/silke-command-parser.spec.ts +89 -0
- package/src/components/silke-command-text-field/silke-command-parser.ts +47 -0
- package/src/components/silke-command-text-field/silke-command-text-field.mdx +301 -0
- package/src/components/silke-command-text-field/silke-command-text-field.module.scss +119 -0
- package/src/components/silke-command-text-field/silke-command-text-field.tsx +665 -0
- package/src/components/silke-command-text-field/utils.spec.ts +366 -0
- package/src/components/silke-command-text-field/utils.ts +287 -0
- package/src/components/silke-conditions-input/silke-conditions-input.scss +4 -4
- package/src/components/silke-content-column/silke-content-column.scss +1 -1
- package/src/components/silke-context-menu/silke-context-menu.scss +3 -4
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
- package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -12
- package/src/components/silke-divider/silke-divider.mdx +154 -32
- package/src/components/silke-divider/silke-divider.scss +3 -2
- package/src/components/silke-drawer/silke-drawer.scss +6 -2
- package/src/components/silke-form/silke-form.mdx +254 -27
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -0
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -0
- package/src/components/silke-form-schema/fields/styles.scss +34 -35
- package/src/components/silke-form-schema/silke-schema-fields.tsx +4 -3
- package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +2 -2
- package/src/components/silke-icon/silke-icon.mdx +212 -8
- package/src/components/silke-icon/silke-icon.scss +10 -2
- package/src/components/silke-icon/silke-icon.tsx +1 -0
- package/src/components/silke-icon/silke-stacked-icon.scss +42 -45
- package/src/components/silke-icon-browser/silke-icon-browser.mdx +143 -0
- package/src/components/silke-image/silke-image-color-backdrop.scss +6 -6
- package/src/components/silke-image/silke-image.mdx +189 -41
- package/src/components/silke-image/silke-image.scss +3 -3
- package/src/components/silke-image/silke-image.tsx +14 -1
- package/src/components/silke-link/silke-link.scss +3 -5
- package/src/components/silke-list/index.ts +1 -0
- package/src/components/silke-list/silke-list-item.mdx +83 -0
- package/src/components/silke-list/silke-list-item.scss +119 -0
- package/src/components/silke-list/silke-list-item.tsx +137 -12
- package/src/components/silke-list/silke-list.mdx +108 -13
- package/src/components/silke-list/silke-list.scss +8 -15
- package/src/components/silke-list/silke-list.tsx +63 -9
- package/src/components/silke-list/types.ts +22 -0
- package/src/components/silke-list/utils.ts +24 -0
- package/src/components/silke-loader/silke-loader.mdx +139 -5
- package/src/components/silke-loader/silke-loader.scss +1 -1
- package/src/components/silke-modal/silke-modal.scss +9 -9
- package/src/components/silke-navigation-link/silke-navigation-link.mdx +27 -2
- package/src/components/silke-navigation-link/silke-navigation-link.scss +34 -40
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +7 -6
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +228 -31
- package/src/components/silke-overflow-menu/silke-overflow-menu.scss +8 -8
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +14 -8
- package/src/components/silke-popover/silke-popover.scss +5 -5
- package/src/components/silke-popover-native/silke-popover-native.scss +93 -78
- package/src/components/silke-popover-native/silke-popover-native.tsx +4 -0
- package/src/components/silke-popover-native/use-popover-positioning.ts +1 -3
- package/src/components/silke-progress-indicator/silke-progress-indicator.scss +1 -1
- package/src/components/silke-radio-button/silke-radio-button.scss +18 -11
- package/src/components/silke-search-field/silke-search-field.mdx +161 -7
- package/src/components/silke-shortcut-button/index.ts +1 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.mdx +89 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.scss +145 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.tsx +55 -0
- package/src/components/silke-skeleton/silke-skeleton.mdx +109 -0
- package/src/components/silke-skeleton/silke-skeleton.scss +1 -1
- package/src/components/silke-slider/silke-slider.module.scss +19 -19
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +3 -3
- package/src/components/silke-sortable-list/silke-sortable-list.scss +4 -5
- package/src/components/silke-table/silke-table.scss +1 -1
- package/src/components/silke-tabs/silke-tabs.scss +3 -3
- package/src/components/silke-tag/silke-tag.mdx +179 -43
- package/src/components/silke-tag/silke-tag.scss +49 -12
- package/src/components/silke-tag/silke-tag.tsx +17 -7
- package/src/components/silke-text/silke-text.scss +6 -4
- package/src/components/silke-text/silke-title.scss +7 -14
- package/src/components/silke-text-field/silke-text-field.scss +9 -9
- package/src/components/silke-text-field/silke-text-field.tsx +1 -1
- package/src/components/silke-tile/silke-tile.scss +7 -3
- package/src/components/silke-toast-notification/silke-toast-notification.scss +4 -5
- package/src/components/silke-toggle/silke-toggle.mdx +163 -33
- package/src/components/silke-toggle/silke-toggle.scss +4 -4
- package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
- package/src/components/silke-tooltip/silke-shortcuts.tsx +3 -3
- package/src/components/silke-tooltip/silke-tooltip.scss +11 -16
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +9 -7
- package/src/components/silke-virtual/silke-virtual.mdx +161 -0
- package/src/components/silke-virtual/silke-virtual.scss +8 -8
- package/src/icons.tsx +43 -1
- package/src/styles/core.scss +42 -45
- package/src/styles/math.scss +66 -66
- package/tsconfig.build.json +2 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +3 -14
- package/dist/types/components/silke-action-list/index.d.ts +0 -1
- package/dist/types/components/silke-action-list/silke-action-list.d.ts +0 -11
- package/dist/types/components/silke-list-card/index.d.ts +0 -1
- package/dist/types/components/silke-list-card/silke-list-card.d.ts +0 -14
- package/src/components/silke-action-list/index.ts +0 -1
- package/src/components/silke-action-list/silke-action-list.mdx +0 -48
- package/src/components/silke-action-list/silke-action-list.scss +0 -21
- package/src/components/silke-action-list/silke-action-list.tsx +0 -85
- package/src/components/silke-list-card/index.ts +0 -1
- package/src/components/silke-list-card/silke-list-card.mdx +0 -46
- package/src/components/silke-list-card/silke-list-card.scss +0 -57
- package/src/components/silke-list-card/silke-list-card.tsx +0 -63
|
@@ -1,77 +1,175 @@
|
|
|
1
|
+
# SilkeTag
|
|
2
|
+
|
|
3
|
+
A compact label component for categorization, status indicators, and metadata display. Tags can be interactive with click handlers, removable with close buttons, and support icons.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Color variants**: Yellow, green, red, gray, blue, purple, dark, and AI gradient
|
|
8
|
+
- **Two kinds**: Primary (filled) and secondary (outlined)
|
|
9
|
+
- **Icons**: Add icons or emoji to tags
|
|
10
|
+
- **Removable**: Optional close button with `onRemove` callback
|
|
11
|
+
- **Clickable**: Make tags interactive with `onClick`
|
|
12
|
+
- **Link support**: Navigate with the `link` prop
|
|
13
|
+
- **Size variants**: Base and tiny sizes
|
|
14
|
+
|
|
15
|
+
## Basic Usage
|
|
16
|
+
|
|
1
17
|
```js
|
|
2
|
-
<SilkeBox
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<SilkeTag color={color} label={ipsum.name(10)} onRemove={() => {}} />
|
|
8
|
-
<SilkeTag color={color} label="Disabled" disabled />
|
|
9
|
-
</SilkeBox>
|
|
10
|
-
))}
|
|
18
|
+
<SilkeBox gap="s">
|
|
19
|
+
<SilkeTag label="Default" />
|
|
20
|
+
<SilkeTag label="Green" color="green" />
|
|
21
|
+
<SilkeTag label="Red" color="red" />
|
|
22
|
+
<SilkeTag label="Blue" color="blue" />
|
|
11
23
|
</SilkeBox>
|
|
12
24
|
```
|
|
13
25
|
|
|
14
|
-
##
|
|
26
|
+
## Color Variants
|
|
15
27
|
|
|
16
28
|
```js
|
|
17
|
-
<SilkeBox gap>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<SilkeTag
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<SilkeTag kind="secondary" label="Emoji" icon="😎" />
|
|
29
|
+
<SilkeBox column gap="s">
|
|
30
|
+
<SilkeBox gap="s" wrap>
|
|
31
|
+
{['gray', 'yellow', 'green', 'red', 'blue', 'purple', 'dark', 'ai'].map((color) => (
|
|
32
|
+
<SilkeTag key={color} color={color} label={color} />
|
|
33
|
+
))}
|
|
34
|
+
</SilkeBox>
|
|
24
35
|
</SilkeBox>
|
|
25
36
|
```
|
|
26
37
|
|
|
27
|
-
##
|
|
38
|
+
## Primary vs Secondary
|
|
28
39
|
|
|
29
40
|
```js
|
|
30
|
-
<SilkeBox gap
|
|
31
|
-
<SilkeBox gap
|
|
32
|
-
<SilkeTag label="Primary
|
|
33
|
-
<SilkeTag
|
|
34
|
-
<SilkeTag
|
|
41
|
+
<SilkeBox column gap="s">
|
|
42
|
+
<SilkeBox gap="s">
|
|
43
|
+
<SilkeTag kind="primary" label="Primary" color="blue" />
|
|
44
|
+
<SilkeTag kind="primary" label="Primary" color="green" />
|
|
45
|
+
<SilkeTag kind="primary" label="Primary" color="red" />
|
|
35
46
|
</SilkeBox>
|
|
36
|
-
<SilkeBox gap
|
|
37
|
-
<SilkeTag kind="secondary" label="Secondary
|
|
38
|
-
<SilkeTag kind="secondary"
|
|
39
|
-
<SilkeTag kind="secondary"
|
|
47
|
+
<SilkeBox gap="s">
|
|
48
|
+
<SilkeTag kind="secondary" label="Secondary" color="blue" />
|
|
49
|
+
<SilkeTag kind="secondary" label="Secondary" color="green" />
|
|
50
|
+
<SilkeTag kind="secondary" label="Secondary" color="red" />
|
|
40
51
|
</SilkeBox>
|
|
41
52
|
</SilkeBox>
|
|
42
53
|
```
|
|
43
54
|
|
|
44
|
-
## With
|
|
55
|
+
## With Icons
|
|
45
56
|
|
|
46
57
|
```js
|
|
47
|
-
<SilkeBox gap>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
<SilkeBox gap="s" wrap>
|
|
59
|
+
<SilkeTag label="Settings" icon="settings" />
|
|
60
|
+
<SilkeTag label="User" icon="user" color="blue" />
|
|
61
|
+
<SilkeTag label="Warning" icon="warning.triangle" color="yellow" />
|
|
62
|
+
<SilkeTag label="Success" icon="check" color="green" />
|
|
63
|
+
<SilkeTag label="Error" icon="error" color="red" />
|
|
53
64
|
</SilkeBox>
|
|
54
65
|
```
|
|
55
66
|
|
|
56
67
|
## Icon Only
|
|
57
68
|
|
|
69
|
+
Tags without labels display as compact square icons:
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
<SilkeBox gap="s">
|
|
73
|
+
<SilkeTag icon="star" color="yellow" />
|
|
74
|
+
<SilkeTag icon="check" color="green" />
|
|
75
|
+
<SilkeTag icon="close" color="red" />
|
|
76
|
+
<SilkeTag icon="user" color="blue" />
|
|
77
|
+
<SilkeTag icon="settings" color="gray" />
|
|
78
|
+
</SilkeBox>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Removable Tags
|
|
82
|
+
|
|
83
|
+
Add an `onRemove` callback to show a close button:
|
|
84
|
+
|
|
58
85
|
```js
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
86
|
+
const [tags, setTags] = React.useState(['React', 'TypeScript', 'Node.js', 'CSS']);
|
|
87
|
+
|
|
88
|
+
<SilkeBox gap="s" wrap>
|
|
89
|
+
{tags.map((tag) => (
|
|
90
|
+
<SilkeTag
|
|
91
|
+
key={tag}
|
|
92
|
+
label={tag}
|
|
93
|
+
color="blue"
|
|
94
|
+
onRemove={() => setTags(tags.filter((t) => t !== tag))}
|
|
95
|
+
/>
|
|
64
96
|
))}
|
|
65
|
-
|
|
66
|
-
|
|
97
|
+
</SilkeBox>;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Secondary with Icon and Remove
|
|
101
|
+
|
|
102
|
+
Secondary tags show the remove button as the icon:
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
<SilkeBox gap="s">
|
|
106
|
+
<SilkeTag kind="secondary" label="Removable" icon="star" color="blue" onRemove={() => {}} />
|
|
107
|
+
<SilkeTag kind="secondary" label="Removable" icon="check" color="green" onRemove={() => {}} />
|
|
108
|
+
</SilkeBox>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Sizes
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
<SilkeBox column gap="s">
|
|
115
|
+
<SilkeBox gap="s" vAlign="center">
|
|
116
|
+
<SilkeTag label="Base size" />
|
|
117
|
+
<SilkeTag label="With icon" icon="star" />
|
|
118
|
+
</SilkeBox>
|
|
119
|
+
<SilkeBox gap="s" vAlign="center">
|
|
120
|
+
<SilkeTag size="tiny" label="Tiny size" />
|
|
121
|
+
<SilkeTag size="tiny" label="With icon" icon="star" />
|
|
67
122
|
</SilkeBox>
|
|
68
123
|
</SilkeBox>
|
|
69
124
|
```
|
|
70
125
|
|
|
71
|
-
##
|
|
126
|
+
## Clickable Tags
|
|
127
|
+
|
|
128
|
+
Make tags interactive with `onClick`:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
const [selected, setSelected] = React.useState('react');
|
|
132
|
+
const options = ['react', 'vue', 'angular', 'svelte'];
|
|
133
|
+
|
|
134
|
+
<SilkeBox gap="s">
|
|
135
|
+
{options.map((opt) => (
|
|
136
|
+
<SilkeTag
|
|
137
|
+
key={opt}
|
|
138
|
+
label={opt}
|
|
139
|
+
color={selected === opt ? 'blue' : 'gray'}
|
|
140
|
+
onClick={() => setSelected(opt)}
|
|
141
|
+
/>
|
|
142
|
+
))}
|
|
143
|
+
</SilkeBox>;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Disabled State
|
|
72
147
|
|
|
73
148
|
```js
|
|
74
|
-
<SilkeBox gap>
|
|
149
|
+
<SilkeBox gap="s">
|
|
150
|
+
<SilkeTag label="Enabled" color="blue" />
|
|
151
|
+
<SilkeTag label="Disabled" color="blue" disabled />
|
|
152
|
+
<SilkeTag label="Disabled" color="green" disabled />
|
|
153
|
+
</SilkeBox>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## As Links
|
|
157
|
+
|
|
158
|
+
Navigate to routes using the `link` prop:
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
<SilkeBox gap="s">
|
|
162
|
+
<SilkeTag label="Home" icon="home" link="/" />
|
|
163
|
+
<SilkeTag label="Settings" icon="settings" link="/settings" />
|
|
164
|
+
</SilkeBox>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Shorthand Components
|
|
168
|
+
|
|
169
|
+
Pre-colored tag components for convenience:
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
<SilkeBox gap="s">
|
|
75
173
|
<SilkeTagDark label="Dark" />
|
|
76
174
|
<SilkeTagYellow label="Yellow" />
|
|
77
175
|
<SilkeTagGreen label="Green" />
|
|
@@ -80,3 +178,41 @@
|
|
|
80
178
|
<SilkeTagBlue label="Blue" />
|
|
81
179
|
</SilkeBox>
|
|
82
180
|
```
|
|
181
|
+
|
|
182
|
+
## Props
|
|
183
|
+
|
|
184
|
+
| Prop | Type | Default | Description |
|
|
185
|
+
| ---------- | --------------------------------- | ----------- | ------------------------------------ |
|
|
186
|
+
| `label` | `React.ReactNode` | - | Tag text content |
|
|
187
|
+
| `color` | `SilkeTagColor` | `'gray'` | Tag color variant |
|
|
188
|
+
| `kind` | `'primary' \| 'secondary'` | `'primary'` | Tag style variant |
|
|
189
|
+
| `size` | `'tiny'` | - | Smaller tag size |
|
|
190
|
+
| `icon` | `SilkeIcons` | - | Icon to display |
|
|
191
|
+
| `disabled` | `boolean` | `false` | Disable tag interactions |
|
|
192
|
+
| `link` | `string` | - | Navigate to route on click |
|
|
193
|
+
| `innerGap` | `BoxSpace` | `'xs'` | Gap between icon and label |
|
|
194
|
+
| `onRemove` | `(e: React.MouseEvent) => void` | - | Show close button and handle removal |
|
|
195
|
+
| `onClick` | `(e: React.MouseEvent) => void` | - | Click handler |
|
|
196
|
+
|
|
197
|
+
Also accepts all `SilkeBox` props.
|
|
198
|
+
|
|
199
|
+
## Types
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
type SilkeTagKind = 'primary' | 'secondary';
|
|
203
|
+
|
|
204
|
+
type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark' | 'ai';
|
|
205
|
+
|
|
206
|
+
type SilkeTagSize = 'tiny';
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Shorthand Components
|
|
210
|
+
|
|
211
|
+
| Component | Description |
|
|
212
|
+
| ---------------- | ------------------------ |
|
|
213
|
+
| `SilkeTagDark` | Tag with `color="dark"` |
|
|
214
|
+
| `SilkeTagYellow` | Tag with `color="yellow"`|
|
|
215
|
+
| `SilkeTagGreen` | Tag with `color="green"` |
|
|
216
|
+
| `SilkeTagRed` | Tag with `color="red"` |
|
|
217
|
+
| `SilkeTagGray` | Tag with `color="gray"` |
|
|
218
|
+
| `SilkeTagBlue` | Tag with `color="blue"` |
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
.blue {
|
|
35
35
|
--tag-background: var(--color-accent-20-rgb);
|
|
36
|
-
--tag-outline: var(--color-accent-30-rgb)
|
|
36
|
+
--tag-outline: var(--color-accent-30-rgb);
|
|
37
37
|
--tag-button-background: var(--color-accent-20);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
--tag-button-background: var(--color-neutral-20);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.ai {
|
|
54
|
+
--tag-color: var(--color-neutral-100);
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
.disabled {
|
|
54
58
|
--tag-background: var(--color-neutral-30-rgb);
|
|
55
59
|
--tag-outline: var(--color-neutral-30-rgb);
|
|
@@ -59,7 +63,7 @@
|
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
.tag {
|
|
62
|
-
background
|
|
66
|
+
background: rgba(var(--tag-background), var(--tag-opacity));
|
|
63
67
|
height: var(--tag-height);
|
|
64
68
|
max-height: var(--tag-height);
|
|
65
69
|
min-width: var(--tag-height);
|
|
@@ -68,13 +72,38 @@
|
|
|
68
72
|
border-radius: calc(var(--tag-height) / 2);
|
|
69
73
|
color: var(--tag-color);
|
|
70
74
|
|
|
75
|
+
&.ai,
|
|
76
|
+
&.secondary.ai {
|
|
77
|
+
border: 1px solid rgba(160, 115, 255, 1);
|
|
78
|
+
background: linear-gradient(
|
|
79
|
+
208deg,
|
|
80
|
+
rgba(160, 115, 255, 0.32) 31.76%,
|
|
81
|
+
rgba(1, 220, 205, 0.32) 123.33%
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
71
85
|
&.secondary {
|
|
72
86
|
--tag-icon-color: rgb(var(--tag-background));
|
|
73
87
|
--tag-color: var(--color-neutral-100);
|
|
74
|
-
background
|
|
88
|
+
background: rgb(var(--color-neutral-30-rgb), 0.72);
|
|
75
89
|
border-radius: var(--border-radius-tiny);
|
|
76
90
|
border: none;
|
|
77
91
|
|
|
92
|
+
&.showRemoveAsIcon {
|
|
93
|
+
.removeButton {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:hover {
|
|
98
|
+
.removeButton {
|
|
99
|
+
display: block;
|
|
100
|
+
}
|
|
101
|
+
.tagIcon {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
78
107
|
&.yellow {
|
|
79
108
|
--tag-icon-color: var(--color-warning-30);
|
|
80
109
|
}
|
|
@@ -87,14 +116,14 @@
|
|
|
87
116
|
--tag-icon-color: var(--color-error-40);
|
|
88
117
|
}
|
|
89
118
|
|
|
90
|
-
&.gray{
|
|
119
|
+
&.gray {
|
|
91
120
|
--tag-icon-color: var(--color-neutral-80);
|
|
92
121
|
}
|
|
93
|
-
|
|
122
|
+
|
|
94
123
|
&.blue {
|
|
95
124
|
--tag-icon-color: var(--color-accent-30);
|
|
96
125
|
}
|
|
97
|
-
|
|
126
|
+
|
|
98
127
|
&.dark {
|
|
99
128
|
--tag-icon-color: var(--color-neutral-100);
|
|
100
129
|
}
|
|
@@ -103,17 +132,25 @@
|
|
|
103
132
|
--tag-icon-color: var(--color-support-quaternary-50);
|
|
104
133
|
}
|
|
105
134
|
|
|
106
|
-
|
|
135
|
+
&.ai {
|
|
136
|
+
--tag-icon-color: var(--color-neutral-100);
|
|
137
|
+
}
|
|
107
138
|
}
|
|
108
139
|
|
|
109
140
|
&.selectable {
|
|
110
141
|
cursor: pointer;
|
|
111
142
|
}
|
|
112
143
|
|
|
113
|
-
|
|
114
|
-
|
|
144
|
+
.tagIcon,
|
|
145
|
+
.removeButton {
|
|
115
146
|
width: calc(var(--tag-height) - 8px);
|
|
116
147
|
height: calc(var(--tag-height) - 8px);
|
|
148
|
+
line-height: 12px;
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
button {
|
|
153
|
+
color: var(--tag-color);
|
|
117
154
|
background-color: transparent;
|
|
118
155
|
border: none;
|
|
119
156
|
outline: none;
|
|
@@ -122,7 +159,7 @@
|
|
|
122
159
|
margin: 0;
|
|
123
160
|
cursor: pointer;
|
|
124
161
|
&:hover {
|
|
125
|
-
background
|
|
162
|
+
background: var(--tag-button-background);
|
|
126
163
|
}
|
|
127
164
|
}
|
|
128
165
|
.label {
|
|
@@ -144,8 +181,8 @@
|
|
|
144
181
|
padding: 0 4px;
|
|
145
182
|
font-size: 12px;
|
|
146
183
|
}
|
|
147
|
-
.tagIcon{
|
|
148
|
-
font-size:12px;
|
|
184
|
+
.tagIcon {
|
|
185
|
+
font-size: 12px;
|
|
149
186
|
}
|
|
150
187
|
|
|
151
188
|
&.tiny .disabled {
|
|
@@ -6,7 +6,7 @@ import styles from './silke-tag.scss';
|
|
|
6
6
|
|
|
7
7
|
export type SilkeTagKind = 'primary' | 'secondary';
|
|
8
8
|
|
|
9
|
-
export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark';
|
|
9
|
+
export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark' | 'ai';
|
|
10
10
|
|
|
11
11
|
export type SilkeTagSize = 'tiny';
|
|
12
12
|
|
|
@@ -53,6 +53,15 @@ function SilkeTagComp(
|
|
|
53
53
|
|
|
54
54
|
const iconOnly = !!icon && !label;
|
|
55
55
|
|
|
56
|
+
const showRemoveAsIcon = !!icon && kind === 'secondary' && onRemove;
|
|
57
|
+
if (showRemoveAsIcon) cl.push(styles.showRemoveAsIcon);
|
|
58
|
+
|
|
59
|
+
const removeButton = !disabled && onRemove && (
|
|
60
|
+
<SilkeBox className={styles.removeButton} tag="button" align="center" onMouseDown={onRemove}>
|
|
61
|
+
<SilkeIcon icon="close" />
|
|
62
|
+
</SilkeBox>
|
|
63
|
+
);
|
|
64
|
+
|
|
56
65
|
return (
|
|
57
66
|
<SilkeBox
|
|
58
67
|
{...(rest as any)}
|
|
@@ -66,15 +75,16 @@ function SilkeTagComp(
|
|
|
66
75
|
>
|
|
67
76
|
<SilkeText overflow flex className={styles.label}>
|
|
68
77
|
<SilkeBox gap={innerGap} align="center">
|
|
69
|
-
{
|
|
78
|
+
{showRemoveAsIcon && removeButton}
|
|
79
|
+
{icon && (
|
|
80
|
+
<SilkeBox className={styles.tagIcon} align="center">
|
|
81
|
+
<SilkeIcon icon={icon} />
|
|
82
|
+
</SilkeBox>
|
|
83
|
+
)}
|
|
70
84
|
{label && <span>{label}</span>}
|
|
71
85
|
</SilkeBox>
|
|
72
86
|
</SilkeText>
|
|
73
|
-
{!
|
|
74
|
-
<SilkeBox tag="button" vAlign="center" hAlign="center" onMouseDown={onRemove}>
|
|
75
|
-
<SilkeIcon icon="close" />
|
|
76
|
-
</SilkeBox>
|
|
77
|
-
)}
|
|
87
|
+
{!showRemoveAsIcon && removeButton}
|
|
78
88
|
</SilkeBox>
|
|
79
89
|
);
|
|
80
90
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
3
|
-
@import
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
@use '../../variables' as *;
|
|
3
|
+
@import '../../../src/styles/core';
|
|
4
4
|
|
|
5
|
-
$weights:
|
|
5
|
+
$weights:
|
|
6
|
+
'strong' 600,
|
|
7
|
+
'light' 200;
|
|
6
8
|
|
|
7
9
|
.text {
|
|
8
10
|
--font-size: 14px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
:root{
|
|
1
|
+
:root {
|
|
2
2
|
--silke-title-xxs: 14px;
|
|
3
3
|
--silke-title-xs: 16px;
|
|
4
4
|
--silke-title-s: 24px;
|
|
@@ -14,43 +14,36 @@
|
|
|
14
14
|
--silke-title-xl-line-height: 64px;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.title{
|
|
17
|
+
.title {
|
|
18
18
|
&.xl {
|
|
19
|
-
|
|
20
19
|
font-size: var(--silke-title-xl);
|
|
21
20
|
line-height: var(--silke-title-xl-line-height);
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
|
|
25
23
|
&.l {
|
|
26
24
|
font-size: var(--silke-title-l);
|
|
27
25
|
line-height: var(--silke-title-l-line-height);
|
|
28
26
|
}
|
|
29
|
-
|
|
27
|
+
|
|
30
28
|
&.m {
|
|
31
|
-
|
|
32
29
|
font-size: var(--silke-title-m);
|
|
33
30
|
line-height: var(--silke-title-m-line-height);
|
|
34
31
|
}
|
|
35
|
-
|
|
32
|
+
|
|
36
33
|
&.s {
|
|
37
|
-
|
|
38
34
|
font-size: var(--silke-title-s);
|
|
39
35
|
line-height: var(--silke-title-s-line-height);
|
|
40
36
|
}
|
|
41
|
-
|
|
37
|
+
|
|
42
38
|
&.xs {
|
|
43
39
|
font-size: var(--silke-title-xs);
|
|
44
40
|
line-height: var(--silke-title-xs-line-height);
|
|
45
41
|
letter-spacing: var(--silke-title-xs-letter-spacing);
|
|
46
42
|
}
|
|
47
|
-
|
|
43
|
+
|
|
48
44
|
&.xxs {
|
|
49
45
|
font-size: var(--silke-title-xxs);
|
|
50
46
|
line-height: var(--silke-title-xxs-line-height);
|
|
51
47
|
letter-spacing: var(--silke-title-xxs-letter-spacing);
|
|
52
48
|
}
|
|
53
|
-
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../variables' as *;
|
|
2
2
|
|
|
3
3
|
.wrapper {
|
|
4
4
|
position: relative;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--text-field-border-radius: var(--border-radius-small);
|
|
29
29
|
--text-field-label-weight: 600;
|
|
30
30
|
|
|
31
|
-
----current-border-color:transparent;
|
|
31
|
+
----current-border-color: transparent;
|
|
32
32
|
|
|
33
33
|
width: 100%;
|
|
34
34
|
min-width: 0;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
// --text-field-border-color: transparent;
|
|
45
45
|
// --text-field-hover-border-color: var(--color-neutral-20);
|
|
46
46
|
// --text-field-focus-border-color: var(--color-accent-30);
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
/** True ghost field code but Betsy wanted to tweak more on design */
|
|
49
49
|
--text-field-bg: transparent;
|
|
50
50
|
--text-field-hover-bg: transparent;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
.input::placeholder {
|
|
86
86
|
color: var(--text-field-disabled-placeholder-color);
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
89
|
|
|
90
90
|
&:not(.disabled):hover {
|
|
91
91
|
.field {
|
|
@@ -115,9 +115,9 @@
|
|
|
115
115
|
background-color: var(--text-field-bg);
|
|
116
116
|
border-radius: var(--text-field-border-radius);
|
|
117
117
|
transition: color 80ms;
|
|
118
|
-
|
|
119
|
-
&::after{
|
|
120
|
-
content:
|
|
118
|
+
|
|
119
|
+
&::after {
|
|
120
|
+
content: '';
|
|
121
121
|
display: block;
|
|
122
122
|
position: absolute;
|
|
123
123
|
inset: 0 0 0 0;
|
|
@@ -202,7 +202,7 @@ textarea {
|
|
|
202
202
|
white-space: pre-line;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
.itemBefore ~ .input,
|
|
205
|
+
.itemBefore ~ .input,
|
|
206
|
+
.itemBefore ~ [data-input] {
|
|
206
207
|
padding: 0;
|
|
207
208
|
}
|
|
208
|
-
|
|
@@ -127,7 +127,7 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
const inputStyle = rest.style
|
|
130
|
+
const inputStyle = { ...rest.style };
|
|
131
131
|
if (width) inputStyle.width = width;
|
|
132
132
|
|
|
133
133
|
const maxLengthHelp =
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../variables' as *;
|
|
2
2
|
$focus-border-width: 2px;
|
|
3
|
-
$widths:
|
|
3
|
+
$widths:
|
|
4
|
+
'tiny' 256px,
|
|
5
|
+
'small' 512px,
|
|
6
|
+
'medium' 768px,
|
|
7
|
+
'large' 1024px;
|
|
4
8
|
|
|
5
|
-
body{
|
|
9
|
+
body {
|
|
6
10
|
--tile-background: var(--color-neutral-5);
|
|
7
11
|
--tile-background-hover: rgba(var(--color-neutral-5-rgb), 0.32);
|
|
8
12
|
--tile-background-active: rgba(var(--color-neutral-5-rgb), 0.08);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
@use
|
|
2
|
-
|
|
1
|
+
@use '../../variables' as *;
|
|
3
2
|
|
|
4
3
|
.notificationBox {
|
|
5
4
|
--notification-background: var(--color-neutral-0);
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
color: var(--color-neutral-100);
|
|
12
11
|
border: 1px solid var(--notification-border);
|
|
13
12
|
max-width: 1096px;
|
|
14
|
-
|
|
13
|
+
|
|
15
14
|
&:not(.fluid) {
|
|
16
15
|
width: 320px;
|
|
17
16
|
}
|
|
@@ -90,7 +89,7 @@
|
|
|
90
89
|
|
|
91
90
|
.scale {
|
|
92
91
|
opacity: 0;
|
|
93
|
-
animation: scale 250ms 300ms cubic-bezier(.45
|
|
92
|
+
animation: scale 250ms 300ms cubic-bezier(0.45, 0.65, 0.62, 0.99) forwards;
|
|
94
93
|
transform-origin: center center;
|
|
95
94
|
}
|
|
96
95
|
|
|
@@ -106,5 +105,5 @@
|
|
|
106
105
|
100% {
|
|
107
106
|
opacity: 1;
|
|
108
107
|
transform: scale(1);
|
|
109
|
-
|
|
108
|
+
}
|
|
110
109
|
}
|