@vev/silke 1.0.28 → 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 +8 -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/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 +5 -0
- 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 +3 -1
- 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 +74 -2
- package/dist/silke/src/silke-theme-provider.d.ts +1 -1
- package/dist/styles.css +1419 -1157
- 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 +144 -13
- 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 +5 -0
- 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 +9 -1
- 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 +104 -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
|
@@ -8,10 +8,7 @@ const [isShowing, setShowing] = React.useState(true);
|
|
|
8
8
|
|
|
9
9
|
<>
|
|
10
10
|
<SilkeBox gap>
|
|
11
|
-
<SilkeButton
|
|
12
|
-
onClick={() => setShowing(!isShowing)}
|
|
13
|
-
label="Toggle tooltip"
|
|
14
|
-
/>
|
|
11
|
+
<SilkeButton onClick={() => setShowing(!isShowing)} label="Toggle tooltip" />
|
|
15
12
|
<SilkeButton ref={ref} label="Nuclear launch" kind="danger" />
|
|
16
13
|
</SilkeBox>
|
|
17
14
|
|
|
@@ -38,20 +35,11 @@ const [isShowing, setShowing] = React.useState(true);
|
|
|
38
35
|
|
|
39
36
|
<>
|
|
40
37
|
<SilkeBox gap>
|
|
41
|
-
<SilkeButton
|
|
42
|
-
onClick={() => setShowing(!isShowing)}
|
|
43
|
-
label="Toggle tooltip"
|
|
44
|
-
/>
|
|
38
|
+
<SilkeButton onClick={() => setShowing(!isShowing)} label="Toggle tooltip" />
|
|
45
39
|
<SilkeButton ref={ref} label="Nuclear launch" kind="danger" />
|
|
46
40
|
</SilkeBox>
|
|
47
41
|
|
|
48
|
-
<SilkeTooltip
|
|
49
|
-
kind="info"
|
|
50
|
-
image={ipsum.image()}
|
|
51
|
-
size="tiny"
|
|
52
|
-
anchor={ref}
|
|
53
|
-
show={isShowing}
|
|
54
|
-
>
|
|
42
|
+
<SilkeTooltip kind="info" image={ipsum.image()} size="tiny" anchor={ref} show={isShowing}>
|
|
55
43
|
Tooltip on the bottom
|
|
56
44
|
</SilkeTooltip>
|
|
57
45
|
<SilkeTooltip
|
|
@@ -97,12 +85,14 @@ const [isShowing, setShowing] = React.useState(true);
|
|
|
97
85
|
|
|
98
86
|
<>
|
|
99
87
|
<SilkeButton onClick={() => setShowing(!isShowing)} label="Toggle tooltip" />
|
|
100
|
-
This is some text needing a
|
|
88
|
+
This is some text needing a{' '}
|
|
89
|
+
<SilkeDefinitionTooltip
|
|
101
90
|
tooltip="state or describe exactly the nature, scope, or meaning of."
|
|
102
91
|
show={isShowing}
|
|
103
92
|
>
|
|
104
93
|
definition
|
|
105
|
-
</SilkeDefinitionTooltip>
|
|
94
|
+
</SilkeDefinitionTooltip>{' '}
|
|
95
|
+
for some words.
|
|
106
96
|
</>;
|
|
107
97
|
```
|
|
108
98
|
|
|
@@ -112,18 +102,14 @@ const [isShowing, setShowing] = React.useState(true);
|
|
|
112
102
|
<>
|
|
113
103
|
This icon has a tip <SilkeIconTooltip tooltip="This is the tip" />
|
|
114
104
|
<br />
|
|
115
|
-
Here's a tip with a shortcut{
|
|
116
|
-
<SilkeIconTooltip
|
|
117
|
-
show
|
|
118
|
-
tooltip="Using the keyboard saves time"
|
|
119
|
-
shortcut="⌘+s"
|
|
120
|
-
/>
|
|
105
|
+
Here's a tip with a shortcut{' '}
|
|
106
|
+
<SilkeIconTooltip show tooltip="Using the keyboard saves time" shortcut="⌘+s" />
|
|
121
107
|
<br />
|
|
122
|
-
And this one has several, plus a custom icon{
|
|
108
|
+
And this one has several, plus a custom icon{' '}
|
|
123
109
|
<SilkeIconTooltip
|
|
124
110
|
icon="check"
|
|
125
111
|
tooltip="Move elements"
|
|
126
|
-
shortcut={[
|
|
112
|
+
shortcut={['up', 'right', 'down', 'left']}
|
|
127
113
|
/>
|
|
128
114
|
<br />
|
|
129
115
|
If you have link in tooltip then just add inteactive prop
|
|
@@ -132,7 +118,7 @@ const [isShowing, setShowing] = React.useState(true);
|
|
|
132
118
|
interactive
|
|
133
119
|
tooltip={
|
|
134
120
|
<>
|
|
135
|
-
Read more about something{
|
|
121
|
+
Read more about something{' '}
|
|
136
122
|
<SilkeLink external href="https://www.vev.design">
|
|
137
123
|
here
|
|
138
124
|
</SilkeLink>
|
|
@@ -149,21 +135,17 @@ const anchor = React.useRef();
|
|
|
149
135
|
const [showing, setShowing] = React.useState(true);
|
|
150
136
|
|
|
151
137
|
<>
|
|
152
|
-
<SilkeButton
|
|
153
|
-
ref={anchor}
|
|
154
|
-
onClick={() => setShowing(!showing)}
|
|
155
|
-
label="Toggle tooltip"
|
|
156
|
-
/>
|
|
138
|
+
<SilkeButton ref={anchor} onClick={() => setShowing(!showing)} label="Toggle tooltip" />
|
|
157
139
|
<SilkeInteractiveTooltip
|
|
158
140
|
anchor={anchor}
|
|
159
141
|
show={showing}
|
|
160
142
|
onFinished={() => setShowing(false)}
|
|
161
143
|
steps={[
|
|
162
144
|
{
|
|
163
|
-
header:
|
|
164
|
-
text:
|
|
145
|
+
header: 'Header',
|
|
146
|
+
text: 'This is step 0, press Next to go to the next step',
|
|
165
147
|
},
|
|
166
|
-
{ header: "Here's step 1", text:
|
|
148
|
+
{ header: "Here's step 1", text: 'Press finish to finish' },
|
|
167
149
|
]}
|
|
168
150
|
/>
|
|
169
151
|
</>;
|
|
@@ -25,6 +25,7 @@ $border-color: rgba(
|
|
|
25
25
|
|
|
26
26
|
.content {
|
|
27
27
|
font-size: 12px;
|
|
28
|
+
line-height: 1.4;
|
|
28
29
|
}
|
|
29
30
|
.default {
|
|
30
31
|
.content {
|
|
@@ -48,10 +49,10 @@ $border-color: rgba(
|
|
|
48
49
|
object-position: center center;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
.definitionTooltip {
|
|
52
|
+
.definitionTooltip:not(.noBorder) {
|
|
52
53
|
border-bottom: 1px dotted var(--color-accent-40);
|
|
53
54
|
|
|
54
|
-
&:hover
|
|
55
|
+
&:hover{
|
|
55
56
|
border-bottom-style: solid;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -37,7 +37,12 @@ export type SilkeTooltipProps = {
|
|
|
37
37
|
anchorOrigin?: PopoverOrigin;
|
|
38
38
|
title?: string;
|
|
39
39
|
children?: React.ReactNode;
|
|
40
|
+
offsetX?: number;
|
|
41
|
+
offsetY?: number;
|
|
42
|
+
zIndex?: number;
|
|
40
43
|
onRequestClose?: () => void;
|
|
44
|
+
onClick?: () => void;
|
|
45
|
+
onImageClick?: () => void;
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
/**
|
|
@@ -54,7 +59,12 @@ export function SilkeTooltip({
|
|
|
54
59
|
image,
|
|
55
60
|
size,
|
|
56
61
|
title,
|
|
62
|
+
offsetX,
|
|
63
|
+
offsetY,
|
|
64
|
+
zIndex,
|
|
65
|
+
onClick,
|
|
57
66
|
onRequestClose,
|
|
67
|
+
onImageClick,
|
|
58
68
|
}: SilkeTooltipProps) {
|
|
59
69
|
const targetRef = useRef<HTMLDivElement>(null);
|
|
60
70
|
const pathRef = useRef<SVGPathElement>(null);
|
|
@@ -138,12 +148,13 @@ export function SilkeTooltip({
|
|
|
138
148
|
|
|
139
149
|
return (
|
|
140
150
|
<SilkePopover
|
|
151
|
+
zIndex={zIndex}
|
|
141
152
|
anchor={anchor}
|
|
142
153
|
hide={!show}
|
|
143
154
|
anchorOrigin={anchorOrigin}
|
|
144
155
|
targetOrigin={targetOrigin}
|
|
145
|
-
offsetY={anchorV === 'center' ? 0 : anchorV === 'top' ? -6 : 6}
|
|
146
|
-
offsetX={anchorH === 'center' ? 0 : anchorH === 'left' ? -6 : 6}
|
|
156
|
+
offsetY={(anchorV === 'center' ? 0 : anchorV === 'top' ? -6 : 6) + (offsetY || 0)}
|
|
157
|
+
offsetX={(anchorH === 'center' ? 0 : anchorH === 'left' ? -6 : 6) + (offsetX || 0)}
|
|
147
158
|
onRequestClose={onRequestClose}
|
|
148
159
|
>
|
|
149
160
|
<div className={cl} ref={targetRef}>
|
|
@@ -155,8 +166,8 @@ export function SilkeTooltip({
|
|
|
155
166
|
</defs>
|
|
156
167
|
<path ref={pathRef} />
|
|
157
168
|
</svg>
|
|
158
|
-
<SilkeBox column style={{ clipPath: `url(#${clipPathId})` }}>
|
|
159
|
-
{image && <img className={styles.img} src={image} alt="" />}
|
|
169
|
+
<SilkeBox column style={{ clipPath: `url(#${clipPathId})` }} onClick={onClick}>
|
|
170
|
+
{image && <img className={styles.img} src={image} alt="" onClick={onImageClick} />}
|
|
160
171
|
<SilkeBox column className={styles.content}>
|
|
161
172
|
{title && (
|
|
162
173
|
<SilkeTitle kind="xxs" weight="strong">
|
|
@@ -171,6 +171,7 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
171
171
|
<SilkeBox tag="label" column gap="s" className={cl} onFocus={onFocus} onBlur={onBlur}>
|
|
172
172
|
<input
|
|
173
173
|
type="file"
|
|
174
|
+
disabled={disabled}
|
|
174
175
|
accept={accept}
|
|
175
176
|
autoFocus={autoFocus}
|
|
176
177
|
maxLength={1024}
|
|
@@ -1,63 +1,43 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SilkeIcon } from '../silke-icon';
|
|
3
|
-
import { SilkePopover } from '../silke-popover';
|
|
4
|
-
import { SilkeTextField } from '../silke-text-field';
|
|
5
2
|
import { SilkeBox } from '../silke-box';
|
|
3
|
+
import { SilkeButton } from '../silke-button';
|
|
4
|
+
import { SilkeDivider } from '../silke-divider';
|
|
5
|
+
import { SilkeForm } from '../silke-form';
|
|
6
|
+
import { SilkeModal } from '../silke-modal';
|
|
7
|
+
import { SilkeTextField, TextFieldContext } from '../silke-text-field';
|
|
6
8
|
|
|
7
9
|
export type SilkeVariablesWrapperFormProps = {
|
|
8
|
-
|
|
10
|
+
variableValue: string;
|
|
9
11
|
containerRef?: React.RefObject<HTMLDivElement>;
|
|
10
|
-
|
|
11
|
-
onSubmit: () => void;
|
|
12
|
+
onSubmit: (form: { variableName: string }) => void;
|
|
12
13
|
onClose: () => void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export function SilkeVariablesWrapperForm(props: SilkeVariablesWrapperFormProps) {
|
|
16
|
-
const handleKeyUp = (e: React.KeyboardEvent) => {
|
|
17
|
-
switch (e.key) {
|
|
18
|
-
case 'Enter': {
|
|
19
|
-
props.onSubmit();
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
case 'Escape': {
|
|
23
|
-
props.onClose();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
17
|
return (
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
kind="ghost"
|
|
53
|
-
onChange={(text: string) => {
|
|
54
|
-
props.onChange(text);
|
|
55
|
-
}}
|
|
56
|
-
onKeyUp={handleKeyUp}
|
|
57
|
-
value={props.value}
|
|
58
|
-
/>
|
|
59
|
-
</SilkeBox>
|
|
60
|
-
</SilkePopover>
|
|
18
|
+
<SilkeModal contextId="autocomplete-dropdown" title="Create variable" onClose={props.onClose}>
|
|
19
|
+
<TextFieldContext size="base" inline={false}>
|
|
20
|
+
<SilkeForm<{ variableName: string; variableValue: string }>
|
|
21
|
+
role="listbox"
|
|
22
|
+
column
|
|
23
|
+
value={{ variableName: '', variableValue: props.variableValue }}
|
|
24
|
+
onSubmit={props.onSubmit}
|
|
25
|
+
>
|
|
26
|
+
<SilkeDivider dark />
|
|
27
|
+
<SilkeTextField autoFocus label="Name" name="variableName" placeholder="Variable name" />
|
|
28
|
+
<SilkeTextField
|
|
29
|
+
label="Value"
|
|
30
|
+
name="variableValue"
|
|
31
|
+
placeholder="Variable value"
|
|
32
|
+
readOnly
|
|
33
|
+
/>
|
|
34
|
+
<SilkeBox hPad="s" hAlign="end" gap="s">
|
|
35
|
+
<SilkeButton size="base" label="Close" kind="ghost" onClick={props.onClose} />
|
|
36
|
+
<SilkeButton size="base" label="Create" kind="primary" type="submit" />
|
|
37
|
+
</SilkeBox>
|
|
38
|
+
</SilkeForm>
|
|
39
|
+
</TextFieldContext>
|
|
40
|
+
</SilkeModal>
|
|
61
41
|
);
|
|
62
42
|
}
|
|
63
43
|
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
## Wrapping SilkeCssNumberField
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
const [value, setValue] = React.useState(
|
|
6
|
+
const [value, setValue] = React.useState('0px');
|
|
7
7
|
|
|
8
|
-
const formats = [
|
|
8
|
+
const formats = ['px', '%'];
|
|
9
9
|
|
|
10
10
|
<SilkeCSSContext
|
|
11
11
|
viewport={[1920, 1080]}
|
|
12
12
|
fontSize={18}
|
|
13
13
|
container={[200, 150]}
|
|
14
14
|
variablesv2={[
|
|
15
|
-
{ key:
|
|
16
|
-
{ key:
|
|
17
|
-
{ key:
|
|
15
|
+
{ key: 'A', name: 'size-xs', value: '10', unit: 'px' },
|
|
16
|
+
{ key: 'B', name: 'size-s', value: '50', unit: 'px' },
|
|
17
|
+
{ key: 'C', name: 'size-m', value: '100', unit: 'px' },
|
|
18
18
|
]}
|
|
19
19
|
>
|
|
20
20
|
<SilkeBox>
|
|
21
21
|
<SilkeBox column gap="xl">
|
|
22
22
|
<SilkeBox gap="l">
|
|
23
|
-
{[
|
|
23
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
24
24
|
<SilkeVariablesWrapper
|
|
25
25
|
key={kind}
|
|
26
26
|
component={SilkeCssNumberField}
|
|
@@ -35,7 +35,7 @@ const formats = ["px", "%"];
|
|
|
35
35
|
))}
|
|
36
36
|
</SilkeBox>
|
|
37
37
|
<SilkeBox gap="l">
|
|
38
|
-
{[
|
|
38
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
39
39
|
<TextFieldContext inline="label-inside" size="xs" key={kind}>
|
|
40
40
|
<SilkeVariablesWrapper
|
|
41
41
|
component={SilkeCssNumberField}
|
|
@@ -51,7 +51,7 @@ const formats = ["px", "%"];
|
|
|
51
51
|
))}
|
|
52
52
|
</SilkeBox>
|
|
53
53
|
<SilkeBox gap="l">
|
|
54
|
-
{[
|
|
54
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
55
55
|
<TextFieldContext size="xs" key={kind}>
|
|
56
56
|
<SilkeVariablesWrapper
|
|
57
57
|
component={SilkeCssNumberField}
|
|
@@ -75,24 +75,24 @@ const formats = ["px", "%"];
|
|
|
75
75
|
## Wrapping SilkeInput
|
|
76
76
|
|
|
77
77
|
```js
|
|
78
|
-
const [value, setValue] = React.useState(
|
|
78
|
+
const [value, setValue] = React.useState('0px');
|
|
79
79
|
|
|
80
|
-
const formats = [
|
|
80
|
+
const formats = ['px', '%'];
|
|
81
81
|
|
|
82
82
|
<SilkeCSSContext
|
|
83
83
|
viewport={[1920, 1080]}
|
|
84
84
|
fontSize={18}
|
|
85
85
|
container={[200, 150]}
|
|
86
86
|
variablesv2={[
|
|
87
|
-
{ key:
|
|
88
|
-
{ key:
|
|
89
|
-
{ key:
|
|
87
|
+
{ key: 'D', name: 'size-xs', value: '10', unit: 'px' },
|
|
88
|
+
{ key: 'E', name: 'size-s', value: '50', unit: 'px' },
|
|
89
|
+
{ key: 'F', name: 'size-m', value: '100', unit: 'px' },
|
|
90
90
|
]}
|
|
91
91
|
>
|
|
92
92
|
<SilkeBox>
|
|
93
93
|
<SilkeBox column gap="xl">
|
|
94
94
|
<SilkeBox gap="l" style={{ width: 400 }}>
|
|
95
|
-
{[
|
|
95
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
96
96
|
<SilkeVariablesWrapper
|
|
97
97
|
key={kind}
|
|
98
98
|
component={SilkeTextField}
|
|
@@ -106,7 +106,7 @@ const formats = ["px", "%"];
|
|
|
106
106
|
))}
|
|
107
107
|
</SilkeBox>
|
|
108
108
|
<SilkeBox gap="l">
|
|
109
|
-
{[
|
|
109
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
110
110
|
<TextFieldContext inline="label-inside" size="xs" key={kind}>
|
|
111
111
|
<SilkeVariablesWrapper
|
|
112
112
|
value={value}
|
|
@@ -124,3 +124,44 @@ const formats = ["px", "%"];
|
|
|
124
124
|
</SilkeBox>
|
|
125
125
|
</SilkeCSSContext>;
|
|
126
126
|
```
|
|
127
|
+
|
|
128
|
+
## Wrapping text
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
const [value, setValue] = React.useState('value');
|
|
132
|
+
|
|
133
|
+
<>
|
|
134
|
+
<div style={{ padding: '10px', margin: '20px 0', background: '#000' }}>
|
|
135
|
+
{JSON.stringify(value, null, 2)}
|
|
136
|
+
</div>
|
|
137
|
+
<SilkeCSSContext
|
|
138
|
+
viewport={[1920, 1080]}
|
|
139
|
+
fontSize={18}
|
|
140
|
+
container={[200, 150]}
|
|
141
|
+
variablesv2={[
|
|
142
|
+
{ key: 'D', name: 'text-1', value: '10', type: 'text' },
|
|
143
|
+
{ key: 'E', name: 'text-2', value: '50', type: 'text' },
|
|
144
|
+
{ key: 'F', name: 'text-3', value: '100', type: 'text' },
|
|
145
|
+
]}
|
|
146
|
+
>
|
|
147
|
+
<SilkeBox>
|
|
148
|
+
<SilkeBox column gap="xl">
|
|
149
|
+
<SilkeBox gap="l">
|
|
150
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
151
|
+
<SilkeVariablesWrapper
|
|
152
|
+
key={kind}
|
|
153
|
+
component={SilkeTextField}
|
|
154
|
+
value={value}
|
|
155
|
+
kind={kind}
|
|
156
|
+
onChange={setValue}
|
|
157
|
+
label={kind}
|
|
158
|
+
hasLabelTop
|
|
159
|
+
variableType="text"
|
|
160
|
+
/>
|
|
161
|
+
))}
|
|
162
|
+
</SilkeBox>
|
|
163
|
+
</SilkeBox>
|
|
164
|
+
</SilkeBox>
|
|
165
|
+
</SilkeCSSContext>
|
|
166
|
+
</>;
|
|
167
|
+
```
|