@vev/silke 1.0.27 → 1.0.29
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 +14 -0
- package/dist/index.js +49 -48
- package/dist/silke/src/components/index.d.ts +1 -1
- package/dist/silke/src/components/silke-autocomplete-field/autocomplete-item.d.ts +2 -1
- package/dist/silke/src/components/silke-autocomplete-field/autocomplete-tags.d.ts +2 -1
- package/dist/silke/src/components/silke-autocomplete-field/silke-autocomplete-field.d.ts +3 -1
- package/dist/silke/src/components/silke-autocomplete-field/silke-autocomplete-popup.d.ts +1 -0
- package/dist/silke/src/components/silke-box/silke-box.d.ts +3 -2
- package/dist/silke/src/components/silke-breadcrumbs/silke-breadcrumb.d.ts +1 -1
- package/dist/silke/src/components/silke-button/silke-big-button.d.ts +4 -1
- package/dist/silke/src/components/silke-button/silke-button.d.ts +1 -1
- package/dist/silke/src/components/silke-button/silke-dropdown-button.d.ts +2 -1
- package/dist/silke/src/components/silke-color-picker/color.d.ts +5 -0
- package/dist/silke/src/components/silke-color-picker/silke-color-info.d.ts +3 -1
- package/dist/silke/src/components/silke-color-swatches/silke-swatches.d.ts +2 -1
- package/dist/silke/src/components/silke-conditions-input/index.d.ts +2 -0
- package/dist/silke/src/components/silke-conditions-input/silke-conditions-input-options.d.ts +8 -0
- package/dist/silke/src/components/silke-conditions-input/silke-conditions-input.d.ts +19 -0
- package/dist/silke/src/components/silke-conditions-input/silke-conditions-tag.d.ts +11 -0
- package/dist/silke/src/components/silke-conditions-input/types.d.ts +13 -0
- package/dist/silke/src/components/silke-conditions-input/utils.d.ts +11 -0
- package/dist/silke/src/components/silke-context-menu/silke-context-menu-item.d.ts +1 -1
- package/dist/silke/src/components/silke-css-number-field/silke-css-context.d.ts +5 -1
- package/dist/silke/src/components/silke-css-number-field/silke-css-number-field.d.ts +3 -1
- package/dist/silke/src/components/silke-form/form-types.d.ts +3 -3
- package/dist/silke/src/components/silke-form-schema/fields/array-field-inline.d.ts +2 -1
- package/dist/silke/src/components/silke-form-schema/fields/array-field-modal.d.ts +3 -2
- package/dist/silke/src/components/silke-form-schema/fields/array-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/event-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/icon-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/image-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/layout-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/number-field.d.ts +1 -0
- package/dist/silke/src/components/silke-form-schema/fields/object-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/string-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/toggle-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/utils/generate-image.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/utils/generate-title.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/fields/video-field.d.ts +1 -1
- package/dist/silke/src/components/silke-form-schema/silke-form-schema.d.ts +9 -1
- package/dist/silke/src/components/silke-form-schema/silke-schema-field.d.ts +3 -1
- package/dist/silke/src/components/silke-form-schema/silke-schema-fields.d.ts +2 -0
- package/dist/silke/src/components/silke-modal/silke-modal.d.ts +2 -1
- package/dist/silke/src/components/silke-notification/silke-notification.d.ts +1 -1
- package/dist/silke/src/components/silke-radio-button/silke-radio-button-group.d.ts +1 -1
- package/dist/silke/src/components/silke-slider/silke-slider.d.ts +1 -0
- package/dist/silke/src/components/silke-sortable-list/silke-nested-sortable-utils.d.ts +1 -0
- package/dist/silke/src/components/silke-sortable-list/silke-sortable-item-wrapper.d.ts +2 -1
- package/dist/silke/src/components/silke-sortable-list/silke-sortable-list.d.ts +2 -1
- package/dist/silke/src/components/silke-table/silke-table.d.ts +2 -1
- package/dist/silke/src/components/silke-table/table-row.d.ts +3 -1
- package/dist/silke/src/components/silke-table/table-types.d.ts +1 -1
- package/dist/silke/src/components/silke-tag/silke-tag.d.ts +1 -1
- package/dist/silke/src/components/silke-text-field/silke-text-field-outline.d.ts +4 -2
- package/dist/silke/src/components/silke-text-field/text-field-context.d.ts +4 -1
- package/dist/silke/src/components/silke-tile/index.d.ts +0 -1
- package/dist/silke/src/components/silke-tooltip/silke-definition-tooltip.d.ts +2 -1
- package/dist/silke/src/components/silke-tooltip/silke-icon-tooltip.d.ts +2 -1
- package/dist/silke/src/components/silke-tooltip/silke-tooltip.d.ts +6 -1
- package/dist/silke/src/components/silke-variables-wrapper/silke-variables-wrapper-form.d.ts +4 -3
- package/dist/silke/src/components/silke-variables-wrapper/silke-variables-wrapper.d.ts +5 -1
- package/dist/silke/src/icons.d.ts +76 -2
- package/dist/silke/src/silke-theme-provider.d.ts +1 -1
- package/dist/styles.css +1411 -1149
- package/dist/utils/src/types/context.d.ts +1 -0
- package/dist/utils/src/types/index.d.ts +1 -0
- package/dist/utils/src/types/manifest.d.ts +2 -0
- package/dist/utils/src/types/qwiker.d.ts +46 -0
- package/dist/utils/src/types/vev-plugin.d.ts +12 -0
- package/dist/utils/src/types/vev-props.d.ts +23 -2
- package/dist/utils/src/types/widget-manifest.d.ts +1 -0
- package/dist/utils/src/utils/index.d.ts +1 -0
- package/dist/utils/src/utils/variable.d.ts +3 -0
- package/package.json +15 -8
- package/project.json +21 -0
- package/public/index.html +2 -2
- package/src/_variables.scss +19 -5
- package/src/components/index.ts +1 -1
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +18 -12
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +3 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.mdx +15 -15
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +33 -25
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +40 -20
- package/src/components/silke-box/silke-box.mdx +13 -9
- package/src/components/silke-box/silke-box.scss +12 -3
- package/src/components/silke-box/silke-box.tsx +18 -2
- package/src/components/silke-breadcrumbs/silke-breadcrumb.tsx +2 -2
- package/src/components/silke-button/silke-big-button.scss +0 -5
- package/src/components/silke-button/silke-big-button.tsx +15 -4
- package/src/components/silke-button/silke-button.mdx +34 -17
- package/src/components/silke-button/silke-button.scss +28 -31
- package/src/components/silke-button/silke-button.tsx +2 -2
- package/src/components/silke-button/silke-dropdown-button.tsx +7 -3
- package/src/components/silke-button/silke-file-select-button.tsx +1 -0
- package/src/components/silke-card/silke-card-grid.tsx +1 -1
- package/src/components/silke-card/silke-card.mdx +16 -26
- package/src/components/silke-card/silke-card.scss +10 -3
- package/src/components/silke-card/silke-card.tsx +7 -4
- package/src/components/silke-checkbox/silke-checkbox.mdx +2 -11
- package/src/components/silke-code-snippet/silke-code-snippet.mdx +27 -22
- package/src/components/silke-color-palettes/silke-color-palette.mdx +2 -2
- package/src/components/silke-color-picker/color.ts +12 -0
- package/src/components/silke-color-picker/silke-color-info.tsx +27 -8
- package/src/components/silke-color-picker/silke-color-picker-button.tsx +1 -1
- package/src/components/silke-color-picker/silke-color-picker.mdx +9 -13
- package/src/components/silke-color-picker/silke-color-picker.tsx +23 -6
- package/src/components/silke-color-swatches/silke-color-swatch-button.tsx +1 -1
- package/src/components/silke-color-swatches/silke-swatches.tsx +10 -7
- package/src/components/silke-conditions-input/index.ts +2 -0
- package/src/components/silke-conditions-input/silke-conditions-input-options.tsx +87 -0
- package/src/components/silke-conditions-input/silke-conditions-input.mdx +88 -0
- package/src/components/silke-conditions-input/silke-conditions-input.scss +29 -0
- package/src/components/silke-conditions-input/silke-conditions-input.tsx +290 -0
- package/src/components/silke-conditions-input/silke-conditions-tag.tsx +80 -0
- package/src/components/silke-conditions-input/types.ts +23 -0
- package/src/components/silke-conditions-input/utils.ts +181 -0
- package/src/components/silke-content-column/silke-content-column.scss +1 -1
- package/src/components/silke-context-menu/silke-context-menu-item.tsx +3 -0
- package/src/components/silke-context-menu/silke-context-menu.mdx +4 -4
- package/src/components/silke-context-menu/silke-context-menu.scss +9 -7
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
- package/src/components/silke-css-number-field/silke-css-context.tsx +6 -1
- package/src/components/silke-css-number-field/silke-css-number-field.mdx +221 -91
- package/src/components/silke-css-number-field/silke-css-number-field.scss +10 -3
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +52 -8
- package/src/components/silke-css-number-field/utils.ts +2 -1
- package/src/components/silke-divider/silke-divider.mdx +1 -2
- package/src/components/silke-drawer/silke-drawer.mdx +4 -11
- package/src/components/silke-form/form-types.ts +5 -3
- package/src/components/silke-form/silke-form.mdx +4 -16
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +12 -2
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +10 -6
- package/src/components/silke-form-schema/fields/array-field.tsx +25 -6
- package/src/components/silke-form-schema/fields/event-field.tsx +18 -7
- package/src/components/silke-form-schema/fields/icon-field.tsx +21 -3
- package/src/components/silke-form-schema/fields/image-field.tsx +21 -3
- package/src/components/silke-form-schema/fields/layout-field.tsx +8 -1
- package/src/components/silke-form-schema/fields/link-field.tsx +5 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +169 -22
- package/src/components/silke-form-schema/fields/object-field.tsx +10 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +15 -1
- package/src/components/silke-form-schema/fields/string-field.tsx +115 -20
- package/src/components/silke-form-schema/fields/toggle-field.tsx +14 -2
- package/src/components/silke-form-schema/fields/upload-field.tsx +3 -1
- package/src/components/silke-form-schema/fields/utils/generate-image.ts +4 -1
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +2 -1
- package/src/components/silke-form-schema/fields/video-field.tsx +22 -4
- package/src/components/silke-form-schema/silke-form-schema.mdx +227 -160
- package/src/components/silke-form-schema/silke-form-schema.tsx +10 -1
- package/src/components/silke-form-schema/silke-schema-field.tsx +23 -6
- package/src/components/silke-form-schema/silke-schema-fields.tsx +3 -1
- package/src/components/silke-gradient-picker/silke-gradient-picker.mdx +1 -1
- package/src/components/silke-icon/silke-icon.mdx +3 -6
- package/src/components/silke-icon/silke-icon.scss +2 -0
- package/src/components/silke-icon-picker/silke-icon-picker.tsx +5 -5
- package/src/components/silke-iframe-portal/silke-iframe-portal.mdx +6 -15
- package/src/components/silke-image/silke-image.mdx +28 -0
- package/src/components/silke-image/silke-image.scss +1 -0
- package/src/components/silke-link/silke-link.mdx +62 -39
- package/src/components/silke-link/silke-link.scss +3 -2
- package/src/components/silke-list/silke-list.mdx +12 -10
- package/src/components/silke-list-card/silke-list-card.mdx +7 -11
- package/src/components/silke-loader/silke-loader.mdx +1 -1
- package/src/components/silke-loader/silke-loader.tsx +1 -4
- package/src/components/silke-modal/silke-modal.mdx +1 -5
- package/src/components/silke-modal/silke-modal.scss +0 -2
- package/src/components/silke-modal/silke-modal.tsx +3 -1
- package/src/components/silke-navigation-link/silke-navigation-link.mdx +21 -22
- package/src/components/silke-navigation-link/silke-navigation-link.scss +2 -2
- package/src/components/silke-notification/silke-notification.mdx +35 -67
- package/src/components/silke-notification/silke-notification.tsx +2 -1
- package/src/components/silke-object-field/silke-object-field.mdx +3 -10
- package/src/components/silke-object-field/silke-object-field.tsx +2 -2
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +2 -2
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +2 -1
- package/src/components/silke-popover/silke-popover.mdx +14 -22
- package/src/components/silke-popover/silke-popover.tsx +21 -15
- package/src/components/silke-progress-indicator/silke-progress-indicator.mdx +33 -36
- package/src/components/silke-radio-button/silke-radio-button-group.tsx +1 -1
- package/src/components/silke-radio-button/silke-radio-button.mdx +1 -7
- package/src/components/silke-radio-button/silke-radio-button.scss +1 -0
- package/src/components/silke-search-field/silke-search-field.mdx +4 -12
- package/src/components/silke-select-field/silke-select-field.mdx +10 -10
- package/src/components/silke-slider/silke-slider.mdx +59 -22
- package/src/components/silke-slider/silke-slider.tsx +23 -10
- package/src/components/silke-sortable-list/silke-nested-sortable-item.tsx +3 -3
- package/src/components/silke-sortable-list/silke-nested-sortable-utils.ts +1 -0
- package/src/components/silke-sortable-list/silke-sortable-item-wrapper.tsx +4 -1
- package/src/components/silke-sortable-list/silke-sortable-list.mdx +54 -58
- package/src/components/silke-sortable-list/silke-sortable-list.scss +2 -2
- package/src/components/silke-sortable-list/silke-sortable-list.tsx +3 -0
- package/src/components/silke-table/silke-table.mdx +75 -75
- package/src/components/silke-table/silke-table.scss +27 -13
- package/src/components/silke-table/silke-table.tsx +13 -3
- package/src/components/silke-table/table-row.tsx +6 -1
- package/src/components/silke-table/table-types.ts +1 -1
- package/src/components/silke-tabs/silke-tabs.mdx +2 -2
- package/src/components/silke-tag/silke-tag.mdx +38 -79
- package/src/components/silke-tag/silke-tag.scss +12 -5
- package/src/components/silke-tag/silke-tag.tsx +1 -0
- package/src/components/silke-text/silke-text.mdx +50 -48
- package/src/components/silke-text/silke-text.scss +4 -2
- package/src/components/silke-text/silke-title.scss +29 -15
- package/src/components/silke-text-field/silke-text-field-outline.tsx +15 -3
- package/src/components/silke-text-field/silke-text-field.mdx +67 -71
- package/src/components/silke-text-field/silke-text-field.scss +4 -3
- package/src/components/silke-text-field/silke-text-field.tsx +16 -16
- package/src/components/silke-text-field/text-field-context.tsx +7 -2
- package/src/components/silke-tile/index.ts +0 -1
- package/src/components/silke-tile/silke-tile.mdx +6 -63
- package/src/components/silke-tile/silke-tile.tsx +4 -4
- package/src/components/silke-toggle/silke-toggle.mdx +5 -29
- package/src/components/silke-toggle/silke-toggle.scss +3 -2
- package/src/components/silke-toolbar/silke-toolbar.mdx +6 -6
- package/src/components/silke-tooltip/silke-definition-tooltip.tsx +3 -0
- package/src/components/silke-tooltip/silke-icon-tooltip.tsx +5 -2
- package/src/components/silke-tooltip/silke-tooltip.mdx +16 -34
- package/src/components/silke-tooltip/silke-tooltip.scss +3 -2
- package/src/components/silke-tooltip/silke-tooltip.tsx +15 -4
- package/src/components/silke-upload-field/silke-upload-field.tsx +1 -0
- package/src/components/silke-variables-wrapper/silke-variables-wrapper-form.tsx +30 -50
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.mdx +56 -15
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +0 -2
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.tsx +107 -44
- package/src/docs/data/flux/store.ts +0 -1
- package/src/hooks/drag-and-drop/use-drop.tsx +1 -1
- package/src/hooks/hooks.mdx +3 -3
- package/src/icons.tsx +106 -4
- package/src/index.mdx +30 -31
- package/src/playground.mdx +58 -47
- package/src/silke-theme-provider.tsx +1 -0
- package/src/styles/core.scss +10 -14
- package/dist/silke/src/components/silke-steps/index.d.ts +0 -1
- package/dist/silke/src/components/silke-steps/silke-steps.d.ts +0 -12
- package/dist/silke/src/components/silke-tile/silke-tile-select.d.ts +0 -26
- package/src/components/silke-steps/index.ts +0 -1
- package/src/components/silke-steps/silke-steps.mdx +0 -60
- package/src/components/silke-steps/silke-steps.scss +0 -14
- package/src/components/silke-steps/silke-steps.tsx +0 -53
- package/src/components/silke-tile/silke-tile-select.tsx +0 -100
|
@@ -10,6 +10,8 @@ type SilkeSchemaFieldsProps<T extends { [key: string]: any }> = {
|
|
|
10
10
|
schema: VevProps[];
|
|
11
11
|
noPad?: boolean;
|
|
12
12
|
row?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
13
15
|
} & SilkeFormProps<T>;
|
|
14
16
|
|
|
15
17
|
export function SilkeSchemaFields<T extends { [key: string]: any }>(
|
|
@@ -48,7 +50,7 @@ export function SilkeSchemaFields<T extends { [key: string]: any }>(
|
|
|
48
50
|
<SilkeBox flex column={!row} gap="s" vPad="s" style={{ width: '100%' }}>
|
|
49
51
|
{filteredSchema.map((field, index) => {
|
|
50
52
|
return (
|
|
51
|
-
<span
|
|
53
|
+
<span key={(field?.name || 'field') + index}>
|
|
52
54
|
<SilkeSchemaField field={field} {...rest} isFirst={index === 0} />
|
|
53
55
|
</span>
|
|
54
56
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
const [value, setValue] = React.useState(
|
|
5
|
-
|
|
5
|
+
'linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%)',
|
|
6
6
|
);
|
|
7
7
|
<SilkeBox gap="m">
|
|
8
8
|
<SilkeBox flex>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
# Icons
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const [search, setSearch] = React.useState(
|
|
4
|
+
const [search, setSearch] = React.useState('');
|
|
5
5
|
<SilkeBox column>
|
|
6
|
-
<SilkeSearchField
|
|
7
|
-
|
|
8
|
-
value={search}
|
|
9
|
-
onChange={setSearch}
|
|
10
|
-
/>
|
|
6
|
+
<SilkeSearchField placeholder="Search for icons" value={search} onChange={setSearch} />
|
|
7
|
+
|
|
11
8
|
<SilkeBox gap wrap>
|
|
12
9
|
{Object.keys(SilkeIconDefinitions)
|
|
13
10
|
.filter((icon) => icon.includes(search))
|
|
@@ -41,10 +41,10 @@ export function SilkeIconPicker(props: SilkeIconPickerProps) {
|
|
|
41
41
|
singleType === 'emojis'
|
|
42
42
|
? EmojiType.emoji
|
|
43
43
|
: singleType === 'icon'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
? EmojiType.icon
|
|
45
|
+
: singleType === 'upload'
|
|
46
|
+
? EmojiType.upload
|
|
47
|
+
: EmojiType.emoji,
|
|
48
48
|
);
|
|
49
49
|
const [open, setOpen] = useState(false);
|
|
50
50
|
|
|
@@ -58,7 +58,7 @@ export function SilkeIconPicker(props: SilkeIconPickerProps) {
|
|
|
58
58
|
size={size}
|
|
59
59
|
icon={value || fallback || 'emoji.add'}
|
|
60
60
|
open={open}
|
|
61
|
-
kind={kind || '
|
|
61
|
+
kind={kind || 'secondary'}
|
|
62
62
|
name={name}
|
|
63
63
|
title={title}
|
|
64
64
|
className={className}
|
|
@@ -6,29 +6,20 @@ WARNING: it's possible to escape the iframe and execute code in the parent windo
|
|
|
6
6
|
```js
|
|
7
7
|
const [counter, setCounter] = React.useState(0);
|
|
8
8
|
<SilkeBox column>
|
|
9
|
-
<SilkeIframePortal autoResize style={{ border:
|
|
10
|
-
<SilkeIframeCssLink href="https://cdn.vev.design/fontawesome/6.
|
|
11
|
-
<SilkeIframeCssLink href="https://fonts.googleapis.com/
|
|
9
|
+
<SilkeIframePortal autoResize style={{ border: '2px solid white' }}>
|
|
10
|
+
<SilkeIframeCssLink href="https://cdn.vev.design/fontawesome/6.7.2/css/all.min.css" />
|
|
11
|
+
<SilkeIframeCssLink href="https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wdth,wght,GRAD,XOPQ,XTRA,YTAS,YTFI,YTLC,YTUC@8..144,25..151,100..1000,-200..150,27..175,323..603,649..854,710,416..570,528..760&display=swap" />
|
|
12
12
|
<h1>
|
|
13
13
|
<i class="fa-regular fa-hand-sparkles"></i>
|
|
14
14
|
</h1>
|
|
15
15
|
<style>{"body{color:white;font-family:'Source Code Pro';}"}</style>
|
|
16
16
|
<h1>This header is rendered inside an iframe</h1>
|
|
17
17
|
<h1>Counter inside iframe: {counter}</h1>
|
|
18
|
-
<SilkeButton
|
|
19
|
-
|
|
20
|
-
onClick={() => setCounter((c) => c + 1)}
|
|
21
|
-
/>
|
|
22
|
-
<p>
|
|
23
|
-
Styles will not be synced into the iframe, so silke components will have
|
|
24
|
-
no style
|
|
25
|
-
</p>
|
|
18
|
+
<SilkeButton label="Increment counter inside iframe" onClick={() => setCounter((c) => c + 1)} />
|
|
19
|
+
<p>Styles will not be synced into the iframe, so silke components will have no style</p>
|
|
26
20
|
<SilkeIframeScript>{`console.log("hello from iframe")`}</SilkeIframeScript>
|
|
27
21
|
</SilkeIframePortal>
|
|
28
22
|
<h1>Counter outside iframe: {counter}</h1>
|
|
29
|
-
<SilkeButton
|
|
30
|
-
label="Increment counter outside iframe"
|
|
31
|
-
onClick={() => setCounter((c) => c + 1)}
|
|
32
|
-
/>
|
|
23
|
+
<SilkeButton label="Increment counter outside iframe" onClick={() => setCounter((c) => c + 1)} />
|
|
33
24
|
</SilkeBox>;
|
|
34
25
|
```
|
|
@@ -25,3 +25,31 @@ NB: You can not define width of image or place in layout row
|
|
|
25
25
|
<SilkeImage src={ipsum.image()} alt="Profile pic" avatar="huge" />
|
|
26
26
|
</SilkeBox>
|
|
27
27
|
```
|
|
28
|
+
|
|
29
|
+
## Emoji
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
<SilkeBox gap>
|
|
33
|
+
<SilkeImage
|
|
34
|
+
avatar="m"
|
|
35
|
+
icon={{
|
|
36
|
+
type: 0,
|
|
37
|
+
value: '👋',
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
<SilkeImage
|
|
41
|
+
avatar="m"
|
|
42
|
+
icon={{
|
|
43
|
+
type: 0,
|
|
44
|
+
value: '🧙♂️',
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
<SilkeImage
|
|
48
|
+
avatar="m"
|
|
49
|
+
icon={{
|
|
50
|
+
type: 0,
|
|
51
|
+
value: '👩💻',
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</SilkeBox>
|
|
55
|
+
```
|
|
@@ -1,44 +1,67 @@
|
|
|
1
1
|
```js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</p>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
<>
|
|
3
|
+
<p>
|
|
4
|
+
<SilkeLink target="_blank" href="https://www.vev.design" external>
|
|
5
|
+
External link is marked with icon
|
|
6
|
+
</SilkeLink>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<SilkeLink kind="secondary" target="_blank" href="https://www.vev.design" external>
|
|
11
|
+
Secondary Link
|
|
12
|
+
</SilkeLink>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p style={{ fontSize: '30px' }}>
|
|
16
|
+
<SilkeLink target="_blank" href="https://www.vev.design" external>
|
|
17
|
+
Icon scales with font size
|
|
18
|
+
</SilkeLink>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p>
|
|
22
|
+
<SilkeLink target="_blank" href="https://www.vev.design" standalone>
|
|
23
|
+
Standalone link are not underlined until hovered
|
|
24
|
+
</SilkeLink>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p>
|
|
28
|
+
<SilkeRouterLink to="/components/silke-image/silke-image" standalone>
|
|
29
|
+
Standalone routerlink are also not underlined until hovered
|
|
30
|
+
</SilkeRouterLink>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<SilkeLink href="https://www.google.com" target="_blank">
|
|
35
|
+
Links in new window get proper rel attribte
|
|
36
|
+
</SilkeLink>
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<p>
|
|
40
|
+
<SilkeRouterLink to="/components/silke-image/silke-image">
|
|
41
|
+
Links to internal pages use SilkeRouterLink
|
|
42
|
+
</SilkeRouterLink>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<div>
|
|
24
46
|
<SilkeButtonLink
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
onClick={() => {
|
|
48
|
+
alert('Hello!');
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
Button styled as link
|
|
29
52
|
</SilkeButtonLink>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Button styled as link with icon
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<p>
|
|
56
|
+
<a href="https://www.google.com" rel="button">
|
|
57
|
+
rel="button" still removes link styling
|
|
58
|
+
</a>
|
|
59
|
+
</p>
|
|
60
|
+
|
|
61
|
+
<div>
|
|
62
|
+
<SilkeButtonLink icon="image" standalone onClick={() => alert('Hello!')}>
|
|
63
|
+
Button styled as link with icon
|
|
42
64
|
</SilkeButtonLink>
|
|
43
|
-
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</>
|
|
44
67
|
```
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
.silke-link {
|
|
5
5
|
text-decoration: underline;
|
|
6
6
|
cursor: pointer;
|
|
7
|
-
color: var(--color-accent-
|
|
7
|
+
color: var(--color-accent-40);
|
|
8
|
+
user-select: text;
|
|
8
9
|
|
|
9
10
|
&.secondary{
|
|
10
|
-
color: var(--color-neutral-
|
|
11
|
+
color: var(--color-neutral-40);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
&:focus-visible {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
```js
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<>
|
|
3
|
+
<SilkeList>
|
|
4
|
+
<SilkeListItem label="Plain list item" />
|
|
5
|
+
<SilkeListItem label="List item with icon" icon="right" />
|
|
6
|
+
<SilkeListItem label="Disabled list item" disabled />
|
|
7
|
+
</SilkeList>
|
|
7
8
|
|
|
8
|
-
<SilkeList select>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</SilkeList>
|
|
9
|
+
<SilkeList select>
|
|
10
|
+
<SilkeListItem label="Plain list item" />
|
|
11
|
+
<SilkeListItem label="List item with icon" icon="right" />
|
|
12
|
+
<SilkeListItem label="Disabled list item" disabled />
|
|
13
|
+
</SilkeList>
|
|
14
|
+
</>
|
|
13
15
|
```
|
|
@@ -3,23 +3,19 @@
|
|
|
3
3
|
## Variants
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
const list = [1, 2, 3].map((i) => ({ label:
|
|
6
|
+
const list = [1, 2, 3].map((i) => ({ label: 'Item 1' }));
|
|
7
7
|
|
|
8
8
|
<SilkeBox column gap="m">
|
|
9
9
|
<SilkeListCard title="Title placeholder" />
|
|
10
10
|
<SilkeListCard title="Title placeholder" image={ipsum.image()} />
|
|
11
|
-
<SilkeListCard
|
|
12
|
-
title="Title placeholder"
|
|
13
|
-
subtitle="Subtitle placeholder"
|
|
14
|
-
image={ipsum.image()}
|
|
15
|
-
/>
|
|
11
|
+
<SilkeListCard title="Title placeholder" subtitle="Subtitle placeholder" image={ipsum.image()} />
|
|
16
12
|
<SilkeListCard
|
|
17
13
|
title="Title placeholder"
|
|
18
14
|
subtitle="Subtitle placeholder"
|
|
19
15
|
image={ipsum.image()}
|
|
20
16
|
tag={{
|
|
21
|
-
label:
|
|
22
|
-
kind:
|
|
17
|
+
label: 'Tag',
|
|
18
|
+
kind: 'green',
|
|
23
19
|
}}
|
|
24
20
|
/>
|
|
25
21
|
<SilkeListCard
|
|
@@ -27,8 +23,8 @@ const list = [1, 2, 3].map((i) => ({ label: "Item 1" }));
|
|
|
27
23
|
subtitle="Subtitle placeholder"
|
|
28
24
|
image={ipsum.image()}
|
|
29
25
|
tag={{
|
|
30
|
-
label:
|
|
31
|
-
kind:
|
|
26
|
+
label: 'Tag',
|
|
27
|
+
kind: 'green',
|
|
32
28
|
}}
|
|
33
29
|
menu={list}
|
|
34
30
|
/>
|
|
@@ -38,7 +34,7 @@ const list = [1, 2, 3].map((i) => ({ label: "Item 1" }));
|
|
|
38
34
|
## States
|
|
39
35
|
|
|
40
36
|
```js
|
|
41
|
-
const list = [1, 2, 3].map((i) => ({ label:
|
|
37
|
+
const list = [1, 2, 3].map((i) => ({ label: 'Item 1' }));
|
|
42
38
|
|
|
43
39
|
<SilkeBox gap="m" column>
|
|
44
40
|
<SilkeListCard title="Default" image={ipsum.image()} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BoxDivProps,
|
|
2
|
+
import { BoxDivProps, SilkeBox } from '../silke-box';
|
|
3
3
|
import './silke-loader.scss';
|
|
4
4
|
import { SilkeTextSmall } from '../silke-text';
|
|
5
5
|
|
|
@@ -40,19 +40,16 @@ export function LoaderSVG({ stop, style }: { stop?: boolean; style?: React.CSSPr
|
|
|
40
40
|
<svg style={style} className={cl} viewBox="600 800 1900 1600">
|
|
41
41
|
<path
|
|
42
42
|
className="upSmallV"
|
|
43
|
-
// eslint-disable-next-line max-len
|
|
44
43
|
d="M784 1054l136 379c1 1 5 2 68 2s67-1 68-2l137-379-51-1h-51l-39 113c-41 116-41 116-61 192-1 5-4 6-5 3l-11-41c-10-37-12-44-50-153l-40-114h-51l-50 1z"
|
|
45
44
|
/>
|
|
46
45
|
<path className="upSmallE" d="M860 1244v191h301v-79H951v-82h189v-79H951v-64h203v-79H860z" />
|
|
47
46
|
<path
|
|
48
47
|
className="bigV"
|
|
49
|
-
// eslint-disable-next-line max-len
|
|
50
48
|
d="M1382 1060l173 461 171 455 1 3h158l173-461 174-463 1-2h-148l-3 7-112 295-108 286-26 99-26 100h-4l-4-1-26-99-25-98-112-295-112-294h-148z"
|
|
51
49
|
/>
|
|
52
50
|
<path className="bigE" d="M2139 1053h-687v926h708v-123h-570v-293h515v-125h-515v-260h549z" />
|
|
53
51
|
<path
|
|
54
52
|
className="downSmallV"
|
|
55
|
-
// eslint-disable-next-line max-len
|
|
56
53
|
d="M806 1596l136 379c1 1 5 2 68 2s67-1 68-2l137-379-51-1h-51l-39 113c-41 116-41 116-61 192-1 5-4 6-5 3l-11-41c-10-37-12-44-50-153l-40-114h-51l-50 1z"
|
|
57
54
|
/>
|
|
58
55
|
<path className="downSmallE" d="M860 1787v192h301v-79H951v-82h189v-79H951v-64h203v-79H860z" />
|
|
@@ -79,11 +79,7 @@ const handleToggle = () => setHide(!hide);
|
|
|
79
79
|
const handleToggleDelete = () => setHideDelete(!hideDelete);
|
|
80
80
|
<SilkeButtonSet>
|
|
81
81
|
<SilkeButton label="Show default modal" onClick={handleToggle} />
|
|
82
|
-
<SilkeButton
|
|
83
|
-
label="Show delete modal"
|
|
84
|
-
kind="danger"
|
|
85
|
-
onClick={handleToggleDelete}
|
|
86
|
-
/>
|
|
82
|
+
<SilkeButton label="Show delete modal" kind="danger" onClick={handleToggleDelete} />
|
|
87
83
|
<SilkeConfirmationModal
|
|
88
84
|
hide={hide}
|
|
89
85
|
title={ipsum.name(3)}
|
|
@@ -17,6 +17,7 @@ export type SilkeModalProps = {
|
|
|
17
17
|
onClose?: () => void;
|
|
18
18
|
contextId?: string;
|
|
19
19
|
logo?: boolean;
|
|
20
|
+
gap?: BoxSpace;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export function SilkeModal({
|
|
@@ -29,6 +30,7 @@ export function SilkeModal({
|
|
|
29
30
|
onClose,
|
|
30
31
|
contextId = 'silke.modal',
|
|
31
32
|
logo,
|
|
33
|
+
gap = 'm',
|
|
32
34
|
...rest
|
|
33
35
|
}: SilkeModalProps) {
|
|
34
36
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
@@ -45,7 +47,7 @@ export function SilkeModal({
|
|
|
45
47
|
className={styles.modal}
|
|
46
48
|
column
|
|
47
49
|
bg="neutral-5"
|
|
48
|
-
gap=
|
|
50
|
+
gap={gap}
|
|
49
51
|
pad={pad === undefined ? 'l' : pad}
|
|
50
52
|
tabIndex={-1}
|
|
51
53
|
ref={modalRef}
|
|
@@ -8,12 +8,7 @@ const helper = (i) => ({ active: active === i, onClick: () => setActive(i) });
|
|
|
8
8
|
|
|
9
9
|
<>
|
|
10
10
|
<SilkeBox column>
|
|
11
|
-
<SilkeNavigationLink
|
|
12
|
-
label="Item 0"
|
|
13
|
-
{...helper(0)}
|
|
14
|
-
icon="user"
|
|
15
|
-
iconRight="add"
|
|
16
|
-
/>
|
|
11
|
+
<SilkeNavigationLink label="Item 0" {...helper(0)} icon="user" iconRight="add" />
|
|
17
12
|
<SilkeNavigationLink label="Item 1" {...helper(1)} icon="users" />
|
|
18
13
|
<SilkeNavigationLink
|
|
19
14
|
label="Initially active item"
|
|
@@ -28,21 +23,25 @@ const helper = (i) => ({ active: active === i, onClick: () => setActive(i) });
|
|
|
28
23
|
|
|
29
24
|
## Darker background
|
|
30
25
|
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
26
|
+
```jsx
|
|
27
|
+
() => {
|
|
28
|
+
const [active, setActive] = React.useState(2);
|
|
29
|
+
const helper = (i) => ({ active: active === i, onClick: () => setActive(i) });
|
|
30
|
+
const menu = ipsum.list(4, () => ({ label: ipsum.name() }));
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</
|
|
32
|
+
return (
|
|
33
|
+
<SilkeBox column bg="ui-background">
|
|
34
|
+
<SilkeNavigationLink label="Item 0" {...helper(0)} icon="user">
|
|
35
|
+
<SilkeButton icon="add" />
|
|
36
|
+
</SilkeNavigationLink>
|
|
37
|
+
<SilkeNavigationLink label="Item 1" {...helper(1)} icon="users" />
|
|
38
|
+
<SilkeNavigationLink label="Initially active item" icon="tooltip" {...helper(2)}>
|
|
39
|
+
<SilkeButton icon="delete" />
|
|
40
|
+
</SilkeNavigationLink>
|
|
41
|
+
<SilkeNavigationLink label="Item 3" {...helper(3)} icon="account">
|
|
42
|
+
<SilkeOverflowMenu items={menu} />
|
|
43
|
+
</SilkeNavigationLink>
|
|
44
|
+
</SilkeBox>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
48
47
|
```
|
|
@@ -8,7 +8,7 @@ body {
|
|
|
8
8
|
}
|
|
9
9
|
.main {
|
|
10
10
|
position: relative;
|
|
11
|
-
margin: 0 $space-
|
|
11
|
+
margin: 0 $space-s 0;
|
|
12
12
|
padding: 0;
|
|
13
13
|
|
|
14
14
|
&:last-child {
|
|
@@ -42,7 +42,7 @@ body {
|
|
|
42
42
|
width: 4px;
|
|
43
43
|
border-radius: var(--border-radius-tiny);
|
|
44
44
|
|
|
45
|
-
margin: 12px 0 12px -
|
|
45
|
+
margin: 12px 0 12px -6px;
|
|
46
46
|
pointer-events: none;
|
|
47
47
|
transform: translateX(-12px);
|
|
48
48
|
opacity: 1;
|