@vev/silke 1.0.17 → 1.0.19
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 +15 -0
- package/dist/{chunk-SOFGXMET.js → chunk-FIPWO3IB.js} +3 -3
- package/dist/{chunk-SOFGXMET.js.map → chunk-FIPWO3IB.js.map} +1 -1
- package/dist/index.js +21 -22
- 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 +121 -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 +24 -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 +4 -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 +12 -0
- package/dist/silke/src/components/silke-tabs/silke-tabs.d.ts +10 -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 +39 -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 +32 -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 +353 -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-HB2Z4Q5W.js +25 -0
- package/dist/silke-code-editor-HB2Z4Q5W.js.map +7 -0
- package/dist/styles.css +682 -675
- 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-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 +5 -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 +17 -0
- package/dist/utils/src/types/interaction.d.ts +77 -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/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 +30 -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 -10
- package/src/components/index.ts +1 -0
- package/src/components/silke-autocomplete-field/autocomplete-tags.tsx +3 -3
- package/src/components/silke-autocomplete-field/index.ts +4 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +5 -2
- package/src/components/silke-box/silke-box.mdx +2 -1
- package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +5 -1
- package/src/components/silke-card/silke-card-grid.tsx +18 -15
- package/src/components/silke-card/silke-card.mdx +56 -23
- package/src/components/silke-card/silke-card.scss +150 -115
- package/src/components/silke-card/silke-card.tsx +173 -112
- package/src/components/silke-checkbox/silke-checkbox.mdx +11 -2
- package/src/components/silke-color-palettes/silke-color-palette.mdx +2 -2
- package/src/components/silke-color-picker/color-picker.scss +29 -24
- package/src/components/silke-color-picker/color.ts +12 -0
- package/src/components/silke-color-picker/hue.ts +72 -0
- package/src/components/silke-color-picker/index.ts +2 -0
- package/src/components/silke-color-picker/silke-color-picker.mdx +37 -9
- package/src/components/silke-color-picker/silke-color-picker.tsx +9 -18
- 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-item.tsx +5 -1
- package/src/components/silke-context-menu/silke-context-menu.scss +5 -1
- package/src/components/silke-context-menu/silke-context-menu.tsx +5 -3
- package/src/components/silke-drawer/silke-drawer.mdx +13 -13
- 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.mdx +15 -3
- package/src/components/silke-form/silke-form.tsx +1 -1
- package/src/components/silke-form-schema/fields/array-field.tsx +3 -3
- package/src/components/silke-form-schema/fields/event-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +40 -27
- package/src/components/silke-form-schema/fields/select-field.tsx +3 -8
- package/src/components/silke-form-schema/fields/string-field.tsx +29 -15
- package/src/components/silke-form-schema/fields/styles.scss +3 -1
- package/src/components/silke-form-schema/fields/toggle-field.tsx +2 -3
- package/src/components/silke-form-schema/fields/upload-field.tsx +2 -4
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +11 -4
- package/src/components/silke-form-schema/silke-form-schema.tsx +7 -2
- package/src/components/silke-form-schema/silke-schema-context.tsx +5 -2
- package/src/components/silke-form-schema/silke-schema-field.tsx +41 -44
- 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/silke-icon.tsx +3 -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-loader/silke-loader.mdx +3 -4
- 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.mdx +6 -1
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +83 -76
- package/src/components/silke-object-field/silke-object-field.mdx +10 -3
- package/src/components/silke-object-field/silke-object-field.tsx +1 -1
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +1 -0
- package/src/components/silke-progress-indicator/silke-progress-indicator.mdx +9 -3
- package/src/components/silke-radio-button/silke-radio-button-group.tsx +6 -23
- package/src/components/silke-radio-button/silke-radio-button.mdx +7 -1
- package/src/components/silke-search-field/silke-search-field.mdx +12 -4
- 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-tabs.mdx +2 -2
- package/src/components/silke-tag/silke-tag.mdx +51 -13
- package/src/components/silke-tag/silke-tag.scss +111 -80
- package/src/components/silke-tag/silke-tag.tsx +52 -24
- 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 -57
- package/src/components/silke-text/silke-title.tsx +27 -17
- package/src/components/silke-text-field/silke-text-field.scss +0 -1
- package/src/components/silke-text-field/silke-text-field.tsx +6 -3
- package/src/components/silke-tile/silke-tile.mdx +39 -8
- package/src/components/silke-toggle/silke-toggle.mdx +29 -5
- package/src/components/silke-toolbar/silke-toolbar.mdx +35 -15
- package/src/components/silke-tooltip/silke-tooltip.tsx +3 -0
- package/src/components/silke-upload-field/silke-upload-field.tsx +16 -9
- package/src/docs/data/flux/action-decorator.ts +4 -4
- package/src/docs/data/flux/store.ts +4 -2
- package/src/docs/parser.ts +1 -1
- package/src/hooks/drag-and-drop/use-drag.tsx +5 -3
- package/src/hooks/form/use-form-field.ts +4 -0
- package/src/hooks/hooks.mdx +3 -3
- 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 +5 -16
- package/src/styles/core.scss +0 -48
- package/tsconfig.json +1 -0
- package/dist/silke-code-editor-3Y2KM5KB.js +0 -25
- package/dist/silke-code-editor-3Y2KM5KB.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-FIPWO3IB.js.LEGAL.txt} +0 -0
- /package/dist/{silke-code-editor-3Y2KM5KB.js.LEGAL.txt → silke-code-editor-HB2Z4Q5W.js.LEGAL.txt} +0 -0
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
<p>Text info in this text</p>
|
|
7
7
|
</SilkeTile>
|
|
8
8
|
|
|
9
|
-
<SilkeTile
|
|
9
|
+
<SilkeTile
|
|
10
|
+
title="Clickable tile"
|
|
11
|
+
subTitle="With tags"
|
|
12
|
+
tags={["tags", "text"]}
|
|
13
|
+
onClick={() => {}}
|
|
14
|
+
>
|
|
10
15
|
<p>Text info in this text</p>
|
|
11
16
|
</SilkeTile>
|
|
12
|
-
<SilkeTile
|
|
17
|
+
<SilkeTile
|
|
18
|
+
title="Selected tile"
|
|
19
|
+
subTitle="Tile Sub Title"
|
|
20
|
+
selected
|
|
21
|
+
onClick={() => {}}
|
|
22
|
+
>
|
|
13
23
|
<p>Text info in this text</p>
|
|
14
24
|
</SilkeTile>
|
|
15
25
|
</SilkeBox>
|
|
@@ -19,7 +29,10 @@
|
|
|
19
29
|
|
|
20
30
|
```js
|
|
21
31
|
<SilkeBox column gap>
|
|
22
|
-
<SilkeTile
|
|
32
|
+
<SilkeTile
|
|
33
|
+
title="With menu"
|
|
34
|
+
menu={[{ label: "Item 1" }, { label: "Item 2" }]}
|
|
35
|
+
>
|
|
23
36
|
<p>Text info in this text</p>
|
|
24
37
|
</SilkeTile>
|
|
25
38
|
</SilkeBox>
|
|
@@ -30,7 +43,12 @@
|
|
|
30
43
|
```js
|
|
31
44
|
const [firstOpen, setFirstOpen] = React.useState();
|
|
32
45
|
<SilkeBox column gap>
|
|
33
|
-
<SilkeTile
|
|
46
|
+
<SilkeTile
|
|
47
|
+
title="Tile title"
|
|
48
|
+
subTitle="Tile Sub Title"
|
|
49
|
+
expandable
|
|
50
|
+
onExpand={setFirstOpen}
|
|
51
|
+
>
|
|
34
52
|
<h3>This text shows when expanded</h3>
|
|
35
53
|
{ipsum.p()}
|
|
36
54
|
</SilkeTile>
|
|
@@ -57,7 +75,12 @@ const handleExpand = (expanding) => {
|
|
|
57
75
|
setText(null);
|
|
58
76
|
}
|
|
59
77
|
};
|
|
60
|
-
<SilkeTile
|
|
78
|
+
<SilkeTile
|
|
79
|
+
title="Tile title"
|
|
80
|
+
subTitle="Tile Sub Title"
|
|
81
|
+
expandable
|
|
82
|
+
onExpand={handleExpand}
|
|
83
|
+
>
|
|
61
84
|
{text}
|
|
62
85
|
</SilkeTile>;
|
|
63
86
|
```
|
|
@@ -76,7 +99,7 @@ const handleExpand = (expanding) => {
|
|
|
76
99
|
</SilkeTile>
|
|
77
100
|
|
|
78
101
|
<SilkeTile
|
|
79
|
-
icon={{ type: 2, value: { url: ipsum.image() }}}
|
|
102
|
+
icon={{ type: 2, value: { url: ipsum.image() } }}
|
|
80
103
|
subTitle={ipsum.text()}
|
|
81
104
|
title="Tile with image icon"
|
|
82
105
|
/>
|
|
@@ -101,7 +124,11 @@ const [value, setValue] = React.useState(0);
|
|
|
101
124
|
<SilkeTileSelect
|
|
102
125
|
value={value}
|
|
103
126
|
onChange={setValue}
|
|
104
|
-
items={ipsum.list(5, (value) => ({
|
|
127
|
+
items={ipsum.list(5, (value) => ({
|
|
128
|
+
value,
|
|
129
|
+
title: ipsum.name(),
|
|
130
|
+
subTitle: ipsum.name(10),
|
|
131
|
+
}))}
|
|
105
132
|
/>;
|
|
106
133
|
```
|
|
107
134
|
|
|
@@ -113,6 +140,10 @@ const [value, setValue] = React.useState([1]);
|
|
|
113
140
|
multiple
|
|
114
141
|
value={value}
|
|
115
142
|
onChange={setValue}
|
|
116
|
-
items={ipsum.list(5, (value) => ({
|
|
143
|
+
items={ipsum.list(5, (value) => ({
|
|
144
|
+
value,
|
|
145
|
+
title: ipsum.name(),
|
|
146
|
+
subTitle: ipsum.name(10),
|
|
147
|
+
}))}
|
|
117
148
|
/>;
|
|
118
149
|
```
|
|
@@ -8,10 +8,24 @@ const [agree, setAgree] = React.useState(false);
|
|
|
8
8
|
|
|
9
9
|
<>
|
|
10
10
|
<SilkeBox>
|
|
11
|
-
<SilkeToggle
|
|
11
|
+
<SilkeToggle
|
|
12
|
+
label="Toggle with label"
|
|
13
|
+
value={checked}
|
|
14
|
+
onChange={setChecked}
|
|
15
|
+
/>
|
|
12
16
|
</SilkeBox>
|
|
13
|
-
<SilkeToggle
|
|
14
|
-
|
|
17
|
+
<SilkeToggle
|
|
18
|
+
required
|
|
19
|
+
label="This toggle is required"
|
|
20
|
+
value={agree}
|
|
21
|
+
onChange={setAgree}
|
|
22
|
+
/>
|
|
23
|
+
<SilkeToggle
|
|
24
|
+
small
|
|
25
|
+
label="Tiny toggle, tiny text"
|
|
26
|
+
value={checked}
|
|
27
|
+
onChange={setChecked}
|
|
28
|
+
/>
|
|
15
29
|
</>;
|
|
16
30
|
```
|
|
17
31
|
|
|
@@ -21,7 +35,12 @@ const [agree, setAgree] = React.useState(false);
|
|
|
21
35
|
const [checked, setChecked] = React.useState(true);
|
|
22
36
|
|
|
23
37
|
<>
|
|
24
|
-
<SilkeToggle
|
|
38
|
+
<SilkeToggle
|
|
39
|
+
disabled
|
|
40
|
+
label="Toggle with label"
|
|
41
|
+
value={checked}
|
|
42
|
+
onChange={setChecked}
|
|
43
|
+
/>
|
|
25
44
|
<SilkeToggle
|
|
26
45
|
disabled
|
|
27
46
|
small
|
|
@@ -29,7 +48,12 @@ const [checked, setChecked] = React.useState(true);
|
|
|
29
48
|
value={checked}
|
|
30
49
|
onChange={setChecked}
|
|
31
50
|
/>
|
|
32
|
-
<SilkeToggle
|
|
51
|
+
<SilkeToggle
|
|
52
|
+
disabled
|
|
53
|
+
label="Toggle with label (off)"
|
|
54
|
+
value={!checked}
|
|
55
|
+
onChange={setChecked}
|
|
56
|
+
/>
|
|
33
57
|
<SilkeToggle
|
|
34
58
|
disabled
|
|
35
59
|
small
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
# Toolbar
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<SilkeToolbar>
|
|
5
|
+
<SilkeSearchField label="Search" />
|
|
6
|
+
<SilkeSelectField
|
|
7
|
+
label="Filter"
|
|
8
|
+
items={[
|
|
9
|
+
{ label: "Apple", value: "apple" },
|
|
10
|
+
{ label: "Banana", value: "banana" },
|
|
11
|
+
]}
|
|
12
|
+
/>
|
|
13
|
+
<SilkeButton label="New project" kind="primary" />
|
|
14
|
+
</SilkeToolbar>
|
|
9
15
|
```
|
|
10
16
|
|
|
11
17
|
## Large
|
|
18
|
+
|
|
12
19
|
```js
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
<SilkeToolbar size="l">
|
|
21
|
+
<SilkeSearchField label="Search" />
|
|
22
|
+
<SilkeSelectField
|
|
23
|
+
label="Filter"
|
|
24
|
+
items={[
|
|
25
|
+
{ label: "Apple", value: "apple" },
|
|
26
|
+
{ label: "Banana", value: "banana" },
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
<SilkeButton label="New project" kind="primary" />
|
|
30
|
+
</SilkeToolbar>
|
|
18
31
|
```
|
|
19
32
|
|
|
20
33
|
## Small
|
|
21
34
|
|
|
22
35
|
## Large
|
|
36
|
+
|
|
23
37
|
```js
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
<SilkeToolbar size="s">
|
|
39
|
+
<SilkeSearchField label="Search" />
|
|
40
|
+
<SilkeSelectField
|
|
41
|
+
label="Filter"
|
|
42
|
+
items={[
|
|
43
|
+
{ label: "Apple", value: "apple" },
|
|
44
|
+
{ label: "Banana", value: "banana" },
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
<SilkeButton label="New project" kind="primary" />
|
|
48
|
+
</SilkeToolbar>
|
|
29
49
|
```
|
|
@@ -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';
|
|
@@ -54,6 +53,7 @@ const validate: FormValidator<SilkeUploadFieldProps> = (props, value) => {
|
|
|
54
53
|
export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
55
54
|
const { onFileUpload } = useSilkeContext();
|
|
56
55
|
const [pending, setPending] = useState<PendingFile[]>([]);
|
|
56
|
+
const size = props.size || 'base';
|
|
57
57
|
|
|
58
58
|
const {
|
|
59
59
|
useFileModel,
|
|
@@ -81,7 +81,6 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
81
81
|
|
|
82
82
|
pendingRef.current = pending;
|
|
83
83
|
valueRef.current = value;
|
|
84
|
-
|
|
85
84
|
const handleFileUploaded = (model: PendingFile, url: string) => {
|
|
86
85
|
// Do not continue if upload stopped
|
|
87
86
|
if (model.stopped) return;
|
|
@@ -184,16 +183,24 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
184
183
|
className={styles.drop}
|
|
185
184
|
ref={ref}
|
|
186
185
|
column
|
|
187
|
-
bg="
|
|
186
|
+
bg="neutral-10"
|
|
188
187
|
style={dropzoneStyle}
|
|
189
188
|
>
|
|
190
|
-
<SilkeIcon icon="file" className={styles.icon} />
|
|
191
|
-
<SilkeBox column>
|
|
192
|
-
<SilkeTitle kind=
|
|
189
|
+
<SilkeIcon icon="file.arrow.up" className={styles.icon} />
|
|
190
|
+
<SilkeBox column gap="s">
|
|
191
|
+
<SilkeTitle kind={size === 'xs' ? 'xxs' : 'xs'}>
|
|
193
192
|
Select a file <span style={{ color: 'white' }}>drag and drop here</span>
|
|
194
193
|
</SilkeTitle>
|
|
195
|
-
{help && !error &&
|
|
196
|
-
|
|
194
|
+
{help && !error && (
|
|
195
|
+
<SilkeText size={size === 'xs' ? 'small' : 'base'} color="neutral-80">
|
|
196
|
+
{help}
|
|
197
|
+
</SilkeText>
|
|
198
|
+
)}
|
|
199
|
+
{error && (
|
|
200
|
+
<SilkeText size={size === 'xs' ? 'small' : 'base'} color="error-30">
|
|
201
|
+
{error}
|
|
202
|
+
</SilkeText>
|
|
203
|
+
)}
|
|
197
204
|
</SilkeBox>
|
|
198
205
|
</SilkeBox>
|
|
199
206
|
</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
|
}
|
package/src/docs/parser.ts
CHANGED
|
@@ -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
|
}
|
package/src/hooks/hooks.mdx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Silke React Hooks
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
const ref = useHTMLElement(
|
|
4
|
+
const ref = useHTMLElement("div", {}, document.body);
|
|
5
5
|
return ReactDOM.createPortal(
|
|
6
|
-
<h1 style={{ position:
|
|
7
|
-
ref.current
|
|
6
|
+
<h1 style={{ position: "absolute", top: 200, left: 300 }}>In a portal</h1>,
|
|
7
|
+
ref.current
|
|
8
8
|
);
|
|
9
9
|
```
|
|
@@ -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
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useCallbackRef } from './use-callback-ref';
|
|
3
|
+
|
|
4
|
+
export function useDragging(
|
|
5
|
+
onMouseMove: (e: MouseEvent) => void,
|
|
6
|
+
): [dragging: boolean, setDragging: (dragging: boolean) => void] {
|
|
7
|
+
const [dragging, setDragging] = useState(false);
|
|
8
|
+
const onMoveRef = useCallbackRef(onMouseMove);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!dragging) return;
|
|
11
|
+
|
|
12
|
+
const handleMouseMove = (e: MouseEvent) => onMoveRef.current?.(e);
|
|
13
|
+
const handleMouseUp = () => setDragging(false);
|
|
14
|
+
|
|
15
|
+
document.addEventListener('mousemove', handleMouseMove);
|
|
16
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
17
|
+
return () => {
|
|
18
|
+
document.removeEventListener('mousemove', handleMouseMove);
|
|
19
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
20
|
+
};
|
|
21
|
+
}, [dragging, onMoveRef]);
|
|
22
|
+
|
|
23
|
+
return [dragging, setDragging];
|
|
24
|
+
}
|
package/src/icons.tsx
CHANGED
|
@@ -98,6 +98,8 @@ export const SilkeIconDefinitions = {
|
|
|
98
98
|
'folder.plus': 'fal fa-folder-plus',
|
|
99
99
|
folders: 'fal fa-folders',
|
|
100
100
|
file: 'fal fa-file',
|
|
101
|
+
'file.arrow.up': 'fa-light fa-file-arrow-up',
|
|
102
|
+
'file.download': 'far fa-download',
|
|
101
103
|
|
|
102
104
|
code: 'fal fa-code',
|
|
103
105
|
'code.version': 'fal fa-code-branch',
|
|
@@ -119,6 +121,7 @@ export const SilkeIconDefinitions = {
|
|
|
119
121
|
'arrow.left': 'fal fa-arrow-left',
|
|
120
122
|
'arrow.right': 'fal fa-arrow-right',
|
|
121
123
|
'arrow.up': 'fal fa-arrow-up',
|
|
124
|
+
'arrow.up.circle': 'fal fa-circle-arrow-up',
|
|
122
125
|
'chevron.down': 'fal fa-chevron-down',
|
|
123
126
|
'chevron.up': 'fal fa-chevron-up',
|
|
124
127
|
'chevron.right': 'fal fa-chevron-right',
|
|
@@ -213,8 +216,9 @@ export const SilkeIconDefinitions = {
|
|
|
213
216
|
expand: 'fal fa-expand',
|
|
214
217
|
'request.feature': 'fal fa-messages-question',
|
|
215
218
|
'custom-component': CustomComponentIcon,
|
|
219
|
+
'folder-tree': 'fal fa-folder-tree',
|
|
216
220
|
|
|
217
|
-
'project-plan':
|
|
221
|
+
'project-plan': 'fal fa-gem',
|
|
218
222
|
diamond: 'fa-regular fa-gem',
|
|
219
223
|
crosshair: 'fa-light fa-crosshairs',
|
|
220
224
|
|
|
@@ -430,21 +434,6 @@ function TableRowRemove() {
|
|
|
430
434
|
);
|
|
431
435
|
}
|
|
432
436
|
|
|
433
|
-
function ProjectPlanRibbon() {
|
|
434
|
-
return (
|
|
435
|
-
<svg width="32" height="40" viewBox="0 0 32 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
436
|
-
<path
|
|
437
|
-
d="M0 0H32V36.6597C32 38.1711 30.3879 39.1364 29.0556 38.4226L17.8889 32.4405C16.709 31.8084 15.291 31.8084 14.1111 32.4405L2.94444 38.4226C1.61211 39.1364 0 38.1711 0 36.6597V0Z"
|
|
438
|
-
fill="#FAE794"
|
|
439
|
-
/>
|
|
440
|
-
<path
|
|
441
|
-
d="M23.9062 15.2188L20.4062 10.2188C20.3125 10.0938 20.1562 10 20 10H11.9688C11.8125 10 11.6562 10.0938 11.5625 10.2188L8.0625 15.2188C7.9375 15.4375 7.96875 15.6875 8.125 15.8438L15.625 23.8438C15.7188 23.9688 15.8438 24 16 24C16.125 24 16.25 23.9688 16.3438 23.8438L23.8438 15.8438C24 15.6875 24.0312 15.4062 23.9062 15.2188ZM19.9688 11.375L22.5312 15H17.1875L19.9688 11.375ZM16 14.9375L13 11H18.9688L16 14.9375ZM12 11.375L14.7812 15H9.4375L12 11.375ZM16 22.7812L9.625 16H22.3438L16 22.7812Z"
|
|
442
|
-
fill="#46372C"
|
|
443
|
-
/>
|
|
444
|
-
</svg>
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
437
|
function GradientIcon() {
|
|
449
438
|
return (
|
|
450
439
|
<svg width={24} height={24} viewBox="0 0 24 24">
|