@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
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { SelectFieldItem, VevProps } from '@vev/utils';
|
|
2
|
+
import { SilkeCSSContextType } from '../silke-css-number-field';
|
|
3
|
+
import { SilkeIcons } from '../silke-icon';
|
|
4
|
+
import { ConditionSuggestion, VevConditionSuggestion } from './types';
|
|
5
|
+
|
|
6
|
+
const operatorOptionsBasic: VevConditionSuggestion[] = [
|
|
7
|
+
{ value: '==', label: 'Equal to', type: 'operator', icon: 'condition.equals' },
|
|
8
|
+
{ value: '!=', label: 'Not equal to', type: 'operator', icon: 'condition.notEqual' },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const operatorOptionsTrueFalse: VevConditionSuggestion[] = [
|
|
12
|
+
{ value: true, prefix: '==', label: 'Is true', type: 'operator', icon: 'condition.equals' },
|
|
13
|
+
{
|
|
14
|
+
value: false,
|
|
15
|
+
prefix: '==',
|
|
16
|
+
label: 'Is false',
|
|
17
|
+
type: 'operator',
|
|
18
|
+
icon: 'condition.notEqual',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const operatorOptionsAdvanced: VevConditionSuggestion[] = [
|
|
23
|
+
{ value: '>', label: 'Greater than', type: 'operator', icon: 'condition.greaterThan' },
|
|
24
|
+
{ value: '<', label: 'Less than', type: 'operator', icon: 'condition.lessThan' },
|
|
25
|
+
{
|
|
26
|
+
value: '>=',
|
|
27
|
+
label: 'Greater than or equal to',
|
|
28
|
+
type: 'operator',
|
|
29
|
+
icon: 'condition.greaterThanEqual',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: '<=',
|
|
33
|
+
label: 'Less than or equal to',
|
|
34
|
+
type: 'operator',
|
|
35
|
+
icon: 'condition.lessThanEqueal',
|
|
36
|
+
},
|
|
37
|
+
// { value: 'IN', label: 'In', type: 'operator' },
|
|
38
|
+
// { value: 'NOT IN', label: 'Not in', type: 'operator' },
|
|
39
|
+
// { value: 'LIKE', label: 'Like', type: 'operator' },
|
|
40
|
+
// { value: 'NOT LIKE', label: 'Not like', type: 'operator' },
|
|
41
|
+
// { value: 'BETWEEN', label: 'Between', type: 'operator' },
|
|
42
|
+
// { value: 'NOT BETWEEN', label: 'Not between', type: 'operator' },
|
|
43
|
+
// { value: 'IS NULL', label: 'Is null', type: 'operator' },
|
|
44
|
+
// { value: 'IS NOT NULL', label: 'Is not null', type: 'operator' },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const combinatorOptions: VevConditionSuggestion[] = [
|
|
48
|
+
{ value: 'AND', label: 'And', type: 'combinator', icon: 'condition.and' },
|
|
49
|
+
{ value: 'OR', label: 'Or', type: 'combinator', icon: 'condition.or' },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
export const booleanSuggestions: ConditionSuggestion[] = [
|
|
53
|
+
{ type: 'boolean', label: 'True', value: true, icon: 'condition.true' },
|
|
54
|
+
{ type: 'boolean', label: 'False', value: false, icon: 'condition.false' },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const searchSuggestions = (searchValue: string, options?: VevConditionSuggestion[]) => {
|
|
58
|
+
if (!options) return [];
|
|
59
|
+
if (searchValue.length === 0) return options;
|
|
60
|
+
return options.filter(
|
|
61
|
+
(option) =>
|
|
62
|
+
option.label.toLowerCase().includes(searchValue.toLowerCase()) ||
|
|
63
|
+
String(option.value).toLowerCase().includes(searchValue.toLowerCase()),
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const getOperatorSuggestions = (searchValue: string, onlyTrueFalse: boolean) => {
|
|
68
|
+
const searchOptions = onlyTrueFalse
|
|
69
|
+
? operatorOptionsTrueFalse
|
|
70
|
+
: [...operatorOptionsBasic, ...operatorOptionsAdvanced];
|
|
71
|
+
|
|
72
|
+
const matches = searchSuggestions(searchValue, searchOptions);
|
|
73
|
+
return matches.length > 0 ? ['Combinator', ...matches] : [];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const getCombinatorSuggestions = (searchValue: string) => {
|
|
77
|
+
const matches = searchSuggestions(searchValue, combinatorOptions);
|
|
78
|
+
|
|
79
|
+
return matches.length > 0 ? ['Combinator', ...matches] : [];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const getVariableIcon = (type: string): SilkeIcons => {
|
|
83
|
+
return type === 'color' ? 'variable.color' : 'hashtag';
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const varToSuggestion = (variable: SilkeCSSContextType['variablesv2'][0]): ConditionSuggestion => ({
|
|
87
|
+
type: variable.type,
|
|
88
|
+
label: variable.name,
|
|
89
|
+
value: `{{${variable.key}}}`,
|
|
90
|
+
subLabel:
|
|
91
|
+
variable.type === 'color' ? `${variable.value}${variable.unit ? `${variable.unit}` : ''}` : '',
|
|
92
|
+
icon: getVariableIcon(variable.type),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const vevPropToSuggestion = (prop: VevProps): VevConditionSuggestion => ({
|
|
96
|
+
type: 'widget',
|
|
97
|
+
label: prop.description || prop.name || '',
|
|
98
|
+
value: prop.name || '',
|
|
99
|
+
icon: 'interaction.inactive',
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Get dropdown suggestions for a given search value and currentInput type (a, b, operator, combinator)
|
|
103
|
+
export const getSuggestions = (
|
|
104
|
+
searchValue: string,
|
|
105
|
+
variables: SilkeCSSContextType['variablesv2'],
|
|
106
|
+
systemOptions?: VevConditionSuggestion[],
|
|
107
|
+
widgetOptions?: VevProps[],
|
|
108
|
+
) => {
|
|
109
|
+
const varFilter = (variable: SilkeCSSContextType['variablesv2'][0]) => {
|
|
110
|
+
if (searchValue.length === 0) return true;
|
|
111
|
+
return variable.name?.toLowerCase().includes(searchValue.toLowerCase());
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const systemVars = searchSuggestions(searchValue, systemOptions);
|
|
115
|
+
const widgetVars = searchSuggestions(searchValue, widgetOptions?.map(vevPropToSuggestion));
|
|
116
|
+
const numberVars = variables.filter((v) => v.type === 'number').filter(varFilter);
|
|
117
|
+
const colorVars = variables.filter((v) => v.type === 'color').filter(varFilter);
|
|
118
|
+
const textVars = variables.filter((v) => v.type === 'text').filter(varFilter);
|
|
119
|
+
const fontVars = variables.filter((v) => v.type === 'font').filter(varFilter);
|
|
120
|
+
|
|
121
|
+
const widgetItems = widgetVars.length > 0 ? ['Trigger', ...widgetVars] : [];
|
|
122
|
+
const systemItems = systemVars.length > 0 ? ['System', ...systemVars] : [];
|
|
123
|
+
const numberItems = numberVars.length > 0 ? ['Number', ...numberVars.map(varToSuggestion)] : [];
|
|
124
|
+
const colorItems = colorVars.length > 0 ? ['Color', ...colorVars.map(varToSuggestion)] : [];
|
|
125
|
+
const textItems = textVars.length > 0 ? ['Text', ...textVars.map(varToSuggestion)] : [];
|
|
126
|
+
const fontItems = fontVars.length > 0 ? ['Font', ...fontVars.map(varToSuggestion)] : [];
|
|
127
|
+
|
|
128
|
+
return [
|
|
129
|
+
...widgetItems,
|
|
130
|
+
...systemItems,
|
|
131
|
+
...numberItems,
|
|
132
|
+
...colorItems,
|
|
133
|
+
...textItems,
|
|
134
|
+
...fontItems,
|
|
135
|
+
];
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Get system options for a given value - For example "Device"
|
|
139
|
+
export const getSystemSuggestionOptions = (
|
|
140
|
+
value: string | number | boolean,
|
|
141
|
+
systemOptions?: VevConditionSuggestion[],
|
|
142
|
+
) => {
|
|
143
|
+
const match = systemOptions?.find((o) => o.value === value);
|
|
144
|
+
if (match && match.options) {
|
|
145
|
+
const optionItems = match.options.map((option) => ({
|
|
146
|
+
type: 'system',
|
|
147
|
+
label: option,
|
|
148
|
+
value: option,
|
|
149
|
+
})) as ConditionSuggestion[];
|
|
150
|
+
return [String(value), ...optionItems];
|
|
151
|
+
}
|
|
152
|
+
return [];
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const getWidgetSuggestionOptions = (
|
|
156
|
+
value: string | number | boolean,
|
|
157
|
+
widgetOptions?: VevProps[],
|
|
158
|
+
) => {
|
|
159
|
+
const match = widgetOptions?.find((o) => o.name === value);
|
|
160
|
+
if (match && match.type === 'select' && match.options) {
|
|
161
|
+
const items = match.options?.items as SelectFieldItem[];
|
|
162
|
+
const optionItems = items?.map((option) => ({
|
|
163
|
+
type: 'widget',
|
|
164
|
+
label: option.label,
|
|
165
|
+
value: option.value,
|
|
166
|
+
})) as ConditionSuggestion[];
|
|
167
|
+
return [String(value), ...optionItems];
|
|
168
|
+
}
|
|
169
|
+
return [];
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const isWidgetOption = (value: string | number | boolean, widgetOptions?: VevProps[]) => {
|
|
173
|
+
return !!widgetOptions?.find((o) => o.name === value);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const getWidgetOptionType = (
|
|
177
|
+
value: string | number | boolean,
|
|
178
|
+
widgetOptions?: VevProps[],
|
|
179
|
+
) => {
|
|
180
|
+
return widgetOptions?.find((o) => o.name === value)?.type;
|
|
181
|
+
};
|
|
@@ -26,6 +26,7 @@ export const SilkeContextMenuItem = ({
|
|
|
26
26
|
subItem,
|
|
27
27
|
onClick,
|
|
28
28
|
selected,
|
|
29
|
+
leftIcon,
|
|
29
30
|
...rest
|
|
30
31
|
}: SilkeContextMenuItemProps) => {
|
|
31
32
|
const cl = [styles.item];
|
|
@@ -34,6 +35,7 @@ export const SilkeContextMenuItem = ({
|
|
|
34
35
|
const requestCloseSub = usePopoverRequestClose('contextmenu.sub');
|
|
35
36
|
|
|
36
37
|
if (selected) cl.push(styles.selected);
|
|
38
|
+
if (leftIcon) cl.push(styles.leftIcon);
|
|
37
39
|
|
|
38
40
|
const [showSub, setShowSub] = useState(false);
|
|
39
41
|
return (
|
|
@@ -64,6 +66,7 @@ export const SilkeContextMenuItem = ({
|
|
|
64
66
|
}
|
|
65
67
|
}}
|
|
66
68
|
className={cl.join(' ')}
|
|
69
|
+
leftIcon={leftIcon}
|
|
67
70
|
{...rest}
|
|
68
71
|
/>
|
|
69
72
|
{showSub && items && (
|
|
@@ -9,16 +9,16 @@ const items = React.useMemo(
|
|
|
9
9
|
() =>
|
|
10
10
|
ipsum.list(5, (i) =>
|
|
11
11
|
i === 2
|
|
12
|
-
?
|
|
12
|
+
? 'divider'
|
|
13
13
|
: {
|
|
14
14
|
label: ipsum.name(),
|
|
15
15
|
items: ipsum.list(5, (j) => ({
|
|
16
16
|
label: ipsum.name(),
|
|
17
17
|
onClick: () => console.log(`Item ${i}-${j} click`),
|
|
18
18
|
})),
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
20
|
),
|
|
21
|
-
[]
|
|
21
|
+
[],
|
|
22
22
|
);
|
|
23
23
|
<SilkeBox column gap>
|
|
24
24
|
<SilkeBox ref={ref} pad="xxl" bg="neutral-20" align="center">
|
|
@@ -45,7 +45,7 @@ const items = React.useMemo(
|
|
|
45
45
|
onClick: () => console.log(`Item ${i}-${j} click`),
|
|
46
46
|
})),
|
|
47
47
|
})),
|
|
48
|
-
[]
|
|
48
|
+
[],
|
|
49
49
|
);
|
|
50
50
|
<SilkeBox ref={ref} pad="xxl" bg="neutral-20" align="center">
|
|
51
51
|
<h4>Anchor</h4>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
.menu{
|
|
2
2
|
border-radius: var(--border-radius-small);
|
|
3
3
|
overflow: hidden;
|
|
4
|
-
button,a{
|
|
5
|
-
justify-content: space-between !important;
|
|
6
|
-
}
|
|
7
4
|
}
|
|
8
5
|
|
|
9
6
|
.item {
|
|
10
7
|
font-size: 12px;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
|
|
9
|
+
&:not(.leftIcon) {
|
|
10
|
+
justify-content: space-between !important;
|
|
11
|
+
|
|
12
|
+
i {
|
|
13
|
+
font-size: 10px;
|
|
14
|
+
color: var(--color-neutral-70);
|
|
15
|
+
}
|
|
15
16
|
}
|
|
17
|
+
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
.selected {
|
|
@@ -128,7 +128,7 @@ export function SilkeContextMenu({
|
|
|
128
128
|
return !item ? null : React.isValidElement(item) ? (
|
|
129
129
|
item
|
|
130
130
|
) : item === 'divider' ? (
|
|
131
|
-
<SilkeBox vPad="xs" column>
|
|
131
|
+
<SilkeBox key={index} vPad="xs" column>
|
|
132
132
|
<SilkeDivider dark />
|
|
133
133
|
</SilkeBox>
|
|
134
134
|
) : (
|
|
@@ -21,13 +21,17 @@ export type SilkeCSSContextType = {
|
|
|
21
21
|
variablesv2: {
|
|
22
22
|
key: string;
|
|
23
23
|
name: string;
|
|
24
|
-
type: 'color' | 'number' | 'font' | 'text';
|
|
24
|
+
type: 'color' | 'number' | 'font' | 'text' | 'image';
|
|
25
25
|
value?: string;
|
|
26
26
|
unit?: string;
|
|
27
|
+
metadata?: {
|
|
28
|
+
label?: string;
|
|
29
|
+
};
|
|
27
30
|
}[];
|
|
28
31
|
readonly?: boolean;
|
|
29
32
|
onVariableAdd?: (color: string) => void;
|
|
30
33
|
onVariableDelete?: (color: string) => void;
|
|
34
|
+
onVariableAttached?: (type: string) => void;
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
const Context = React.createContext<SilkeCSSContextType>({
|
|
@@ -37,6 +41,7 @@ const Context = React.createContext<SilkeCSSContextType>({
|
|
|
37
41
|
variablesv2: [],
|
|
38
42
|
onVariableAdd: () => null,
|
|
39
43
|
onVariableDelete: () => null,
|
|
44
|
+
onVariableAttached: () => null,
|
|
40
45
|
});
|
|
41
46
|
Context.displayName = 'SilkeTextFieldContext';
|
|
42
47
|
|
|
@@ -5,121 +5,251 @@ You can wrap the filed in a css context to enable automatic conversion between f
|
|
|
5
5
|
|
|
6
6
|
### With variables
|
|
7
7
|
|
|
8
|
+
```jsx
|
|
9
|
+
() => {
|
|
10
|
+
const [value, setValue] = React.useState('20px');
|
|
11
|
+
const formats = ['px', '%', 'em', 'vh', 'vw', 'None'];
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<SilkeCSSContext
|
|
15
|
+
viewport={[1920, 1080]}
|
|
16
|
+
fontSize={18}
|
|
17
|
+
container={[200, 150]}
|
|
18
|
+
variablesv2={[
|
|
19
|
+
{ key: 'A', name: 'size-xs', value: '10', unit: 'px' },
|
|
20
|
+
{ key: 'B', name: 'size-s', value: '50', unit: 'px' },
|
|
21
|
+
{ key: 'C', name: 'size-m', value: '100', unit: 'px' },
|
|
22
|
+
{ key: 'D', name: 'size-l', value: '200', unit: 'px' },
|
|
23
|
+
{ key: 'E', name: 'size-xl', value: '400', unit: 'px' },
|
|
24
|
+
{ key: 'F', name: 'size-xxl', value: '800', unit: 'px' },
|
|
25
|
+
{ key: 'G', name: 'size-xxxl', value: '1600', unit: 'px' },
|
|
26
|
+
{ key: 'H', name: 'size-xxxxl', value: '3200', unit: 'px' },
|
|
27
|
+
]}
|
|
28
|
+
>
|
|
29
|
+
<TextFieldContext inline="label-inside" size="xs">
|
|
30
|
+
<SilkeBox column gap="s">
|
|
31
|
+
<h1>{value}</h1>
|
|
32
|
+
|
|
33
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
34
|
+
<SilkeBox gap="s" key={kind} style={{ width: 256 }}>
|
|
35
|
+
<SilkeCssNumberField
|
|
36
|
+
kind={kind}
|
|
37
|
+
label="Label"
|
|
38
|
+
allowAuto
|
|
39
|
+
value={value}
|
|
40
|
+
formats={formats}
|
|
41
|
+
onChange={setValue}
|
|
42
|
+
/>
|
|
43
|
+
<SilkeCssNumberField
|
|
44
|
+
kind={kind}
|
|
45
|
+
value={value}
|
|
46
|
+
label="Label"
|
|
47
|
+
formats={formats}
|
|
48
|
+
onChange={setValue}
|
|
49
|
+
/>
|
|
50
|
+
<SilkeCssNumberField
|
|
51
|
+
kind={kind}
|
|
52
|
+
label="Label"
|
|
53
|
+
value={value}
|
|
54
|
+
formats={formats}
|
|
55
|
+
onChange={setValue}
|
|
56
|
+
/>
|
|
57
|
+
</SilkeBox>
|
|
58
|
+
))}
|
|
59
|
+
</SilkeBox>
|
|
60
|
+
</TextFieldContext>
|
|
61
|
+
</SilkeCSSContext>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Basic usage
|
|
67
|
+
|
|
8
68
|
```js
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{ key: 'C', name: 'size-m', value: '100', unit: 'px'},
|
|
15
|
-
{ key: 'D', name: 'size-l', value: '200', unit: 'px'},
|
|
16
|
-
{ key: 'E', name: 'size-xl', value: '400', unit: 'px'},
|
|
17
|
-
{ key: 'F', name: 'size-xxl', value: '800', unit: 'px'},
|
|
18
|
-
{ key: 'G', name: 'size-xxxl', value: '1600', unit: 'px'},
|
|
19
|
-
{ key: 'H', name: 'size-xxxxl', value: '3200', unit: 'px'}
|
|
20
|
-
]}>
|
|
21
|
-
<TextFieldContext inline="label-inside" size="xs">
|
|
69
|
+
() => {
|
|
70
|
+
const [value, setValue] = React.useState('20px');
|
|
71
|
+
const formats = ['px', '%', 'em', 'vh', 'vw'];
|
|
72
|
+
|
|
73
|
+
return (
|
|
22
74
|
<SilkeBox column gap="s">
|
|
23
75
|
<h1>{value}</h1>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<SilkeCssNumberField
|
|
28
|
-
|
|
76
|
+
|
|
77
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
78
|
+
<SilkeBox gap="s" key={kind} style={{ width: 380 }}>
|
|
79
|
+
<SilkeCssNumberField
|
|
80
|
+
kind={kind}
|
|
81
|
+
label="Label"
|
|
82
|
+
allowAuto
|
|
83
|
+
value={value}
|
|
84
|
+
size="xs"
|
|
85
|
+
formats={formats}
|
|
86
|
+
onChange={setValue}
|
|
87
|
+
/>
|
|
88
|
+
<SilkeCssNumberField
|
|
89
|
+
kind={kind}
|
|
90
|
+
label="Label"
|
|
91
|
+
allowAuto
|
|
92
|
+
value={value}
|
|
93
|
+
size="s"
|
|
94
|
+
formats={formats}
|
|
95
|
+
onChange={setValue}
|
|
96
|
+
/>
|
|
97
|
+
<SilkeCssNumberField
|
|
98
|
+
kind={kind}
|
|
99
|
+
label="Label"
|
|
100
|
+
value={value}
|
|
101
|
+
formats={formats}
|
|
102
|
+
onChange={setValue}
|
|
103
|
+
/>
|
|
104
|
+
<SilkeCssNumberField
|
|
105
|
+
kind={kind}
|
|
106
|
+
label="Label"
|
|
107
|
+
value={value}
|
|
108
|
+
inline
|
|
109
|
+
formats={formats}
|
|
110
|
+
onChange={setValue}
|
|
111
|
+
/>
|
|
29
112
|
</SilkeBox>
|
|
30
113
|
))}
|
|
31
114
|
</SilkeBox>
|
|
32
|
-
|
|
33
|
-
|
|
115
|
+
);
|
|
116
|
+
};
|
|
34
117
|
```
|
|
35
118
|
|
|
36
|
-
|
|
119
|
+
```jsx
|
|
120
|
+
() => {
|
|
121
|
+
const [value, setValue] = React.useState('20px');
|
|
122
|
+
const formats = ['px', '%', 'em', 'vh', 'vw'];
|
|
37
123
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<SilkeBox column gap="s">
|
|
43
|
-
<h1>{value}</h1>
|
|
44
|
-
{["default", "zombie", "ghost"].map((kind) => (
|
|
45
|
-
<SilkeBox gap="s" key={kind} style={{width: 380}}>
|
|
46
|
-
<SilkeCssNumberField kind={kind} label="Label" allowAuto value={value} size="xs" formats={formats} onChange={setValue} />
|
|
47
|
-
<SilkeCssNumberField kind={kind} label="Label" allowAuto value={value} size="s" formats={formats} onChange={setValue} />
|
|
48
|
-
<SilkeCssNumberField kind={kind} value={value} label="Label" formats={formats} onChange={setValue}/>
|
|
49
|
-
<SilkeCssNumberField kind={kind} label="Label" value={value} inline formats={formats} onChange={setValue} />
|
|
50
|
-
</SilkeBox>
|
|
51
|
-
))}
|
|
52
|
-
</SilkeBox>
|
|
53
|
-
```
|
|
124
|
+
return (
|
|
125
|
+
<TextFieldContext inline="label-inside" size="xs">
|
|
126
|
+
<SilkeBox column gap="s">
|
|
127
|
+
<h1>{value}</h1>
|
|
54
128
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
129
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
130
|
+
<SilkeBox gap="s" key={kind} style={{ width: 256 }}>
|
|
131
|
+
<SilkeCssNumberField
|
|
132
|
+
kind={kind}
|
|
133
|
+
label="Label"
|
|
134
|
+
allowAuto
|
|
135
|
+
value={value}
|
|
136
|
+
formats={formats}
|
|
137
|
+
onChange={setValue}
|
|
138
|
+
/>
|
|
139
|
+
<SilkeCssNumberField
|
|
140
|
+
kind={kind}
|
|
141
|
+
label="Label"
|
|
142
|
+
value={value}
|
|
143
|
+
formats={formats}
|
|
144
|
+
onChange={setValue}
|
|
145
|
+
/>
|
|
146
|
+
<SilkeCssNumberField
|
|
147
|
+
kind={kind}
|
|
148
|
+
label="Label"
|
|
149
|
+
value={value}
|
|
150
|
+
formats={formats}
|
|
151
|
+
onChange={setValue}
|
|
152
|
+
/>
|
|
153
|
+
</SilkeBox>
|
|
154
|
+
))}
|
|
67
155
|
</SilkeBox>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
156
|
+
</TextFieldContext>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
71
159
|
```
|
|
72
160
|
|
|
73
161
|
### Validation
|
|
74
162
|
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
163
|
+
```jsx
|
|
164
|
+
() => {
|
|
165
|
+
const [value, setValue] = React.useState('20%');
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<SilkeBox column gap="s">
|
|
169
|
+
<h1>{value}</h1>
|
|
170
|
+
|
|
171
|
+
{['default', 'zombie', 'ghost'].map((kind) => (
|
|
172
|
+
<SilkeBox gap="s" key={kind}>
|
|
173
|
+
<SilkeCssNumberField
|
|
174
|
+
kind={kind}
|
|
175
|
+
value={value}
|
|
176
|
+
label="Label"
|
|
177
|
+
onChange={setValue}
|
|
178
|
+
min={0}
|
|
179
|
+
max={100}
|
|
180
|
+
/>
|
|
181
|
+
</SilkeBox>
|
|
182
|
+
))}
|
|
84
183
|
</SilkeBox>
|
|
85
|
-
)
|
|
86
|
-
|
|
184
|
+
);
|
|
185
|
+
};
|
|
87
186
|
```
|
|
88
187
|
|
|
89
188
|
### With custom context
|
|
90
189
|
|
|
91
190
|
```js
|
|
92
|
-
|
|
93
|
-
const [
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</
|
|
191
|
+
() => {
|
|
192
|
+
const [x, setX] = React.useState('20px');
|
|
193
|
+
const [y, setY] = React.useState('20px');
|
|
194
|
+
const formats = ['px', '%', 'em', 'vh', 'vw'];
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<SilkeCSSContext viewport={[1920, 1080]} fontSize={18} container={[200, 150]}>
|
|
198
|
+
<h1>
|
|
199
|
+
{x} - {y}
|
|
200
|
+
</h1>
|
|
201
|
+
|
|
202
|
+
<SilkeBox gap="m">
|
|
203
|
+
<SilkeCssNumberField
|
|
204
|
+
axis="x"
|
|
205
|
+
label="X"
|
|
206
|
+
value={x}
|
|
207
|
+
inline
|
|
208
|
+
formats={formats}
|
|
209
|
+
onChange={setX}
|
|
210
|
+
/>
|
|
211
|
+
<SilkeCssNumberField
|
|
212
|
+
axis="y"
|
|
213
|
+
label="Y"
|
|
214
|
+
value={y}
|
|
215
|
+
inline
|
|
216
|
+
formats={formats}
|
|
217
|
+
onChange={setY}
|
|
218
|
+
/>
|
|
219
|
+
</SilkeBox>
|
|
220
|
+
</SilkeCSSContext>
|
|
221
|
+
);
|
|
222
|
+
};
|
|
102
223
|
```
|
|
103
224
|
|
|
104
225
|
### Also works with text filed context
|
|
105
226
|
|
|
106
227
|
```js
|
|
107
|
-
|
|
108
|
-
const [
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
228
|
+
() => {
|
|
229
|
+
const [x, setX] = React.useState('20px');
|
|
230
|
+
const [y, setY] = React.useState('20px');
|
|
231
|
+
const formats = ['px', '%', 'em', 'vh', 'vw'];
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<SilkeCSSContext viewport={[1920, 1080]} fontSize={18} container={[200, 150]}>
|
|
235
|
+
<h1>
|
|
236
|
+
{x} - {y}
|
|
237
|
+
</h1>
|
|
238
|
+
|
|
239
|
+
<TextFieldContext kind="secondary" size="s" inline>
|
|
240
|
+
<SilkeBox gap="m">
|
|
241
|
+
<SilkeCssNumberField axis="x" label="X" value={x} formats={formats} onChange={setX} />
|
|
242
|
+
<SilkeCssNumberField axis="y" label="Y" value={y} formats={formats} onChange={setY} />
|
|
243
|
+
</SilkeBox>
|
|
244
|
+
</TextFieldContext>
|
|
245
|
+
|
|
246
|
+
<TextFieldContext kind="ghost" size="large" inline>
|
|
247
|
+
<SilkeBox gap="m">
|
|
248
|
+
<SilkeCssNumberField axis="x" label="X" value={x} formats={formats} onChange={setX} />
|
|
249
|
+
<SilkeCssNumberField axis="y" label="Y" value={y} formats={formats} onChange={setY} />
|
|
250
|
+
</SilkeBox>
|
|
251
|
+
</TextFieldContext>
|
|
252
|
+
</SilkeCSSContext>
|
|
253
|
+
);
|
|
254
|
+
};
|
|
125
255
|
```
|