@vev/silke 1.0.18 → 1.0.20
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 +16 -0
- package/dist/{chunk-SOFGXMET.js → chunk-PP74IZDW.js} +3 -3
- package/dist/{chunk-SOFGXMET.js.map → chunk-PP74IZDW.js.map} +2 -2
- package/dist/index.js +22 -23
- package/dist/index.js.LEGAL.txt +7 -7
- package/dist/index.js.map +4 -4
- package/dist/silke/src/components/index.d.ts +54 -0
- package/dist/silke/src/components/silke-autocomplete-field/autocomplete-item.d.ts +19 -0
- package/dist/silke/src/components/silke-autocomplete-field/autocomplete-tags.d.ts +9 -0
- package/dist/silke/src/components/silke-autocomplete-field/autocomplete-types.d.ts +55 -0
- package/dist/silke/src/components/silke-autocomplete-field/index.d.ts +5 -0
- package/dist/silke/src/components/silke-autocomplete-field/silke-autocomplete-field.d.ts +50 -0
- package/dist/silke/src/components/silke-box/index.d.ts +1 -0
- package/dist/silke/src/components/silke-box/silke-box.d.ts +120 -0
- package/dist/silke/src/components/silke-breadcrumbs/index.d.ts +2 -0
- package/dist/silke/src/components/silke-breadcrumbs/silke-breadcrumb.d.ts +10 -0
- package/dist/silke/src/components/silke-breadcrumbs/silke-breadcrumbs.d.ts +7 -0
- package/dist/silke/src/components/silke-button/context.d.ts +14 -0
- package/dist/silke/src/components/silke-button/index.d.ts +7 -0
- package/dist/silke/src/components/silke-button/silke-big-button.d.ts +13 -0
- package/dist/silke/src/components/silke-button/silke-button-set.d.ts +11 -0
- package/dist/silke/src/components/silke-button/silke-button.d.ts +39 -0
- package/dist/silke/src/components/silke-button/silke-confirmation-button.d.ts +8 -0
- package/dist/silke/src/components/silke-button/silke-file-select-button.d.ts +9 -0
- package/dist/silke/src/components/silke-card/index.d.ts +2 -0
- package/dist/silke/src/components/silke-card/silke-card-grid.d.ts +10 -0
- package/dist/silke/src/components/silke-card/silke-card.d.ts +26 -0
- package/dist/silke/src/components/silke-checkbox/index.d.ts +1 -0
- package/dist/silke/src/components/silke-checkbox/silke-checkbox.d.ts +11 -0
- package/dist/silke/src/components/silke-code-editor/index.d.ts +3 -0
- package/dist/silke/src/components/silke-code-editor/silke-code-editor.d.ts +8 -0
- package/dist/silke/src/components/silke-code-snippet/index.d.ts +1 -0
- package/dist/silke/src/components/silke-code-snippet/silke-code-snippet.d.ts +17 -0
- package/dist/silke/src/components/silke-color-palettes/index.d.ts +2 -0
- package/dist/silke/src/components/silke-color-palettes/silke-color-palette.d.ts +12 -0
- package/dist/silke/src/components/silke-color-palettes/silke-color-palettes.d.ts +8 -0
- package/dist/silke/src/components/silke-color-picker/color.d.ts +31 -0
- package/dist/silke/src/components/silke-color-picker/hue.d.ts +7 -0
- package/dist/silke/src/components/silke-color-picker/index.d.ts +4 -0
- package/dist/silke/src/components/silke-color-picker/silke-color-info.d.ts +9 -0
- package/dist/silke/src/components/silke-color-picker/silke-color-picker-button.d.ts +11 -0
- package/dist/silke/src/components/silke-color-picker/silke-color-picker.d.ts +17 -0
- package/dist/silke/src/components/silke-color-picker/silke-color-space.d.ts +11 -0
- package/dist/silke/src/components/silke-color-picker/silke-hue-slider.d.ts +7 -0
- package/dist/silke/src/components/silke-color-picker/silke-opacity-slider.d.ts +8 -0
- package/dist/silke/src/components/silke-color-swatches/index.d.ts +2 -0
- package/dist/silke/src/components/silke-color-swatches/silke-color-swatch-button.d.ts +6 -0
- package/dist/silke/src/components/silke-color-swatches/silke-swatches.d.ts +25 -0
- package/dist/silke/src/components/silke-color-swatches/utils.d.ts +12 -0
- package/dist/silke/src/components/silke-content-column/index.d.ts +1 -0
- package/dist/silke/src/components/silke-content-column/silke-content-column.d.ts +7 -0
- package/dist/silke/src/components/silke-context-menu/index.d.ts +2 -0
- package/dist/silke/src/components/silke-context-menu/silke-contect-menu-hooks.d.ts +0 -0
- package/dist/silke/src/components/silke-context-menu/silke-context-menu-item.d.ts +12 -0
- package/dist/silke/src/components/silke-context-menu/silke-context-menu.d.ts +15 -0
- package/dist/silke/src/components/silke-css-number-field/index.d.ts +2 -0
- package/dist/silke/src/components/silke-css-number-field/silke-css-context.d.ts +29 -0
- package/dist/silke/src/components/silke-css-number-field/silke-css-number-field.d.ts +15 -0
- package/dist/silke/src/components/silke-css-number-field/utils.d.ts +32 -0
- package/dist/silke/src/components/silke-divider/index.d.ts +1 -0
- package/dist/silke/src/components/silke-divider/silke-divider.d.ts +13 -0
- package/dist/silke/src/components/silke-drawer/index.d.ts +1 -0
- package/dist/silke/src/components/silke-drawer/silke-drawer.d.ts +12 -0
- package/dist/silke/src/components/silke-form/form-context.d.ts +26 -0
- package/dist/silke/src/components/silke-form/form-types.d.ts +44 -0
- package/dist/silke/src/components/silke-form/index.d.ts +2 -0
- package/dist/silke/src/components/silke-form/silke-form.d.ts +22 -0
- package/dist/silke/src/components/silke-form-schema/fields/array-field-inline.d.ts +12 -0
- package/dist/silke/src/components/silke-form-schema/fields/array-field-modal.d.ts +13 -0
- package/dist/silke/src/components/silke-form-schema/fields/array-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/event-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/icon-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/image-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/layout-field.d.ts +3 -0
- package/dist/silke/src/components/silke-form-schema/fields/link-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/number-field.d.ts +6 -0
- package/dist/silke/src/components/silke-form-schema/fields/object-field.d.ts +3 -0
- package/dist/silke/src/components/silke-form-schema/fields/select-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/string-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/toggle-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/upload-field.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/fields/utils/generate-image.d.ts +3 -0
- package/dist/silke/src/components/silke-form-schema/fields/utils/generate-title.d.ts +7 -0
- package/dist/silke/src/components/silke-form-schema/fields/utils/index.d.ts +2 -0
- package/dist/silke/src/components/silke-form-schema/fields/utils/schema-util.d.ts +2 -0
- package/dist/silke/src/components/silke-form-schema/index.d.ts +4 -0
- package/dist/silke/src/components/silke-form-schema/safe-eval/iframe-handler.d.ts +17 -0
- package/dist/silke/src/components/silke-form-schema/safe-eval/index.d.ts +1 -0
- package/dist/silke/src/components/silke-form-schema/safe-eval/safe-eval.d.ts +1 -0
- package/dist/silke/src/components/silke-form-schema/schema-utils.d.ts +11 -0
- package/dist/silke/src/components/silke-form-schema/silke-extended-fields-context.d.ts +13 -0
- package/dist/silke/src/components/silke-form-schema/silke-form-schema.d.ts +13 -0
- package/dist/silke/src/components/silke-form-schema/silke-schema-context.d.ts +9 -0
- package/dist/silke/src/components/silke-form-schema/silke-schema-field.d.ts +10 -0
- package/dist/silke/src/components/silke-form-schema/silke-schema-fields.d.ts +14 -0
- package/dist/silke/src/components/silke-gradient-picker/index.d.ts +1 -0
- package/dist/silke/src/components/silke-gradient-picker/silke-gradient-picker.d.ts +5 -0
- package/dist/silke/src/components/silke-gradient-picker/silke-gradient-position.d.ts +8 -0
- package/dist/silke/src/components/silke-gradient-picker/silke-gradient-slider.d.ts +10 -0
- package/dist/silke/src/components/silke-gradient-picker/silke-gradient-utils.d.ts +14 -0
- package/dist/silke/src/components/silke-icon/index.d.ts +2 -0
- package/dist/silke/src/components/silke-icon/silke-icon.d.ts +11 -0
- package/dist/silke/src/components/silke-icon/silke-shape.d.ts +8 -0
- package/dist/silke/src/components/silke-icon/silke-stacked-icon.d.ts +8 -0
- package/dist/silke/src/components/silke-icon-picker/emoji-tab.d.ts +3 -0
- package/dist/silke/src/components/silke-icon-picker/icons-tab.d.ts +3 -0
- package/dist/silke/src/components/silke-icon-picker/index.d.ts +1 -0
- package/dist/silke/src/components/silke-icon-picker/silke-icon-picker.d.ts +12 -0
- package/dist/silke/src/components/silke-icon-picker/upload-tab.d.ts +3 -0
- package/dist/silke/src/components/silke-icon-picker/utils.d.ts +5 -0
- package/dist/silke/src/components/silke-iframe-portal/index.d.ts +4 -0
- package/dist/silke/src/components/silke-iframe-portal/silke-iframe-context.d.ts +7 -0
- package/dist/silke/src/components/silke-iframe-portal/silke-iframe-css-link.d.ts +5 -0
- package/dist/silke/src/components/silke-iframe-portal/silke-iframe-portal.d.ts +10 -0
- package/dist/silke/src/components/silke-iframe-portal/silke-iframe-script.d.ts +6 -0
- package/dist/silke/src/components/silke-image/index.d.ts +2 -0
- package/dist/silke/src/components/silke-image/silke-image-color-backdrop.d.ts +7 -0
- package/dist/silke/src/components/silke-image/silke-image.d.ts +11 -0
- package/dist/silke/src/components/silke-link/index.d.ts +1 -0
- package/dist/silke/src/components/silke-link/silke-link.d.ts +23 -0
- package/dist/silke/src/components/silke-list/index.d.ts +2 -0
- package/dist/silke/src/components/silke-list/silke-list-item.d.ts +7 -0
- package/dist/silke/src/components/silke-list/silke-list.d.ts +10 -0
- package/dist/silke/src/components/silke-list-card/index.d.ts +1 -0
- package/dist/silke/src/components/silke-list-card/silke-list-card.d.ts +14 -0
- package/dist/silke/src/components/silke-loader/index.d.ts +2 -0
- package/dist/silke/src/components/silke-loader/silke-loader-overlay.d.ts +18 -0
- package/dist/silke/src/components/silke-loader/silke-loader.d.ts +18 -0
- package/dist/silke/src/components/silke-modal/index.d.ts +2 -0
- package/dist/silke/src/components/silke-modal/silke-confirmation-modal.d.ts +31 -0
- package/dist/silke/src/components/silke-modal/silke-modal.d.ts +18 -0
- package/dist/silke/src/components/silke-navigation-link/index.d.ts +1 -0
- package/dist/silke/src/components/silke-navigation-link/silke-navigation-link.d.ts +22 -0
- package/dist/silke/src/components/silke-notification/confetti.d.ts +2 -0
- package/dist/silke/src/components/silke-notification/index.d.ts +1 -0
- package/dist/silke/src/components/silke-notification/silke-notification.d.ts +22 -0
- package/dist/silke/src/components/silke-object-field/index.d.ts +1 -0
- package/dist/silke/src/components/silke-object-field/silke-object-field.d.ts +17 -0
- package/dist/silke/src/components/silke-overflow-menu/index.d.ts +1 -0
- package/dist/silke/src/components/silke-overflow-menu/silke-overflow-menu.d.ts +21 -0
- package/dist/silke/src/components/silke-popover/index.d.ts +1 -0
- package/dist/silke/src/components/silke-popover/popover-context.d.ts +8 -0
- package/dist/silke/src/components/silke-popover/silke-popover.d.ts +48 -0
- package/dist/silke/src/components/silke-progress-indicator/index.d.ts +2 -0
- package/dist/silke/src/components/silke-progress-indicator/silke-progress-indicator.d.ts +7 -0
- package/dist/silke/src/components/silke-progress-indicator/silke-progress-step.d.ts +11 -0
- package/dist/silke/src/components/silke-radio-button/index.d.ts +2 -0
- package/dist/silke/src/components/silke-radio-button/silke-radio-button-group.d.ts +15 -0
- package/dist/silke/src/components/silke-radio-button/silke-radio-button.d.ts +10 -0
- package/dist/silke/src/components/silke-search-field/index.d.ts +1 -0
- package/dist/silke/src/components/silke-search-field/silke-search-field.d.ts +8 -0
- package/dist/silke/src/components/silke-select-field/index.d.ts +1 -0
- package/dist/silke/src/components/silke-select-field/silke-select-field.d.ts +5 -0
- package/dist/silke/src/components/silke-skeleton/index.d.ts +1 -0
- package/dist/silke/src/components/silke-skeleton/silke-skeleton.d.ts +8 -0
- package/dist/silke/src/components/silke-slider/index.d.ts +1 -0
- package/dist/silke/src/components/silke-slider/silke-slider-point.d.ts +14 -0
- package/dist/silke/src/components/silke-slider/silke-slider-utils.d.ts +2 -0
- package/dist/silke/src/components/silke-slider/silke-slider.d.ts +20 -0
- package/dist/silke/src/components/silke-slider/slider-track.d.ts +9 -0
- package/dist/silke/src/components/silke-sortable-list/index.d.ts +2 -0
- package/dist/silke/src/components/silke-sortable-list/silke-nested-sortable-item.d.ts +16 -0
- package/dist/silke/src/components/silke-sortable-list/silke-nested-sortable-list.d.ts +25 -0
- package/dist/silke/src/components/silke-sortable-list/silke-nested-sortable-utils.d.ts +57 -0
- package/dist/silke/src/components/silke-sortable-list/silke-sortable-item-wrapper.d.ts +12 -0
- package/dist/silke/src/components/silke-sortable-list/silke-sortable-list.d.ts +15 -0
- package/dist/silke/src/components/silke-steps/index.d.ts +1 -0
- package/dist/silke/src/components/silke-steps/silke-steps.d.ts +12 -0
- package/dist/silke/src/components/silke-table/index.d.ts +2 -0
- package/dist/silke/src/components/silke-table/silke-table.d.ts +27 -0
- package/dist/silke/src/components/silke-table/table-row.d.ts +13 -0
- package/dist/silke/src/components/silke-table/table-types.d.ts +13 -0
- package/dist/silke/src/components/silke-tabs/index.d.ts +2 -0
- package/dist/silke/src/components/silke-tabs/silke-tab.d.ts +9 -0
- package/dist/silke/src/components/silke-tabs/silke-tabs.d.ts +8 -0
- package/dist/silke/src/components/silke-tag/index.d.ts +1 -0
- package/dist/silke/src/components/silke-tag/silke-tag.d.ts +40 -0
- package/dist/silke/src/components/silke-text/index.d.ts +3 -0
- package/dist/silke/src/components/silke-text/silke-text-types.d.ts +28 -0
- package/dist/silke/src/components/silke-text/silke-text.d.ts +275 -0
- package/dist/silke/src/components/silke-text/silke-title.d.ts +3 -0
- package/dist/silke/src/components/silke-text-field/index.d.ts +3 -0
- package/dist/silke/src/components/silke-text-field/silke-text-field-item.d.ts +8 -0
- package/dist/silke/src/components/silke-text-field/silke-text-field-outline.d.ts +38 -0
- package/dist/silke/src/components/silke-text-field/silke-text-field.d.ts +27 -0
- package/dist/silke/src/components/silke-text-field/text-field-context.d.ts +9 -0
- package/dist/silke/src/components/silke-theme-editor/index.d.ts +1 -0
- package/dist/silke/src/components/silke-theme-editor/silke-theme-editor.d.ts +9 -0
- package/dist/silke/src/components/silke-tile/index.d.ts +2 -0
- package/dist/silke/src/components/silke-tile/silke-tile-select.d.ts +26 -0
- package/dist/silke/src/components/silke-tile/silke-tile.d.ts +38 -0
- package/dist/silke/src/components/silke-toggle/index.d.ts +1 -0
- package/dist/silke/src/components/silke-toggle/silke-toggle.d.ts +12 -0
- package/dist/silke/src/components/silke-toolbar/index.d.ts +1 -0
- package/dist/silke/src/components/silke-toolbar/silke-toolbar.d.ts +7 -0
- package/dist/silke/src/components/silke-tooltip/index.d.ts +5 -0
- package/dist/silke/src/components/silke-tooltip/silke-definition-tooltip.d.ts +16 -0
- package/dist/silke/src/components/silke-tooltip/silke-icon-tooltip.d.ts +17 -0
- package/dist/silke/src/components/silke-tooltip/silke-interactive-tooltip.d.ts +24 -0
- package/dist/silke/src/components/silke-tooltip/silke-shortcuts.d.ts +37 -0
- package/dist/silke/src/components/silke-tooltip/silke-tooltip.d.ts +25 -0
- package/dist/silke/src/components/silke-tooltip/utils.d.ts +1 -0
- package/dist/silke/src/components/silke-upload-field/index.d.ts +1 -0
- package/dist/silke/src/components/silke-upload-field/silke-upload-field.d.ts +33 -0
- package/dist/silke/src/components/silke-virtual/index.d.ts +2 -0
- package/dist/silke/src/components/silke-virtual/silke-virtual-grid.d.ts +9 -0
- package/dist/silke/src/components/silke-virtual/silke-virtual-row.d.ts +10 -0
- package/dist/silke/src/docs/app.d.ts +4 -0
- package/dist/silke/src/docs/components/code-block/code-block.d.ts +6 -0
- package/dist/silke/src/docs/components/code-block/index.d.ts +1 -0
- package/dist/silke/src/docs/components/state-table/index.d.ts +1 -0
- package/dist/silke/src/docs/components/state-table/state-table.d.ts +14 -0
- package/dist/silke/src/docs/data/app/actions.d.ts +1 -0
- package/dist/silke/src/docs/data/app/constants.d.ts +6 -0
- package/dist/silke/src/docs/data/app/index.d.ts +3 -0
- package/dist/silke/src/docs/data/app/store.d.ts +8 -0
- package/dist/silke/src/docs/data/flux/action-decorator.d.ts +5 -0
- package/dist/silke/src/docs/data/flux/action-utils.d.ts +7 -0
- package/dist/silke/src/docs/data/flux/controller.d.ts +24 -0
- package/dist/silke/src/docs/data/flux/dispatcher.d.ts +7 -0
- package/dist/silke/src/docs/data/flux/index.d.ts +6 -0
- package/dist/silke/src/docs/data/flux/store.d.ts +15 -0
- package/dist/silke/src/docs/data/flux/use-store.d.ts +2 -0
- package/dist/silke/src/docs/docs-provider.d.ts +6 -0
- package/dist/silke/src/docs/index.d.ts +2 -0
- package/dist/silke/src/docs/ipsum-generator.d.ts +7 -0
- package/dist/silke/src/helpers/copy-to-clipboard.d.ts +5 -0
- package/dist/silke/src/helpers/key-code.d.ts +9 -0
- package/dist/silke/src/hooks/drag-and-drop/index.d.ts +2 -0
- package/dist/silke/src/hooks/drag-and-drop/use-drag.d.ts +10 -0
- package/dist/silke/src/hooks/drag-and-drop/use-drop.d.ts +8 -0
- package/dist/silke/src/hooks/form/index.d.ts +1 -0
- package/dist/silke/src/hooks/form/use-form-field.d.ts +5 -0
- package/dist/silke/src/hooks/image-colors/use-image-colors.d.ts +10 -0
- package/dist/silke/src/hooks/index.d.ts +13 -0
- package/dist/silke/src/hooks/use-callback-ref.d.ts +2 -0
- package/dist/silke/src/hooks/use-dragging.d.ts +1 -0
- package/dist/silke/src/hooks/use-drop-zone.d.ts +2 -0
- package/dist/silke/src/hooks/use-html-element.d.ts +2 -0
- package/dist/silke/src/hooks/use-interval.d.ts +6 -0
- package/dist/silke/src/hooks/use-mouse.d.ts +40 -0
- package/dist/silke/src/hooks/use-parent-scroll.d.ts +2 -0
- package/dist/silke/src/hooks/use-scroll.d.ts +1 -0
- package/dist/silke/src/hooks/use-size.d.ts +4 -0
- package/dist/silke/src/hooks/use-uniq-id.d.ts +1 -0
- package/dist/silke/src/hooks/use-window-resize.d.ts +1 -0
- package/dist/silke/src/icons.d.ts +356 -0
- package/dist/silke/src/index.d.ts +5 -0
- package/dist/silke/src/main.d.ts +1 -0
- package/dist/silke/src/silke-theme-provider.d.ts +16 -0
- package/dist/silke-code-editor-4TSQ5KJ3.js +25 -0
- package/dist/silke-code-editor-4TSQ5KJ3.js.map +7 -0
- package/dist/styles.css +826 -890
- package/dist/utils/src/color/hex.d.ts +2 -0
- package/dist/utils/src/color/index.d.ts +1 -0
- package/dist/utils/src/constants.d.ts +2 -0
- package/dist/utils/src/css/computed-to-css.d.ts +8 -0
- package/dist/utils/src/css/computed.d.ts +5 -0
- package/dist/utils/src/css/index.d.ts +4 -0
- package/dist/utils/src/css/number-format.d.ts +1 -0
- package/dist/utils/src/css/utils.d.ts +14 -0
- package/dist/utils/src/events/condition-parser/evaluate-condition-expression.d.ts +2 -0
- package/dist/utils/src/events/condition-parser/index.d.ts +1 -0
- package/dist/utils/src/events/condition-parser/lexer.d.ts +36 -0
- package/dist/utils/src/events/condition-parser/parser.d.ts +11 -0
- package/dist/utils/src/index.d.ts +10 -0
- package/dist/utils/src/interactions/get-interaction-map.d.ts +3 -0
- package/dist/utils/src/interactions/get-node-type.d.ts +2 -0
- package/dist/utils/src/interactions/has-link.d.ts +5 -0
- package/dist/utils/src/interactions/has-pointer-event.d.ts +5 -0
- package/dist/utils/src/interactions/index.d.ts +7 -0
- package/dist/utils/src/interactions/interaction-map-to-array.d.ts +2 -0
- package/dist/utils/src/interactions/is-target-global.d.ts +2 -0
- package/dist/utils/src/interactions/is-trigger-global.d.ts +2 -0
- package/dist/utils/src/keyboard/hooks.d.ts +8 -0
- package/dist/utils/src/keyboard/index.d.ts +4 -0
- package/dist/utils/src/keyboard/key-list.d.ts +4 -0
- package/dist/utils/src/keyboard/keyboard.d.ts +70 -0
- package/dist/utils/src/keyboard/keys.d.ts +4 -0
- package/dist/utils/src/math/index.d.ts +9 -0
- package/dist/utils/src/mouse/index.d.ts +3 -0
- package/dist/utils/src/mouse/mouse-manager.d.ts +52 -0
- package/dist/utils/src/types/content.d.ts +11 -0
- package/dist/utils/src/types/context.d.ts +74 -0
- package/dist/utils/src/types/css.d.ts +131 -0
- package/dist/utils/src/types/editable-css.d.ts +7 -0
- package/dist/utils/src/types/emoji.d.ts +28 -0
- package/dist/utils/src/types/event.d.ts +7 -0
- package/dist/utils/src/types/icon.d.ts +10 -0
- package/dist/utils/src/types/index.d.ts +18 -0
- package/dist/utils/src/types/interaction.d.ts +86 -0
- package/dist/utils/src/types/link.d.ts +47 -0
- package/dist/utils/src/types/manifest.d.ts +54 -0
- package/dist/utils/src/types/oauth.d.ts +13 -0
- package/dist/utils/src/types/project.d.ts +23 -0
- package/dist/utils/src/types/shape.d.ts +20 -0
- package/dist/utils/src/types/transition.d.ts +15 -0
- package/dist/utils/src/types/vev-plugin.d.ts +61 -0
- package/dist/utils/src/types/vev-props.d.ts +154 -0
- package/dist/utils/src/types/widget-manifest.d.ts +69 -0
- package/dist/utils/src/types/widget.d.ts +36 -0
- package/dist/utils/src/utils/generate-guid.d.ts +1 -0
- package/dist/utils/src/utils/index.d.ts +7 -0
- package/dist/utils/src/utils/internals/asciiToArray.d.ts +9 -0
- package/dist/utils/src/utils/internals/castSlice.d.ts +11 -0
- package/dist/utils/src/utils/internals/createCaseFirst.d.ts +9 -0
- package/dist/utils/src/utils/internals/getTag.d.ts +9 -0
- package/dist/utils/src/utils/internals/hasUnicode.d.ts +9 -0
- package/dist/utils/src/utils/internals/stringToArray.d.ts +9 -0
- package/dist/utils/src/utils/internals/unicodeToArray.d.ts +9 -0
- package/dist/utils/src/utils/internals/unicodeWords.d.ts +9 -0
- package/dist/utils/src/utils/internals/upperFirst.d.ts +18 -0
- package/dist/utils/src/utils/is-array.d.ts +25 -0
- package/dist/utils/src/utils/is-length.d.ts +26 -0
- package/dist/utils/src/utils/is-string.d.ts +17 -0
- package/dist/utils/src/utils/slice.d.ts +22 -0
- package/dist/utils/src/utils/start-case.d.ts +22 -0
- package/dist/utils/src/utils/string.d.ts +5 -0
- package/dist/utils/src/utils/words.d.ts +18 -0
- package/package.json +10 -9
- package/src/components/index.ts +1 -0
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +1 -0
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +1 -1
- package/src/components/silke-autocomplete-field/index.ts +4 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -4
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +14 -9
- package/src/components/silke-box/silke-box.mdx +2 -2
- package/src/components/silke-box/silke-box.scss +2 -1
- package/src/components/silke-box/silke-box.tsx +1 -2
- package/src/components/silke-button/silke-button.scss +2 -2
- package/src/components/silke-card/silke-card-grid.tsx +16 -15
- package/src/components/silke-card/silke-card.mdx +56 -23
- package/src/components/silke-card/silke-card.scss +172 -112
- package/src/components/silke-card/silke-card.tsx +191 -112
- package/src/components/silke-code-snippet/silke-code-snippet.tsx +2 -2
- package/src/components/silke-color-picker/color-picker.scss +29 -24
- package/src/components/silke-color-picker/hue.ts +72 -0
- package/src/components/silke-color-picker/index.ts +2 -1
- package/src/components/silke-color-picker/silke-color-picker.mdx +18 -0
- package/src/components/silke-color-picker/silke-color-picker.tsx +5 -5
- package/src/components/silke-color-picker/silke-color-space.tsx +0 -2
- package/src/components/silke-color-picker/silke-hue-slider.tsx +23 -8
- package/src/components/silke-color-picker/silke-opacity-slider.tsx +10 -12
- package/src/components/silke-content-column/silke-content-column.scss +2 -37
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -2
- package/src/components/silke-form/form-context.tsx +5 -5
- package/src/components/silke-form/form-types.ts +1 -0
- package/src/components/silke-form/silke-form.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/image-field.tsx +4 -2
- package/src/components/silke-form-schema/fields/link-field.tsx +2 -6
- package/src/components/silke-form-schema/fields/number-field.tsx +53 -36
- package/src/components/silke-form-schema/fields/object-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/select-field.tsx +37 -54
- package/src/components/silke-form-schema/fields/string-field.tsx +7 -8
- package/src/components/silke-form-schema/fields/styles.scss +3 -1
- package/src/components/silke-form-schema/fields/toggle-field.tsx +9 -12
- package/src/components/silke-form-schema/fields/upload-field.tsx +2 -4
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +3 -3
- package/src/components/silke-form-schema/silke-form-schema.mdx +14 -26
- package/src/components/silke-form-schema/silke-form-schema.tsx +11 -3
- package/src/components/silke-form-schema/silke-schema-context.tsx +5 -2
- package/src/components/silke-form-schema/silke-schema-field.tsx +36 -40
- package/src/components/silke-form-schema/silke-schema-fields.tsx +40 -15
- package/src/components/silke-gradient-picker/index.ts +1 -0
- package/src/components/silke-gradient-picker/silke-gradient-picker.mdx +13 -0
- package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +71 -0
- package/src/components/silke-gradient-picker/silke-gradient-picker.tsx +71 -0
- package/src/components/silke-gradient-picker/silke-gradient-position.tsx +160 -0
- package/src/components/silke-gradient-picker/silke-gradient-slider.tsx +57 -0
- package/src/components/silke-gradient-picker/silke-gradient-utils.ts +132 -0
- package/src/components/silke-icon-picker/silke-icon-picker.tsx +1 -1
- package/src/components/silke-image/index.ts +1 -0
- package/src/components/silke-image/silke-image-color-backdrop.scss +10 -0
- package/src/components/silke-image/silke-image-color-backdrop.tsx +32 -0
- package/src/components/silke-image/silke-image.tsx +6 -2
- package/src/components/silke-list-card/silke-list-card.tsx +0 -2
- package/src/components/silke-modal/silke-confirmation-modal.tsx +33 -11
- package/src/components/silke-modal/silke-modal.mdx +24 -0
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +83 -76
- package/src/components/silke-object-field/silke-object-field.tsx +1 -1
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +2 -1
- package/src/components/silke-radio-button/silke-radio-button-group.tsx +6 -23
- package/src/components/silke-slider/index.ts +0 -1
- package/src/components/silke-slider/silke-slider-point.tsx +43 -0
- package/src/components/silke-slider/silke-slider-utils.ts +32 -0
- package/src/components/silke-slider/silke-slider.mdx +45 -0
- package/src/components/silke-slider/silke-slider.module.scss +71 -0
- package/src/components/silke-slider/silke-slider.tsx +160 -66
- package/src/components/silke-slider/slider-track.tsx +26 -0
- package/src/components/silke-sortable-list/silke-sortable-item-wrapper.tsx +3 -0
- package/src/components/silke-sortable-list/silke-sortable-list.scss +8 -8
- package/src/components/silke-sortable-list/silke-sortable-list.tsx +24 -7
- package/src/components/silke-table/silke-table.tsx +5 -5
- package/src/components/silke-tabs/silke-tab.tsx +17 -50
- package/src/components/silke-tabs/silke-tabs.mdx +4 -16
- package/src/components/silke-tabs/silke-tabs.scss +24 -81
- package/src/components/silke-tabs/silke-tabs.tsx +12 -10
- package/src/components/silke-tag/silke-tag.mdx +78 -24
- package/src/components/silke-tag/silke-tag.scss +110 -118
- package/src/components/silke-tag/silke-tag.tsx +8 -4
- package/src/components/silke-text/silke-text-types.ts +5 -6
- package/src/components/silke-text/silke-text.mdx +45 -11
- package/src/components/silke-text/silke-text.scss +40 -19
- package/src/components/silke-text/silke-text.tsx +10 -16
- package/src/components/silke-text/silke-title.scss +36 -59
- package/src/components/silke-text/silke-title.tsx +27 -17
- package/src/components/silke-text-field/silke-text-field-outline.tsx +28 -16
- package/src/components/silke-text-field/silke-text-field.mdx +12 -0
- package/src/components/silke-text-field/silke-text-field.scss +8 -2
- package/src/components/silke-text-field/silke-text-field.tsx +8 -5
- package/src/components/silke-tooltip/silke-tooltip.tsx +3 -0
- package/src/components/silke-upload-field/silke-upload-field.tsx +21 -10
- package/src/docs/data/flux/action-decorator.ts +4 -4
- package/src/docs/data/flux/store.ts +4 -2
- package/src/hooks/drag-and-drop/use-drag.tsx +5 -3
- package/src/hooks/form/use-form-field.ts +4 -0
- package/src/hooks/image-colors/use-image-colors.ts +83 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-dragging.ts +24 -0
- package/src/icons.tsx +12 -35
- package/src/styles/core.scss +6 -48
- package/tsconfig.json +1 -0
- package/dist/silke-code-editor-LBP2WDX3.js +0 -25
- package/dist/silke-code-editor-LBP2WDX3.js.map +0 -7
- package/src/components/silke-slider/range-slider.scss +0 -52
- package/src/components/silke-slider/silke-range-slider.tsx +0 -108
- package/src/components/silke-text/silke-text-utils.ts +0 -8
- /package/dist/{chunk-SOFGXMET.js.LEGAL.txt → chunk-PP74IZDW.js.LEGAL.txt} +0 -0
- /package/dist/{silke-code-editor-LBP2WDX3.js.LEGAL.txt → silke-code-editor-4TSQ5KJ3.js.LEGAL.txt} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import classnames from 'classnames/bind';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { cl, getClassNames } from './silke-text-utils';
|
|
3
3
|
import { SilkeTextTextProps } from './silke-text-types';
|
|
4
|
+
import styles from './silke-text.scss';
|
|
5
|
+
|
|
6
|
+
export const cl = classnames.bind(styles);
|
|
4
7
|
|
|
5
8
|
export function SilkeText({
|
|
6
9
|
tag = 'span',
|
|
@@ -8,27 +11,18 @@ export function SilkeText({
|
|
|
8
11
|
weight,
|
|
9
12
|
flex,
|
|
10
13
|
overflow,
|
|
14
|
+
brandFont,
|
|
15
|
+
size,
|
|
11
16
|
...rest
|
|
12
17
|
}: SilkeTextTextProps) {
|
|
13
|
-
rest.className = cl('text', rest.className, color, weight, {
|
|
18
|
+
rest.className = cl('text', rest.className, color, weight, size, {
|
|
14
19
|
flex,
|
|
15
20
|
overflow,
|
|
21
|
+
brandFont,
|
|
16
22
|
});
|
|
17
23
|
return React.createElement(tag, rest);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
export const
|
|
21
|
-
return <SilkeText {...rest} className={getClassNames(className, 'font-large')} />;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const SilkeBodyText = ({ className, ...rest }: SilkeTextTextProps) => {
|
|
25
|
-
return <SilkeText {...rest} className={getClassNames(className, 'font-base')} />;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const SilkeTextSmall = ({ className, ...rest }: SilkeTextTextProps) => {
|
|
29
|
-
return <SilkeText {...rest} className={getClassNames(className, 'font-small')} />;
|
|
30
|
-
};
|
|
26
|
+
export const SilkeTextSmall = (props: SilkeTextTextProps) => <SilkeText {...props} size="small" />;
|
|
31
27
|
|
|
32
|
-
export const SilkeTextMicro = (
|
|
33
|
-
return <SilkeText {...rest} className={getClassNames(className, 'font-micro')} />;
|
|
34
|
-
};
|
|
28
|
+
export const SilkeTextMicro = (props: SilkeTextTextProps) => <SilkeText {...props} size="micro" />;
|
|
@@ -1,65 +1,42 @@
|
|
|
1
|
-
@use '../../variables' as *;
|
|
2
1
|
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
font-weight: $font-weight-header;
|
|
6
|
-
font-family: $font-family-brand;
|
|
2
|
+
.title{
|
|
3
|
+
&.xl {
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
&.strong {
|
|
11
|
-
font-weight: 600;
|
|
5
|
+
font-size: 59px;
|
|
6
|
+
line-height: 64px;
|
|
12
7
|
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
&.l {
|
|
11
|
+
|
|
12
|
+
font-size: 44px;
|
|
13
|
+
line-height: 48px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.m {
|
|
17
|
+
|
|
18
|
+
font-size: 33px;
|
|
19
|
+
line-height: 40px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.s {
|
|
23
|
+
|
|
24
|
+
font-size: 25px;
|
|
25
|
+
line-height: 32px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.xs {
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
line-height: 24px;
|
|
31
|
+
letter-spacing: 0.025em;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.xxs {
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 19px;
|
|
37
|
+
letter-spacing: -0.001em;
|
|
38
|
+
}
|
|
39
|
+
|
|
13
40
|
}
|
|
14
41
|
|
|
15
|
-
.xl {
|
|
16
|
-
@extend .headerCommons;
|
|
17
|
-
|
|
18
|
-
font-size: 59px;
|
|
19
|
-
line-height: 64px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.l {
|
|
24
|
-
@extend .headerCommons;
|
|
25
|
-
|
|
26
|
-
font-size: 44px;
|
|
27
|
-
line-height: 48px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.m {
|
|
31
|
-
@extend .headerCommons;
|
|
32
|
-
|
|
33
|
-
font-size: 33px;
|
|
34
|
-
line-height: 40px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.s {
|
|
38
|
-
@extend .headerCommons;
|
|
39
|
-
|
|
40
|
-
font-size: 25px;
|
|
41
|
-
line-height: 32px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.xs {
|
|
45
|
-
@extend .headerCommons;
|
|
46
|
-
|
|
47
|
-
font-size: 16px;
|
|
48
|
-
line-height: 24px;
|
|
49
|
-
letter-spacing: 0.025em;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.xxs {
|
|
53
|
-
@extend .headerCommons;
|
|
54
|
-
font-family: $font-family;
|
|
55
42
|
|
|
56
|
-
// TODO get real values, these were made up by myself - Peter
|
|
57
|
-
font-size: 14px;
|
|
58
|
-
line-height: 19px;
|
|
59
|
-
letter-spacing: -0.001em;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.xxs {
|
|
63
|
-
font-size: 14px;
|
|
64
|
-
line-height: 24px;
|
|
65
|
-
}
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import { SilkeTitleProps } from './silke-text-types';
|
|
2
|
-
import { cl } from './silke-text-utils';
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { SilkeText } from './silke-text';
|
|
4
3
|
import styles from './silke-title.scss';
|
|
4
|
+
import { SilkeTitleProps } from './silke-text-types';
|
|
5
5
|
|
|
6
|
-
export function SilkeTitle({
|
|
7
|
-
|
|
6
|
+
export function SilkeTitle({
|
|
7
|
+
tag,
|
|
8
|
+
kind,
|
|
9
|
+
color,
|
|
10
|
+
weight,
|
|
11
|
+
flex,
|
|
12
|
+
overflow,
|
|
13
|
+
size,
|
|
14
|
+
className,
|
|
15
|
+
...rest
|
|
16
|
+
}: SilkeTitleProps) {
|
|
8
17
|
const tagProp = tag || 'h2';
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
let cl = styles.title + ' ' + styles[kind];
|
|
19
|
+
if (className) cl += ' ' + className;
|
|
20
|
+
if (size) cl += ' ' + styles[size];
|
|
11
21
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
overflow
|
|
21
|
-
|
|
22
|
+
return (
|
|
23
|
+
<SilkeText
|
|
24
|
+
tag={tagProp}
|
|
25
|
+
className={cl}
|
|
26
|
+
color={color}
|
|
27
|
+
weight={weight}
|
|
28
|
+
flex={flex}
|
|
29
|
+
brandFont={kind !== 'xxs'}
|
|
30
|
+
overflow={overflow}
|
|
31
|
+
{...rest}
|
|
32
|
+
/>
|
|
22
33
|
);
|
|
23
|
-
return React.createElement(tagProp, rest);
|
|
24
34
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps, BoxSize, BoxSpace, SilkeBox } from '../silke-box';
|
|
3
3
|
import ButtonContext from '../silke-button/context';
|
|
4
|
-
import { SilkeIcon } from '../silke-icon';
|
|
5
4
|
import { SilkeText } from '../silke-text/silke-text';
|
|
6
5
|
import styles from './silke-text-field.scss';
|
|
7
6
|
import { useTextFieldContext } from './text-field-context';
|
|
8
7
|
import { SilkeTextFieldItem } from './silke-text-field-item';
|
|
8
|
+
import { SilkeIconTooltip } from '../silke-tooltip';
|
|
9
9
|
|
|
10
10
|
type InputSize = 'tiny' | 'small' | 'base' | 'large';
|
|
11
11
|
|
|
@@ -39,8 +39,7 @@ export type SilkeTextFieldOutlineProps = {
|
|
|
39
39
|
vAlign?: BoxProps['vAlign'];
|
|
40
40
|
/** Inline will add the label before the input field */
|
|
41
41
|
inline?: boolean | 'label-inside';
|
|
42
|
-
|
|
43
|
-
inlineLabelWidth?: number;
|
|
42
|
+
|
|
44
43
|
/** Field required input (if string the string will be used as error msg) */
|
|
45
44
|
/** Helpful tip or explanation of function of the field */
|
|
46
45
|
help?: React.ReactNode;
|
|
@@ -55,6 +54,7 @@ export type SilkeTextFieldOutlineProps = {
|
|
|
55
54
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
56
55
|
onMouseDown?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
57
56
|
disabled?: boolean;
|
|
57
|
+
tooltip?: string;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextFieldOutlineProps>(
|
|
@@ -81,7 +81,7 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
81
81
|
onClick,
|
|
82
82
|
onMouseDown,
|
|
83
83
|
disabled,
|
|
84
|
-
|
|
84
|
+
tooltip,
|
|
85
85
|
}: SilkeTextFieldOutlineProps,
|
|
86
86
|
ref,
|
|
87
87
|
) => {
|
|
@@ -104,16 +104,23 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
104
104
|
const boxSize: BoxSize = size === 'xs' ? 's' : size === 's' ? 'base' : 'm';
|
|
105
105
|
|
|
106
106
|
const labelComponent = label && (
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
<SilkeBox vAlign="center" flex>
|
|
108
|
+
<SilkeText
|
|
109
|
+
className={styles.label}
|
|
110
|
+
tag="label"
|
|
111
|
+
id={labelUsingAria ? labelId : undefined}
|
|
112
|
+
htmlFor={!labelUsingAria ? labelId : undefined}
|
|
113
|
+
color="neutral-100"
|
|
114
|
+
size={size === 'xs' ? 'small' : 'base'}
|
|
115
|
+
>
|
|
116
|
+
{label}
|
|
117
|
+
</SilkeText>
|
|
118
|
+
{tooltip && (
|
|
119
|
+
<SilkeBox style={{ height: '10px', marginTop: '-13px' }}>
|
|
120
|
+
<SilkeIconTooltip tooltip={tooltip} icon="tooltip" />
|
|
121
|
+
</SilkeBox>
|
|
122
|
+
)}
|
|
123
|
+
</SilkeBox>
|
|
117
124
|
);
|
|
118
125
|
return (
|
|
119
126
|
<SilkeBox
|
|
@@ -151,13 +158,18 @@ export const SilkeTextFieldOutline = React.forwardRef<HTMLDivElement, SilkeTextF
|
|
|
151
158
|
{!inline && (
|
|
152
159
|
<SilkeBox hAlign="spread" className={styles.help}>
|
|
153
160
|
{showHelp && help && (
|
|
154
|
-
<SilkeText flex id={helpId}>
|
|
161
|
+
<SilkeText flex id={helpId} size={size === 'xs' ? 'micro' : 'base'}>
|
|
155
162
|
{help}
|
|
156
163
|
</SilkeText>
|
|
157
164
|
)}
|
|
158
165
|
{showHelp && helpRight && <SilkeText>{helpRight}</SilkeText>}
|
|
159
166
|
{showError && (
|
|
160
|
-
<SilkeText
|
|
167
|
+
<SilkeText
|
|
168
|
+
flex
|
|
169
|
+
aria-live="polite"
|
|
170
|
+
role="alert"
|
|
171
|
+
size={size === 'xs' ? 'micro' : 'base'}
|
|
172
|
+
>
|
|
161
173
|
{error}
|
|
162
174
|
</SilkeText>
|
|
163
175
|
)}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
--text-field-error-border-color: var(--color-error-20);
|
|
22
22
|
|
|
23
23
|
--text-field-border-radius: var(--border-radius-small);
|
|
24
|
+
--text-field-label-weight: 600;
|
|
24
25
|
|
|
25
26
|
----current-border-color:transparent;
|
|
26
27
|
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
.tiny {
|
|
113
114
|
--text-field-font-size: 12px;
|
|
114
115
|
--text-field-height: 24px;
|
|
116
|
+
--text-field-label-weight: 400;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
.small {
|
|
@@ -122,7 +124,6 @@
|
|
|
122
124
|
.field {
|
|
123
125
|
position: relative;
|
|
124
126
|
background-color: var(--text-field-bg);
|
|
125
|
-
overflow: hidden;
|
|
126
127
|
border-radius: var(--text-field-border-radius);
|
|
127
128
|
transition: color 80ms;
|
|
128
129
|
|
|
@@ -145,7 +146,7 @@
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
.label {
|
|
148
|
-
font-weight:
|
|
149
|
+
font-weight: var(--text-field-label-weight);
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
.help {
|
|
@@ -158,6 +159,11 @@
|
|
|
158
159
|
line-height: 1;
|
|
159
160
|
}
|
|
160
161
|
|
|
162
|
+
.helpSmall {
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
font-weight: 400;
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
.input,
|
|
162
168
|
[data-input] {
|
|
163
169
|
@include font(14px);
|
|
@@ -40,7 +40,10 @@ type OmitAttrs =
|
|
|
40
40
|
| 'readonly'
|
|
41
41
|
| 'onBlur';
|
|
42
42
|
|
|
43
|
-
type MultilineProps = {
|
|
43
|
+
type MultilineProps = {
|
|
44
|
+
multiline: boolean | number | undefined;
|
|
45
|
+
type?: string;
|
|
46
|
+
} & BaseProps<string> &
|
|
44
47
|
Omit<HTMLAttributes<HTMLTextAreaElement>, OmitAttrs>;
|
|
45
48
|
export type SingleLineProps = {
|
|
46
49
|
multiline?: undefined | false;
|
|
@@ -83,8 +86,8 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
83
86
|
kind,
|
|
84
87
|
inline,
|
|
85
88
|
disabled,
|
|
86
|
-
inlineLabelWidth,
|
|
87
89
|
readOnly,
|
|
90
|
+
tooltip,
|
|
88
91
|
...rest
|
|
89
92
|
} = useFormField(props, validateText);
|
|
90
93
|
|
|
@@ -103,10 +106,10 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
103
106
|
useEffect(() => {
|
|
104
107
|
if (autoFocus && inputRef && inputRef.current) {
|
|
105
108
|
const inputField = inputRef.current;
|
|
106
|
-
// Need to wrap this in setTimeout to increase chance of it being focused when inside a popover
|
|
109
|
+
// Need to wrap this in setTimeout to increase the chance of it being focused when inside a popover
|
|
107
110
|
setTimeout(() => {
|
|
108
111
|
inputField.focus();
|
|
109
|
-
// For some strange reason you can't do range select on email and password fields
|
|
112
|
+
// For some strange reason, you can't do range select on email and password fields
|
|
110
113
|
if (!type || type === 'text') inputField.setSelectionRange(0, inputField.value.length);
|
|
111
114
|
}, 0);
|
|
112
115
|
}
|
|
@@ -136,7 +139,6 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
136
139
|
className={className}
|
|
137
140
|
error={error}
|
|
138
141
|
inline={inline}
|
|
139
|
-
inlineLabelWidth={inlineLabelWidth}
|
|
140
142
|
helpId={helpId}
|
|
141
143
|
labelId={inputId}
|
|
142
144
|
help={help}
|
|
@@ -144,6 +146,7 @@ export const SilkeTextField = React.forwardRef<HTMLDivElement, SilkeTextFieldPro
|
|
|
144
146
|
label={label}
|
|
145
147
|
flex={flex}
|
|
146
148
|
disabled={disabled}
|
|
149
|
+
tooltip={tooltip}
|
|
147
150
|
>
|
|
148
151
|
{before}
|
|
149
152
|
{React.createElement(multiline ? 'textarea' : 'input', {
|
|
@@ -37,6 +37,7 @@ export type SilkeTooltipProps = {
|
|
|
37
37
|
anchorOrigin?: PopoverOrigin;
|
|
38
38
|
title?: string;
|
|
39
39
|
children?: React.ReactNode;
|
|
40
|
+
onRequestClose?: () => void;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -53,6 +54,7 @@ export function SilkeTooltip({
|
|
|
53
54
|
image,
|
|
54
55
|
size,
|
|
55
56
|
title,
|
|
57
|
+
onRequestClose,
|
|
56
58
|
}: SilkeTooltipProps) {
|
|
57
59
|
const targetRef = useRef<HTMLDivElement>(null);
|
|
58
60
|
const pathRef = useRef<SVGPathElement>(null);
|
|
@@ -142,6 +144,7 @@ export function SilkeTooltip({
|
|
|
142
144
|
targetOrigin={targetOrigin}
|
|
143
145
|
offsetY={anchorV === 'center' ? 0 : anchorV === 'top' ? -6 : 6}
|
|
144
146
|
offsetX={anchorH === 'center' ? 0 : anchorH === 'left' ? -6 : 6}
|
|
147
|
+
onRequestClose={onRequestClose}
|
|
145
148
|
>
|
|
146
149
|
<div className={cl} ref={targetRef}>
|
|
147
150
|
<svg>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isArray, isString, last } from 'lodash';
|
|
2
2
|
import React, { useRef, useState } from 'react';
|
|
3
|
-
import { useDropZone } from '../../hooks';
|
|
4
|
-
import { useFormField } from '../../hooks/form';
|
|
3
|
+
import { useDropZone, useFormField } from '../../hooks';
|
|
5
4
|
import { useSilkeContext } from '../../silke-theme-provider';
|
|
6
5
|
import { BoxLabelProps, SilkeBox } from '../silke-box';
|
|
7
6
|
import { SilkeButton } from '../silke-button';
|
|
@@ -36,6 +35,7 @@ type BaseProps = {
|
|
|
36
35
|
useFileModel?: boolean;
|
|
37
36
|
multiple?: boolean;
|
|
38
37
|
autoFocus?: boolean;
|
|
38
|
+
onSelectFiles?: (value: any) => void;
|
|
39
39
|
} & Omit<BoxLabelProps, 'onChange'>;
|
|
40
40
|
|
|
41
41
|
type SingleField = { multiple?: false | undefined } & BaseProps &
|
|
@@ -54,6 +54,7 @@ const validate: FormValidator<SilkeUploadFieldProps> = (props, value) => {
|
|
|
54
54
|
export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
55
55
|
const { onFileUpload } = useSilkeContext();
|
|
56
56
|
const [pending, setPending] = useState<PendingFile[]>([]);
|
|
57
|
+
const size = props.size || 'base';
|
|
57
58
|
|
|
58
59
|
const {
|
|
59
60
|
useFileModel,
|
|
@@ -81,7 +82,6 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
81
82
|
|
|
82
83
|
pendingRef.current = pending;
|
|
83
84
|
valueRef.current = value;
|
|
84
|
-
|
|
85
85
|
const handleFileUploaded = (model: PendingFile, url: string) => {
|
|
86
86
|
// Do not continue if upload stopped
|
|
87
87
|
if (model.stopped) return;
|
|
@@ -176,7 +176,10 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
176
176
|
maxLength={1024}
|
|
177
177
|
name={name}
|
|
178
178
|
multiple={multiple}
|
|
179
|
-
onChange={(e) =>
|
|
179
|
+
onChange={(e) => {
|
|
180
|
+
if (props.onSelectFiles) return props.onSelectFiles(e.currentTarget.files);
|
|
181
|
+
handleFiles(e.currentTarget.files);
|
|
182
|
+
}}
|
|
180
183
|
/>
|
|
181
184
|
<SilkeBox
|
|
182
185
|
pad="m"
|
|
@@ -184,16 +187,24 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
184
187
|
className={styles.drop}
|
|
185
188
|
ref={ref}
|
|
186
189
|
column
|
|
187
|
-
bg="
|
|
190
|
+
bg="neutral-10"
|
|
188
191
|
style={dropzoneStyle}
|
|
189
192
|
>
|
|
190
|
-
<SilkeIcon icon="file" className={styles.icon} />
|
|
191
|
-
<SilkeBox column>
|
|
192
|
-
<SilkeTitle kind=
|
|
193
|
+
<SilkeIcon icon="file.arrow.up" className={styles.icon} />
|
|
194
|
+
<SilkeBox column gap="s">
|
|
195
|
+
<SilkeTitle kind={size === 'xs' ? 'xxs' : 'xs'}>
|
|
193
196
|
Select a file <span style={{ color: 'white' }}>drag and drop here</span>
|
|
194
197
|
</SilkeTitle>
|
|
195
|
-
{help && !error &&
|
|
196
|
-
|
|
198
|
+
{help && !error && (
|
|
199
|
+
<SilkeText size={size === 'xs' ? 'small' : 'base'} color="neutral-80">
|
|
200
|
+
{help}
|
|
201
|
+
</SilkeText>
|
|
202
|
+
)}
|
|
203
|
+
{error && (
|
|
204
|
+
<SilkeText size={size === 'xs' ? 'small' : 'base'} color="error-30">
|
|
205
|
+
{error}
|
|
206
|
+
</SilkeText>
|
|
207
|
+
)}
|
|
197
208
|
</SilkeBox>
|
|
198
209
|
</SilkeBox>
|
|
199
210
|
</SilkeBox>
|
|
@@ -3,12 +3,12 @@ import { Store } from './store';
|
|
|
3
3
|
export const actionListeners: { [event: string]: PropertyDescriptor[] } = {};
|
|
4
4
|
export function action(...events: string[]) {
|
|
5
5
|
return function <T extends Store>(target: T, funcName: string, descriptor: PropertyDescriptor) {
|
|
6
|
-
const actions = Reflect.get(target, '__actions') || {};
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const actions: Record<string, any> = Reflect.get(target, '__actions') || {};
|
|
7
|
+
|
|
8
|
+
events.forEach((event, i) => {
|
|
9
9
|
if (!actions[event]) actions[event] = [];
|
|
10
10
|
actions[event].push(funcName);
|
|
11
|
-
}
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
Reflect.set(target, '__actions', actions);
|
|
14
14
|
return descriptor;
|
|
@@ -30,12 +30,14 @@ export class Store extends QueuedModel {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
protected handleDispatch({ type, payload }: { type: string; payload: any }) {
|
|
33
|
-
const actions = Reflect.get(this, '__actions')
|
|
33
|
+
const actions = Reflect.get(this, '__actions') as Record<string, any>;
|
|
34
34
|
if (!actions) return;
|
|
35
|
+
|
|
35
36
|
const listeners = actions[type];
|
|
36
37
|
if (listeners) {
|
|
37
38
|
for (const funcName of listeners) {
|
|
38
|
-
// @ts-
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
+
// @ts-ignore don know how to make typescript support this
|
|
39
41
|
this[funcName](type, payload);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MutableRefObject, useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
type SilkeDragState = 'none' | 'dragging';
|
|
3
|
+
export type SilkeDragState = 'none' | 'dragging';
|
|
4
4
|
type DragData<T> = MutableRefObject<T>;
|
|
5
5
|
let dragData: DragData<any>;
|
|
6
6
|
export function getDragData(): DragData<any> {
|
|
@@ -9,9 +9,11 @@ export function getDragData(): DragData<any> {
|
|
|
9
9
|
|
|
10
10
|
export function useDrag<T>({
|
|
11
11
|
data,
|
|
12
|
+
disabled,
|
|
12
13
|
ref,
|
|
13
14
|
}: {
|
|
14
15
|
data: T;
|
|
16
|
+
disabled?: boolean;
|
|
15
17
|
ref: MutableRefObject<HTMLElement | undefined | null>;
|
|
16
18
|
}): SilkeDragState {
|
|
17
19
|
const [state, setState] = useState<SilkeDragState>('none');
|
|
@@ -20,7 +22,7 @@ export function useDrag<T>({
|
|
|
20
22
|
|
|
21
23
|
useEffect(() => {
|
|
22
24
|
const el = ref.current;
|
|
23
|
-
if (el) {
|
|
25
|
+
if (el && !disabled) {
|
|
24
26
|
const dragHandle = (el.querySelector('*[data-drag-handle]') || el) as HTMLElement;
|
|
25
27
|
dragHandle.setAttribute('draggable', 'true');
|
|
26
28
|
|
|
@@ -50,7 +52,7 @@ export function useDrag<T>({
|
|
|
50
52
|
dragHandle.removeAttribute('draggable');
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
|
-
}, [ref]);
|
|
55
|
+
}, [ref, disabled]);
|
|
54
56
|
|
|
55
57
|
return state;
|
|
56
58
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
type Vibrant = {
|
|
4
|
+
Quantizer: { WebWorker: any };
|
|
5
|
+
from: (imageUrl: string) => {
|
|
6
|
+
getPalette: () => Promise<{
|
|
7
|
+
DarkMuted: { getHex: () => string };
|
|
8
|
+
DarkVibrant: { getHex: () => string };
|
|
9
|
+
LightMuted: { getHex: () => string };
|
|
10
|
+
LightVibrant: { getHex: () => string };
|
|
11
|
+
Muted: { getHex: () => string };
|
|
12
|
+
Vibrant: { getHex: () => string };
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type ImagePalette = {
|
|
18
|
+
DarkMuted: string;
|
|
19
|
+
DarkVibrant: string;
|
|
20
|
+
LightMuted: string;
|
|
21
|
+
LightVibrant: string;
|
|
22
|
+
Muted: string;
|
|
23
|
+
Vibrant: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function loadVibrant(): Promise<Vibrant> {
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
const script = document.createElement('script');
|
|
29
|
+
script.src = 'https://cdn.jsdelivr.net/npm/node-vibrant@3.2.1-alpha.1/dist/vibrant.worker.js';
|
|
30
|
+
script.onload = () => {
|
|
31
|
+
resolve((window as any).Vibrant);
|
|
32
|
+
};
|
|
33
|
+
document.body.appendChild(script);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let vibrantPromise: Promise<Vibrant>;
|
|
38
|
+
|
|
39
|
+
async function generateColor(imageUrl: string): Promise<ImagePalette> {
|
|
40
|
+
if (!vibrantPromise) vibrantPromise = loadVibrant();
|
|
41
|
+
try {
|
|
42
|
+
const vibrant = await vibrantPromise;
|
|
43
|
+
const res = await vibrant.from(imageUrl).getPalette();
|
|
44
|
+
|
|
45
|
+
if (!res || !res.DarkMuted.getHex) throw new Error('No color');
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
DarkMuted: res.DarkMuted.getHex(),
|
|
49
|
+
DarkVibrant: res.DarkVibrant.getHex(),
|
|
50
|
+
LightMuted: res.LightMuted.getHex(),
|
|
51
|
+
LightVibrant: res.LightVibrant.getHex(),
|
|
52
|
+
Muted: res.Muted.getHex(),
|
|
53
|
+
Vibrant: res.Vibrant.getHex(),
|
|
54
|
+
};
|
|
55
|
+
} catch (e) {
|
|
56
|
+
return {
|
|
57
|
+
DarkMuted: 'var(--color-neutral-5)',
|
|
58
|
+
DarkVibrant: 'var(--color-neutral-5)',
|
|
59
|
+
LightMuted: 'var(--color-neutral-5)',
|
|
60
|
+
LightVibrant: 'var(--color-neutral-5)',
|
|
61
|
+
Muted: 'var(--color-neutral-5)',
|
|
62
|
+
Vibrant: 'var(--color-neutral-5)',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const cache: { [url: string]: Promise<ImagePalette> } = {};
|
|
68
|
+
const listeners: { [url: string]: (res: any) => void } = {};
|
|
69
|
+
|
|
70
|
+
function getImageColors(imageUrl: string) {
|
|
71
|
+
if (!cache[imageUrl]) cache[imageUrl] = generateColor(imageUrl);
|
|
72
|
+
|
|
73
|
+
return cache[imageUrl];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function useImageColors(imageUrl: string) {
|
|
77
|
+
const [color, setColor] = useState<ImagePalette | null>(null);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
getImageColors(imageUrl).then(setColor);
|
|
80
|
+
}, [imageUrl]);
|
|
81
|
+
|
|
82
|
+
return color;
|
|
83
|
+
}
|