@vev/silke 1.0.29 → 1.1.0
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 +23 -0
- package/dist/index.js +38 -74
- package/dist/index.js.LEGAL.txt +15 -34
- package/dist/styles.css +679 -499
- package/dist/{silke/src → types}/components/index.d.ts +3 -1
- package/dist/types/components/silke-action-box/index.d.ts +1 -0
- package/dist/types/components/silke-action-box/silke-action-box.d.ts +18 -0
- package/dist/types/components/silke-alert-banner/index.d.ts +1 -0
- package/dist/{silke/src/components/silke-notification/silke-notification.d.ts → types/components/silke-alert-banner/silke-alert-banner.d.ts} +4 -5
- package/dist/{silke/src → types}/components/silke-autocomplete-field/autocomplete-item.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-autocomplete-field/autocomplete-tags.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-autocomplete-field/silke-autocomplete-field.d.ts +1 -1
- package/dist/types/components/silke-autocomplete-field/silke-autocomplete-field.spec.d.ts +1 -0
- package/dist/{silke/src → types}/components/silke-autocomplete-field/silke-autocomplete-popup.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-box/silke-box.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-breadcrumbs/silke-breadcrumb.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-breadcrumbs/silke-breadcrumbs.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-button/context.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-button/silke-big-button.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-button/silke-button-set.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-button/silke-button.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-button/silke-confirmation-button.d.ts +3 -2
- package/dist/{silke/src → types}/components/silke-button/silke-dropdown-button.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-button/silke-file-select-button.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-card/silke-card-grid.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-checkbox/silke-checkbox.d.ts +1 -1
- package/dist/types/components/silke-code-editor/index.d.ts +2 -0
- package/dist/{silke/src → types}/components/silke-code-editor/silke-code-editor.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-code-snippet/silke-code-snippet.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-color-palettes/silke-color-palette.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-palettes/silke-color-palettes.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-picker/color.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-color-picker/silke-color-info.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-picker/silke-color-picker-button.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-color-picker/silke-color-picker.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-picker/silke-color-space.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-picker/silke-hue-slider.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-picker/silke-opacity-slider.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-color-swatches/silke-swatches.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-conditions-input/silke-conditions-input-options.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-conditions-input/silke-conditions-input.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-conditions-input/silke-conditions-tag.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-conditions-input/utils.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-content-column/silke-content-column.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-context-menu/silke-context-menu-item.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-context-menu/silke-context-menu.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-css-number-field/index.d.ts +1 -0
- package/dist/{silke/src → types}/components/silke-css-number-field/silke-css-context.d.ts +6 -4
- package/dist/{silke/src → types}/components/silke-css-number-field/silke-css-number-field.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-divider/silke-divider.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-drawer/silke-drawer.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-form/form-context.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-form/silke-form.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/array-field-inline.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/array-field-modal.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/array-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/event-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/icon-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/image-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/layout-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/link-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/number-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/object-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/select-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/string-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/toggle-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/upload-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/fields/video-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/silke-extended-fields-context.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-form-schema/silke-form-schema.d.ts +2 -4
- package/dist/{silke/src → types}/components/silke-form-schema/silke-schema-context.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-form-schema/silke-schema-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-form-schema/silke-schema-fields.d.ts +1 -2
- package/dist/types/components/silke-gradient-picker/silke-gradient-picker.d.ts +7 -0
- package/dist/{silke/src → types}/components/silke-gradient-picker/silke-gradient-position.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-gradient-picker/silke-gradient-slider.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-icon/silke-shape.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-icon/silke-stacked-icon.d.ts +1 -2
- package/dist/types/components/silke-icon-picker/emoji-tab.d.ts +2 -0
- package/dist/types/components/silke-icon-picker/icons-tab.d.ts +2 -0
- package/dist/{silke/src → types}/components/silke-icon-picker/silke-icon-picker.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-icon-picker/upload-tab.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-iframe-portal/silke-iframe-portal.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-image/silke-image-color-backdrop.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-image/silke-image.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-link/silke-link.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-list/silke-list-item.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-list/silke-list.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-list-card/silke-list-card.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-loader/silke-loader-overlay.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-loader/silke-loader.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-modal/silke-confirmation-modal.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-modal/silke-modal.d.ts +5 -4
- package/dist/{silke/src → types}/components/silke-object-field/silke-object-field.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-overflow-menu/silke-overflow-menu.d.ts +2 -2
- package/dist/{silke/src → types}/components/silke-popover/popover-context.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-popover/silke-popover.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-progress-indicator/silke-progress-indicator.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-progress-indicator/silke-progress-step.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-radio-button/silke-radio-button-group.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-radio-button/silke-radio-button.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-search-field/silke-search-field.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-select-field/silke-select-field.d.ts +1 -2
- package/dist/types/components/silke-select-field/silke-select-field.spec.d.ts +1 -0
- package/dist/{silke/src → types}/components/silke-skeleton/silke-skeleton.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-slider/silke-slider-point.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-slider/silke-slider.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-slider/slider-track.d.ts +1 -1
- package/dist/types/components/silke-sortable-list/index.d.ts +3 -0
- package/dist/{silke/src → types}/components/silke-sortable-list/silke-nested-sortable-item.d.ts +3 -2
- package/dist/{silke/src → types}/components/silke-sortable-list/silke-nested-sortable-list.d.ts +3 -2
- package/dist/{silke/src → types}/components/silke-sortable-list/silke-nested-sortable-utils.d.ts +10 -1
- package/dist/types/components/silke-sortable-list/silke-nested-sortable-utils.spec.d.ts +1 -0
- package/dist/{silke/src → types}/components/silke-sortable-list/silke-sortable-item-wrapper.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-sortable-list/silke-sortable-list.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-table/silke-table.d.ts +3 -1
- package/dist/{silke/src → types}/components/silke-table/table-row.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-table/table-types.d.ts +1 -0
- package/dist/types/components/silke-tabs/silke-tab.d.ts +13 -0
- package/dist/{silke/src → types}/components/silke-tabs/silke-tabs.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-tag/silke-tag.d.ts +8 -8
- package/dist/{silke/src → types}/components/silke-text/silke-text.d.ts +7 -6
- package/dist/{silke/src → types}/components/silke-text/silke-title.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-text-field/silke-text-field-outline.d.ts +3 -5
- package/dist/{silke/src → types}/components/silke-text-field/silke-text-field.d.ts +1 -0
- package/dist/{silke/src → types}/components/silke-text-field/text-field-context.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-theme-editor/silke-theme-editor.d.ts +1 -2
- package/dist/{silke/src → types}/components/silke-tile/silke-tile.d.ts +2 -2
- package/dist/types/components/silke-toast-notification/index.d.ts +1 -0
- package/dist/types/components/silke-toast-notification/silke-toast-notification.d.ts +21 -0
- package/dist/{silke/src → types}/components/silke-toggle/silke-toggle.d.ts +1 -1
- package/dist/types/components/silke-toolbar/silke-toolbar.d.ts +7 -0
- package/dist/{silke/src → types}/components/silke-tooltip/silke-definition-tooltip.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-tooltip/silke-icon-tooltip.d.ts +2 -1
- package/dist/{silke/src → types}/components/silke-tooltip/silke-interactive-tooltip.d.ts +1 -1
- package/dist/types/components/silke-tooltip/silke-shortcuts.d.ts +5 -0
- package/dist/{silke/src → types}/components/silke-tooltip/silke-tooltip.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-upload-field/silke-upload-field.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-variables-wrapper/silke-variables-wrapper-form.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-variables-wrapper/silke-variables-wrapper.d.ts +2 -11
- package/dist/{silke/src → types}/components/silke-virtual/silke-virtual-grid.d.ts +1 -1
- package/dist/{silke/src → types}/components/silke-virtual/silke-virtual-row.d.ts +1 -1
- package/dist/types/docs/app.d.ts +3 -0
- package/dist/{silke/src → types}/docs/components/code-block/code-block.d.ts +1 -2
- package/dist/{silke/src → types}/docs/components/state-table/state-table.d.ts +1 -2
- package/dist/{silke/src → types}/docs/docs-provider.d.ts +1 -1
- package/dist/types/docs/parser.d.ts +0 -0
- package/dist/{silke/src → types}/hooks/drag-and-drop/use-drag.d.ts +3 -2
- package/dist/{silke/src → types}/icons.d.ts +43 -25
- package/dist/types/jest/keys.d.ts +6 -0
- package/dist/{silke/src → types}/silke-theme-provider.d.ts +1 -1
- package/esbuild-sass-modules.mjs +1 -1
- package/jest.config.js +0 -2
- package/package.json +19 -17
- package/public/index.html +1 -1
- package/src/components/index.ts +3 -1
- package/src/components/silke-action-box/index.ts +1 -0
- package/src/components/silke-action-box/silke-action-box.mdx +152 -0
- package/src/components/silke-action-box/silke-action-box.scss +116 -0
- package/src/components/silke-action-box/silke-action-box.tsx +67 -0
- package/src/components/silke-alert-banner/index.ts +1 -0
- package/src/components/{silke-notification/silke-notification.mdx → silke-alert-banner/silke-alert-banner.mdx} +21 -42
- package/src/components/{silke-notification/silke-notification.scss → silke-alert-banner/silke-alert-banner.scss} +18 -53
- package/src/components/silke-alert-banner/silke-alert-banner.tsx +92 -0
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.mdx +2 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.spec.tsx +1 -1
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +11 -12
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +52 -51
- package/src/components/silke-button/silke-big-button.scss +0 -8
- package/src/components/silke-button/silke-big-button.tsx +0 -3
- package/src/components/silke-button/silke-button.mdx +2 -9
- package/src/components/silke-button/silke-button.scss +18 -25
- package/src/components/silke-button/silke-button.tsx +5 -5
- package/src/components/silke-button/silke-confirmation-button.tsx +4 -1
- package/src/components/silke-button/silke-file-select-button.tsx +2 -2
- package/src/components/silke-card/silke-card.scss +6 -0
- package/src/components/silke-card/silke-card.tsx +1 -0
- package/src/components/silke-checkbox/silke-checkbox.scss +2 -2
- package/src/components/silke-code-snippet/silke-code-snippet.tsx +5 -7
- package/src/components/silke-color-picker/color.ts +1 -1
- package/src/components/silke-color-picker/silke-color-info.tsx +12 -10
- package/src/components/silke-color-picker/silke-color-picker-button.tsx +1 -1
- package/src/components/silke-color-picker/silke-color-picker.tsx +2 -2
- package/src/components/silke-color-swatches/silke-color-swatch-button.tsx +1 -1
- package/src/components/silke-color-swatches/silke-swatches.tsx +19 -15
- package/src/components/silke-conditions-input/silke-conditions-input.tsx +4 -1
- package/src/components/silke-conditions-input/utils.ts +1 -6
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
- package/src/components/silke-css-number-field/index.ts +1 -0
- package/src/components/silke-css-number-field/silke-css-context.tsx +8 -3
- package/src/components/silke-css-number-field/silke-css-number-field.mdx +3 -3
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +2 -2
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +2 -2
- package/src/components/silke-form-schema/fields/event-field.tsx +3 -3
- package/src/components/silke-form-schema/fields/icon-field.tsx +0 -2
- package/src/components/silke-form-schema/fields/image-field.tsx +11 -7
- package/src/components/silke-form-schema/fields/link-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/number-field.tsx +4 -4
- package/src/components/silke-form-schema/fields/select-field.tsx +6 -4
- package/src/components/silke-form-schema/fields/string-field.tsx +2 -2
- package/src/components/silke-form-schema/fields/styles.scss +35 -36
- package/src/components/silke-form-schema/fields/upload-field.tsx +1 -1
- package/src/components/silke-form-schema/fields/video-field.tsx +5 -4
- package/src/components/silke-form-schema/silke-form-schema.tsx +2 -3
- package/src/components/silke-form-schema/silke-schema-field.tsx +11 -5
- package/src/components/silke-gradient-picker/silke-gradient-picker.tsx +37 -7
- package/src/components/silke-gradient-picker/silke-gradient-position.tsx +1 -1
- package/src/components/silke-icon/silke-icon.scss +1 -1
- package/src/components/silke-icon-picker/emoji-tab.tsx +2 -2
- package/src/components/silke-iframe-portal/silke-iframe-portal.mdx +1 -1
- package/src/components/silke-modal/silke-confirmation-modal.tsx +3 -1
- package/src/components/silke-modal/silke-modal.mdx +41 -1
- package/src/components/silke-modal/silke-modal.scss +30 -20
- package/src/components/silke-modal/silke-modal.tsx +13 -9
- package/src/components/silke-navigation-link/silke-navigation-link.scss +1 -4
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +33 -0
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +1 -1
- package/src/components/silke-search-field/silke-search-field.tsx +2 -2
- package/src/components/silke-select-field/silke-select-field.mdx +4 -4
- package/src/components/silke-select-field/silke-select-field.spec.tsx +1 -1
- package/src/components/silke-sortable-list/index.ts +1 -0
- package/src/components/silke-sortable-list/silke-nested-sortable-item.tsx +56 -35
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +2 -6
- package/src/components/silke-sortable-list/silke-nested-sortable-list.tsx +4 -0
- package/src/components/silke-sortable-list/silke-nested-sortable-utils.ts +17 -4
- package/src/components/silke-sortable-list/silke-sortable-item-wrapper.tsx +1 -1
- package/src/components/silke-sortable-list/silke-sortable-list.mdx +18 -26
- package/src/components/silke-table/silke-table.mdx +23 -0
- package/src/components/silke-table/silke-table.tsx +14 -5
- package/src/components/silke-table/table-types.ts +1 -0
- package/src/components/silke-tabs/silke-tab.tsx +20 -2
- package/src/components/silke-tabs/silke-tabs.mdx +71 -0
- package/src/components/silke-tabs/silke-tabs.scss +37 -0
- package/src/components/silke-tabs/silke-tabs.tsx +1 -1
- package/src/components/silke-tag/silke-tag.mdx +28 -55
- package/src/components/silke-tag/silke-tag.scss +50 -41
- package/src/components/silke-tag/silke-tag.tsx +4 -13
- package/src/components/silke-text-field/silke-text-field-outline.tsx +10 -27
- package/src/components/silke-text-field/silke-text-field.mdx +2 -2
- package/src/components/silke-text-field/silke-text-field.scss +7 -17
- package/src/components/silke-text-field/silke-text-field.tsx +2 -0
- package/src/components/silke-theme-editor/silke-theme-editor.tsx +0 -1
- package/src/components/silke-tile/silke-tile.tsx +24 -29
- package/src/components/silke-toast-notification/index.ts +1 -0
- package/src/components/silke-toast-notification/silke-toast-notification.mdx +201 -0
- package/src/components/silke-toast-notification/silke-toast-notification.scss +110 -0
- package/src/components/{silke-notification/silke-notification.tsx → silke-toast-notification/silke-toast-notification.tsx} +27 -16
- package/src/components/silke-toolbar/silke-toolbar.tsx +5 -4
- package/src/components/silke-tooltip/silke-icon-tooltip.tsx +5 -3
- package/src/components/silke-tooltip/silke-shortcuts.tsx +8 -3
- package/src/components/silke-upload-field/silke-upload-field.tsx +20 -3
- package/src/components/silke-variables-wrapper/silke-variables-wrapper-form.tsx +2 -2
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.mdx +84 -12
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +2 -2
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.tsx +42 -61
- package/src/docs/app.tsx +16 -13
- package/src/docs/components/code-block/code-block.scss +4 -1
- package/src/docs/components/code-block/code-block.tsx +10 -9
- package/src/hooks/drag-and-drop/use-drag.tsx +6 -1
- package/src/hooks/drag-and-drop/use-drop.tsx +2 -2
- package/src/icons.tsx +53 -27
- package/src/styles/core.scss +4 -0
- package/tsconfig.build.json +26 -4
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +25 -11
- package/webpack.docs.ts +1 -1
- package/dist/silke/src/components/silke-code-editor/index.d.ts +0 -3
- package/dist/silke/src/components/silke-gradient-picker/silke-gradient-picker.d.ts +0 -5
- package/dist/silke/src/components/silke-icon-picker/emoji-tab.d.ts +0 -3
- package/dist/silke/src/components/silke-icon-picker/icons-tab.d.ts +0 -3
- package/dist/silke/src/components/silke-notification/index.d.ts +0 -1
- package/dist/silke/src/components/silke-sortable-list/index.d.ts +0 -2
- package/dist/silke/src/components/silke-tabs/silke-tab.d.ts +0 -9
- package/dist/silke/src/components/silke-toolbar/silke-toolbar.d.ts +0 -7
- package/dist/silke/src/components/silke-tooltip/silke-shortcuts.d.ts +0 -6
- package/dist/silke/src/docs/app.d.ts +0 -4
- package/dist/utils/src/color/hex.d.ts +0 -2
- package/dist/utils/src/color/index.d.ts +0 -1
- package/dist/utils/src/constants.d.ts +0 -2
- package/dist/utils/src/css/computed-to-css.d.ts +0 -8
- package/dist/utils/src/css/computed.d.ts +0 -5
- package/dist/utils/src/css/index.d.ts +0 -4
- package/dist/utils/src/css/number-format.d.ts +0 -1
- package/dist/utils/src/css/utils.d.ts +0 -14
- package/dist/utils/src/index.d.ts +0 -8
- package/dist/utils/src/keyboard/hooks.d.ts +0 -7
- package/dist/utils/src/keyboard/index.d.ts +0 -4
- package/dist/utils/src/keyboard/keyboard.d.ts +0 -70
- package/dist/utils/src/keyboard/keys.d.ts +0 -4
- package/dist/utils/src/math/index.d.ts +0 -9
- package/dist/utils/src/mouse/index.d.ts +0 -3
- package/dist/utils/src/mouse/mouse-manager.d.ts +0 -51
- package/dist/utils/src/types/content.d.ts +0 -11
- package/dist/utils/src/types/context.d.ts +0 -77
- package/dist/utils/src/types/css.d.ts +0 -131
- package/dist/utils/src/types/editable-css.d.ts +0 -7
- package/dist/utils/src/types/emoji.d.ts +0 -28
- package/dist/utils/src/types/event.d.ts +0 -6
- package/dist/utils/src/types/icon.d.ts +0 -10
- package/dist/utils/src/types/index.d.ts +0 -18
- package/dist/utils/src/types/link.d.ts +0 -47
- package/dist/utils/src/types/manifest.d.ts +0 -56
- package/dist/utils/src/types/oauth.d.ts +0 -13
- package/dist/utils/src/types/project.d.ts +0 -23
- package/dist/utils/src/types/qwiker.d.ts +0 -46
- package/dist/utils/src/types/shape.d.ts +0 -20
- package/dist/utils/src/types/transition.d.ts +0 -15
- package/dist/utils/src/types/vev-plugin.d.ts +0 -90
- package/dist/utils/src/types/vev-props.d.ts +0 -181
- package/dist/utils/src/types/widget-manifest.d.ts +0 -70
- package/dist/utils/src/types/widget.d.ts +0 -36
- package/dist/utils/src/utils/generate-guid.d.ts +0 -1
- package/dist/utils/src/utils/index.d.ts +0 -9
- package/dist/utils/src/utils/internals/asciiToArray.d.ts +0 -9
- package/dist/utils/src/utils/internals/castSlice.d.ts +0 -11
- package/dist/utils/src/utils/internals/createCaseFirst.d.ts +0 -9
- package/dist/utils/src/utils/internals/getTag.d.ts +0 -9
- package/dist/utils/src/utils/internals/hasUnicode.d.ts +0 -9
- package/dist/utils/src/utils/internals/stringToArray.d.ts +0 -9
- package/dist/utils/src/utils/internals/unicodeToArray.d.ts +0 -9
- package/dist/utils/src/utils/internals/unicodeWords.d.ts +0 -9
- package/dist/utils/src/utils/internals/upperFirst.d.ts +0 -18
- package/dist/utils/src/utils/is-array.d.ts +0 -25
- package/dist/utils/src/utils/is-length.d.ts +0 -26
- package/dist/utils/src/utils/is-string.d.ts +0 -17
- package/dist/utils/src/utils/main-components.d.ts +0 -7
- package/dist/utils/src/utils/slice.d.ts +0 -22
- package/dist/utils/src/utils/start-case.d.ts +0 -22
- package/dist/utils/src/utils/string.d.ts +0 -5
- package/dist/utils/src/utils/variable.d.ts +0 -3
- package/dist/utils/src/utils/words.d.ts +0 -18
- package/src/components/silke-notification/index.ts +0 -1
- package/tsconfig.types.json +0 -19
- /package/dist/{silke/src → types}/components/silke-autocomplete-field/autocomplete-types.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-autocomplete-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-box/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-breadcrumbs/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-button/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-card/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-card/silke-card.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-checkbox/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-code-snippet/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-palettes/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-picker/hue.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-picker/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-swatches/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-swatches/silke-color-swatch-button.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-color-swatches/utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-conditions-input/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-conditions-input/types.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-content-column/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-context-menu/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-context-menu/silke-contect-menu-hooks.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-css-number-field/utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-divider/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-drawer/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form/form-types.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/fields/utils/generate-image.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/fields/utils/generate-title.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/fields/utils/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/fields/utils/schema-util.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/safe-eval/iframe-handler.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/safe-eval/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/safe-eval/safe-eval.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-form-schema/schema-utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-gradient-picker/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-gradient-picker/silke-gradient-utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-icon/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-icon/silke-icon.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-icon-picker/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-icon-picker/utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-iframe-portal/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-iframe-portal/silke-iframe-context.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-iframe-portal/silke-iframe-css-link.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-iframe-portal/silke-iframe-script.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-image/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-link/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-list/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-list-card/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-loader/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-modal/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-navigation-link/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-navigation-link/silke-navigation-link.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-object-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-overflow-menu/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-popover/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-progress-indicator/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-radio-button/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-search-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-select-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-skeleton/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-slider/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-slider/silke-slider-utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-table/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-tabs/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-tag/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-text/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-text/silke-text-types.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-text-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-text-field/silke-text-field-item.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-theme-editor/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-tile/index.d.ts +0 -0
- /package/dist/{silke/src/components/silke-notification → types/components/silke-toast-notification}/confetti.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-toggle/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-toolbar/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-tooltip/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-tooltip/utils.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-upload-field/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-variables-wrapper/index.d.ts +0 -0
- /package/dist/{silke/src → types}/components/silke-virtual/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/components/code-block/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/components/state-table/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/app/actions.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/app/constants.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/app/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/app/store.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/action-decorator.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/action-utils.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/controller.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/dispatcher.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/store.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/data/flux/use-store.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/index.d.ts +0 -0
- /package/dist/{silke/src → types}/docs/ipsum-generator.d.ts +0 -0
- /package/dist/{silke/src → types}/helpers/copy-to-clipboard.d.ts +0 -0
- /package/dist/{silke/src → types}/helpers/key-code.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/drag-and-drop/index.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/drag-and-drop/use-drop.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/form/index.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/form/use-form-field.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/image-colors/use-image-colors.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/index.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-callback-ref.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-dragging.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-drop-zone.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-html-element.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-interval.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-mouse.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-parent-scroll.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-scroll.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-size.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-uniq-id.d.ts +0 -0
- /package/dist/{silke/src → types}/hooks/use-window-resize.d.ts +0 -0
- /package/dist/{silke/src → types}/index.d.ts +0 -0
- /package/dist/{silke/src → types}/main.d.ts +0 -0
- /package/src/components/{silke-notification → silke-toast-notification}/confetti.tsx +0 -0
- /package/{jest → src/jest}/keys.ts +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Toast Notification
|
|
2
|
+
|
|
3
|
+
## Types
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
const title = 'Warning';
|
|
7
|
+
const subtitle = 'Some subitle text here';
|
|
8
|
+
|
|
9
|
+
const types = ['information', 'success', 'warning', 'error'];
|
|
10
|
+
|
|
11
|
+
<SilkeBox gap>
|
|
12
|
+
<SilkeBox column gap>
|
|
13
|
+
{types.map((type, i) => (
|
|
14
|
+
<SilkeToastNotification
|
|
15
|
+
key={i}
|
|
16
|
+
inline
|
|
17
|
+
kind={type}
|
|
18
|
+
subtitle="Notification text goes here."
|
|
19
|
+
onRemove={() => {}}
|
|
20
|
+
/>
|
|
21
|
+
))}
|
|
22
|
+
</SilkeBox>
|
|
23
|
+
</SilkeBox>;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Testing
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
const [notifications, setNotifications] = React.useState([]);
|
|
30
|
+
const [type, setType] = React.useState('information');
|
|
31
|
+
|
|
32
|
+
const addNotification = () => {
|
|
33
|
+
setNotifications(notifications.concat([{ id: notifications.length + 1, kind: type }]));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
<>
|
|
37
|
+
<SilkeBox column gap>
|
|
38
|
+
<SilkeToastNotification
|
|
39
|
+
inline
|
|
40
|
+
subtitle="Subtitle text here. Subtitle text here. Subtitle text here. Subtitle text here. Subtitle text here. Subtitle text here. Subtitle text here"
|
|
41
|
+
onRemove={() => {}}
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<SilkeBox gap="m">
|
|
45
|
+
<SilkeButton
|
|
46
|
+
label="Generate notification"
|
|
47
|
+
onClick={() => {
|
|
48
|
+
addNotification();
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
<SilkeSelectField
|
|
52
|
+
onChange={setType}
|
|
53
|
+
value={type}
|
|
54
|
+
items={[
|
|
55
|
+
{ value: 'information' },
|
|
56
|
+
{ value: 'success' },
|
|
57
|
+
{ value: 'attention' },
|
|
58
|
+
{ value: 'error' },
|
|
59
|
+
{ value: 'warning' },
|
|
60
|
+
{ value: 'confetti' },
|
|
61
|
+
]}
|
|
62
|
+
/>
|
|
63
|
+
</SilkeBox>
|
|
64
|
+
{notifications.map((item) => (
|
|
65
|
+
<SilkeToastNotification
|
|
66
|
+
key={item.id}
|
|
67
|
+
kind={item.kind || 'information'}
|
|
68
|
+
title="Warning title"
|
|
69
|
+
subtitle="Notification text for notification box with more than one line."
|
|
70
|
+
onRemove={() => {
|
|
71
|
+
setNotifications(
|
|
72
|
+
notifications.filter((n) => {
|
|
73
|
+
return n.id !== item.id;
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
))}
|
|
79
|
+
</SilkeBox>
|
|
80
|
+
</>;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```jsx
|
|
84
|
+
() => (
|
|
85
|
+
<SilkeBox column gap>
|
|
86
|
+
<SilkeToastNotification
|
|
87
|
+
inline
|
|
88
|
+
kind="success"
|
|
89
|
+
subtitle="Subtitle text here"
|
|
90
|
+
onAction={() => {}}
|
|
91
|
+
actionLabel="Click here"
|
|
92
|
+
/>
|
|
93
|
+
<SilkeToastNotification kind="error" inline subtitle="Subtitle text here" onRemove={() => {}} />
|
|
94
|
+
<SilkeToastNotification
|
|
95
|
+
kind="success"
|
|
96
|
+
inline
|
|
97
|
+
subtitle="Subtitle text here"
|
|
98
|
+
onRemove={() => {}}
|
|
99
|
+
/>
|
|
100
|
+
<SilkeToastNotification
|
|
101
|
+
kind="information"
|
|
102
|
+
inline
|
|
103
|
+
subtitle="Subtitle text here"
|
|
104
|
+
onRemove={() => {}}
|
|
105
|
+
/>
|
|
106
|
+
</SilkeBox>
|
|
107
|
+
);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Box notification
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
<>
|
|
114
|
+
<SilkeBox column gap>
|
|
115
|
+
<SilkeToastNotification kind="success" subtitle="Subtitle text here" />
|
|
116
|
+
<SilkeToastNotification kind="error" subtitle="Subtitle text here" onRemove={() => {}} />
|
|
117
|
+
<SilkeToastNotification kind="success" subtitle="Subtitle text here" onRemove={() => {}} />
|
|
118
|
+
<SilkeToastNotification kind="information" subtitle="Subtitle text here" onRemove={() => {}} />
|
|
119
|
+
<SilkeToastNotification
|
|
120
|
+
kind="error"
|
|
121
|
+
subtitle="Subtitle text here"
|
|
122
|
+
actionLabel="Fix now"
|
|
123
|
+
onAction={() => {}}
|
|
124
|
+
onRemove={() => {}}
|
|
125
|
+
/>
|
|
126
|
+
</SilkeBox>
|
|
127
|
+
</>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Box notification with action and subtitle
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
<>
|
|
134
|
+
<SilkeBox column gap>
|
|
135
|
+
<SilkeToastNotification
|
|
136
|
+
kind="success"
|
|
137
|
+
title="With action"
|
|
138
|
+
subtitle="Notification text for notification box with more than one line."
|
|
139
|
+
actionLabel="Take action"
|
|
140
|
+
onAction={() => {}}
|
|
141
|
+
/>
|
|
142
|
+
<SilkeToastNotification
|
|
143
|
+
kind="error"
|
|
144
|
+
title="With action"
|
|
145
|
+
subtitle="Notification text for notification box with more than one line."
|
|
146
|
+
actionLabel="Take action"
|
|
147
|
+
onAction={() => {}}
|
|
148
|
+
/>
|
|
149
|
+
<SilkeToastNotification
|
|
150
|
+
kind="success"
|
|
151
|
+
title="With action"
|
|
152
|
+
subtitle="Notification text for notification box with more than one line."
|
|
153
|
+
actionLabel="Take action"
|
|
154
|
+
onAction={() => {}}
|
|
155
|
+
/>
|
|
156
|
+
<SilkeToastNotification
|
|
157
|
+
kind="information"
|
|
158
|
+
title="With action"
|
|
159
|
+
subtitle="Notification text for notification box with more than one line."
|
|
160
|
+
actionLabel="Take action"
|
|
161
|
+
onAction={() => {}}
|
|
162
|
+
/>
|
|
163
|
+
</SilkeBox>
|
|
164
|
+
</>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Box notification fluid
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
<>
|
|
171
|
+
<SilkeBox column gap>
|
|
172
|
+
<SilkeToastNotification
|
|
173
|
+
fluid
|
|
174
|
+
kind="success"
|
|
175
|
+
title="Title text here"
|
|
176
|
+
subtitle="Subtitle text here"
|
|
177
|
+
/>
|
|
178
|
+
<SilkeToastNotification
|
|
179
|
+
fluid
|
|
180
|
+
kind="error"
|
|
181
|
+
title="Title text here"
|
|
182
|
+
subtitle="Subtitle text here"
|
|
183
|
+
onRemove={() => {}}
|
|
184
|
+
/>
|
|
185
|
+
<SilkeToastNotification
|
|
186
|
+
fluid
|
|
187
|
+
kind="success"
|
|
188
|
+
title="Title text here"
|
|
189
|
+
subtitle="Subtitle text here"
|
|
190
|
+
onRemove={() => {}}
|
|
191
|
+
/>
|
|
192
|
+
<SilkeToastNotification
|
|
193
|
+
fluid
|
|
194
|
+
kind="information"
|
|
195
|
+
title="Title text here"
|
|
196
|
+
subtitle="Subtitle text here"
|
|
197
|
+
onRemove={() => {}}
|
|
198
|
+
/>
|
|
199
|
+
</SilkeBox>
|
|
200
|
+
</>
|
|
201
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
@use "../../variables" as *;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.notificationBox {
|
|
5
|
+
--notification-background: var(--color-neutral-0);
|
|
6
|
+
--notification-color: var(--color-accent-30);
|
|
7
|
+
--notification-border: var(--color-surface-4);
|
|
8
|
+
|
|
9
|
+
filter: var(--shadow-level-1);
|
|
10
|
+
background: var(--notification-background);
|
|
11
|
+
color: var(--color-neutral-100);
|
|
12
|
+
border: 1px solid var(--notification-border);
|
|
13
|
+
max-width: 1096px;
|
|
14
|
+
|
|
15
|
+
&:not(.fluid) {
|
|
16
|
+
width: 320px;
|
|
17
|
+
}
|
|
18
|
+
// Double class to override silke button
|
|
19
|
+
.close.close.close {
|
|
20
|
+
--silke-button-background: transparent;
|
|
21
|
+
--silke-button-background-hover: transparent;
|
|
22
|
+
--silke-button-background-pressed: transparent;
|
|
23
|
+
|
|
24
|
+
--silke-button-color: var(--color-neutral-100);
|
|
25
|
+
--silke-button-color-hover: var(--notification-color);
|
|
26
|
+
--silke-button-color-pressed: var(--notification-color);
|
|
27
|
+
|
|
28
|
+
--silke-button-border: none;
|
|
29
|
+
--silke-button-border-hover: none;
|
|
30
|
+
--silke-button-border-pressed: none;
|
|
31
|
+
--silke-button-border-disabled: none;
|
|
32
|
+
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.action.action.action {
|
|
38
|
+
text-align: left;
|
|
39
|
+
justify-content: start;
|
|
40
|
+
align-items: flex-end;
|
|
41
|
+
padding: 0;
|
|
42
|
+
line-height: 18px;
|
|
43
|
+
height: 18px;
|
|
44
|
+
min-height: 18px;
|
|
45
|
+
--silke-button-background: transparent;
|
|
46
|
+
--silke-button-background-hover: transparent;
|
|
47
|
+
--silke-button-background-pressed: transparent;
|
|
48
|
+
|
|
49
|
+
--silke-button-color: var(--notification-color);
|
|
50
|
+
--silke-button-color-hover: var(--notification-color);
|
|
51
|
+
--silke-button-color-pressed: var(--notification-color);
|
|
52
|
+
|
|
53
|
+
--silke-button-border: none;
|
|
54
|
+
--silke-button-border-hover: none;
|
|
55
|
+
--silke-button-border-pressed: none;
|
|
56
|
+
--silke-button-border-disabled: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.content {
|
|
61
|
+
line-height: 18px;
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.icon {
|
|
67
|
+
color: var(--notification-color);
|
|
68
|
+
font-size: 16px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.warning {
|
|
72
|
+
--notification-color: var(--color-warning-30);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.error {
|
|
76
|
+
--notification-color: var(--color-error-30);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.success {
|
|
80
|
+
--notification-color: var(--color-success-30);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.information {
|
|
84
|
+
--notification-color: var(--color-support-secondary-40);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.confetti {
|
|
88
|
+
--notification-color: var(--color-success-30);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.scale {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
animation: scale 250ms 300ms cubic-bezier(.45,.65,.62,.99) forwards;
|
|
94
|
+
transform-origin: center center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes scale {
|
|
98
|
+
0% {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
transform: scale(0);
|
|
101
|
+
}
|
|
102
|
+
70% {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
transform: scale(1.1);
|
|
105
|
+
}
|
|
106
|
+
100% {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: scale(1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -3,13 +3,13 @@ import { BoxDivProps, SilkeBox } from '../silke-box';
|
|
|
3
3
|
import { SilkeButton } from '../silke-button';
|
|
4
4
|
import { SilkeIcon, SilkeIcons } from '../silke-icon';
|
|
5
5
|
import { SilkeText } from '../silke-text';
|
|
6
|
-
import styles from './silke-notification.scss';
|
|
6
|
+
import styles from './silke-toast-notification.scss';
|
|
7
7
|
import userConfetti from './confetti';
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type ToastNotificationKind = 'warning' | 'error' | 'success' | 'information' | 'confetti';
|
|
10
10
|
|
|
11
|
-
export type
|
|
12
|
-
kind:
|
|
11
|
+
export type SilkeToastNotificationProps = {
|
|
12
|
+
kind: ToastNotificationKind;
|
|
13
13
|
title?: string | React.ReactNode;
|
|
14
14
|
subtitle?: string | React.ReactNode;
|
|
15
15
|
icon?: SilkeIcons;
|
|
@@ -23,51 +23,63 @@ export type SilkeNotificationProps = {
|
|
|
23
23
|
onAction?: () => void;
|
|
24
24
|
actionLabel?: string;
|
|
25
25
|
fluid?: boolean;
|
|
26
|
-
dark?: boolean;
|
|
27
26
|
} & Omit<BoxDivProps, 'height' | 'width' | 'tag'>;
|
|
28
27
|
|
|
29
|
-
const ICON_KIND: Record<
|
|
28
|
+
const ICON_KIND: Record<ToastNotificationKind, SilkeIcons> = {
|
|
30
29
|
warning: 'error.triangle',
|
|
31
|
-
error: 'ban',
|
|
30
|
+
error: 'ban.light',
|
|
32
31
|
success: 'check.circle.outline',
|
|
33
32
|
information: 'tooltip',
|
|
34
33
|
confetti: '🎉' as SilkeIcons,
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
export function
|
|
36
|
+
export function SilkeToastNotification({
|
|
38
37
|
title,
|
|
39
38
|
subtitle,
|
|
40
39
|
className,
|
|
41
|
-
kind,
|
|
40
|
+
kind = 'information',
|
|
42
41
|
onAction,
|
|
43
42
|
actionLabel,
|
|
44
43
|
onRemove,
|
|
45
44
|
fluid = false,
|
|
46
|
-
dark,
|
|
47
45
|
icon,
|
|
48
46
|
...rest
|
|
49
|
-
}:
|
|
47
|
+
}: SilkeToastNotificationProps) {
|
|
50
48
|
const cl: string[] = [styles.notificationBox];
|
|
51
49
|
const iconRef = useRef<HTMLBaseElement>();
|
|
50
|
+
const doublePadding = title && subtitle;
|
|
52
51
|
|
|
53
52
|
if (kind === 'confetti') userConfetti(iconRef as any);
|
|
54
53
|
|
|
55
54
|
if (className) cl.push(className);
|
|
56
55
|
if (kind) cl.push(styles[kind]);
|
|
57
56
|
if (fluid) cl.push(styles.fluid);
|
|
58
|
-
if (dark) cl.push(styles.dark);
|
|
59
57
|
|
|
60
58
|
return (
|
|
61
59
|
<SilkeBox rounded="small" className={cl.join(' ')} {...rest}>
|
|
62
|
-
<SilkeBox
|
|
60
|
+
<SilkeBox
|
|
61
|
+
size="m"
|
|
62
|
+
align="center"
|
|
63
|
+
ref={iconRef}
|
|
64
|
+
style={{ marginTop: doublePadding ? '4px' : '0px' }}
|
|
65
|
+
>
|
|
63
66
|
<SilkeIcon
|
|
64
67
|
icon={icon ?? ICON_KIND[kind]}
|
|
65
68
|
className={[styles.icon, kind === 'confetti' && styles.scale].filter(Boolean).join(' ')}
|
|
66
69
|
/>
|
|
67
70
|
</SilkeBox>
|
|
68
|
-
<SilkeBox
|
|
71
|
+
<SilkeBox
|
|
72
|
+
flex
|
|
73
|
+
column
|
|
74
|
+
vPad={doublePadding ? 'm' : 's'}
|
|
75
|
+
gap="xs"
|
|
76
|
+
className={styles.content}
|
|
77
|
+
hAlign="start"
|
|
78
|
+
>
|
|
69
79
|
{title && <SilkeText weight="strong">{title}</SilkeText>}
|
|
70
|
-
{subtitle &&
|
|
80
|
+
{subtitle && (
|
|
81
|
+
<SilkeText color={!title ? 'neutral-100' : 'neutral-80'}>{subtitle}</SilkeText>
|
|
82
|
+
)}
|
|
71
83
|
{onAction && (
|
|
72
84
|
<SilkeButton
|
|
73
85
|
className={styles.action}
|
|
@@ -77,7 +89,6 @@ export function SilkeNotification({
|
|
|
77
89
|
onClick={onAction}
|
|
78
90
|
/>
|
|
79
91
|
)}
|
|
80
|
-
{/* <NotificationBody {...{ isBox, title, subtitle, kind, timestamp, onAction, actionLabel }} /> */}
|
|
81
92
|
</SilkeBox>
|
|
82
93
|
<SilkeBox size="m" align="center">
|
|
83
94
|
{onRemove && (
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { BoxDivProps,
|
|
1
|
+
import { BoxDivProps, SilkeBox } from '../silke-box';
|
|
2
2
|
import ButtonContext from '../silke-button/context';
|
|
3
3
|
import TextFieldContext from '../silke-text-field/text-field-context';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import styles from './silke-toolbar.scss';
|
|
6
|
+
import { SilkeInputSize } from '../silke-text-field/silke-text-field';
|
|
6
7
|
|
|
7
8
|
type SilkeToolbarProps = {
|
|
8
|
-
size?:
|
|
9
|
+
size?: SilkeInputSize;
|
|
9
10
|
} & Omit<BoxDivProps, 'height' | 'width' | 'tag'>;
|
|
10
11
|
|
|
11
|
-
export function SilkeToolbar({ size = '
|
|
12
|
+
export function SilkeToolbar({ size = 'base', children, className, ...rest }: SilkeToolbarProps) {
|
|
12
13
|
let cl = styles.root;
|
|
13
14
|
if (className) cl += ' ' + className;
|
|
14
15
|
return (
|
|
15
|
-
<ButtonContext size={size
|
|
16
|
+
<ButtonContext size={size} kind="ghost">
|
|
16
17
|
<TextFieldContext size={size} kind="ghost" inline>
|
|
17
18
|
<SilkeBox tag="div" className={cl} height={size} {...rest}>
|
|
18
19
|
{children}
|
|
@@ -5,7 +5,7 @@ import { SilkeBox } from '../silke-box';
|
|
|
5
5
|
import { SilkeIcon, SilkeIcons } from '../silke-icon';
|
|
6
6
|
import { SilkeShortcuts } from './silke-shortcuts';
|
|
7
7
|
import { SilkeTooltip, SilkeTooltipProps } from './silke-tooltip';
|
|
8
|
-
import
|
|
8
|
+
import DOMPurify from 'dompurify';
|
|
9
9
|
|
|
10
10
|
type SilkeIconTooltipProps = {
|
|
11
11
|
icon?: SilkeIcons;
|
|
@@ -15,6 +15,7 @@ type SilkeIconTooltipProps = {
|
|
|
15
15
|
show?: boolean;
|
|
16
16
|
/** If interaction content in the tooltip then this should be set to true */
|
|
17
17
|
interactive?: boolean;
|
|
18
|
+
noMargin?: boolean;
|
|
18
19
|
} & Omit<SilkeTooltipProps, 'children' | 'anchor' | 'show'>;
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -28,6 +29,7 @@ export function SilkeIconTooltip({
|
|
|
28
29
|
tooltip,
|
|
29
30
|
tooltipTitle,
|
|
30
31
|
size,
|
|
32
|
+
noMargin,
|
|
31
33
|
...rest
|
|
32
34
|
}: SilkeIconTooltipProps) {
|
|
33
35
|
const ref = useRef<HTMLElement | null>(null);
|
|
@@ -88,7 +90,7 @@ export function SilkeIconTooltip({
|
|
|
88
90
|
|
|
89
91
|
return (
|
|
90
92
|
<>
|
|
91
|
-
<span ref={ref} style={{ marginLeft: 8 }}>
|
|
93
|
+
<span ref={ref} style={{ marginLeft: noMargin ? 0 : 8 }}>
|
|
92
94
|
<SilkeIcon icon={icon} />
|
|
93
95
|
</span>
|
|
94
96
|
<SilkeTooltip
|
|
@@ -100,7 +102,7 @@ export function SilkeIconTooltip({
|
|
|
100
102
|
>
|
|
101
103
|
<SilkeBox gap="s" ref={contentRef} style={{ pointerEvents: interactive ? 'all' : 'none' }}>
|
|
102
104
|
{isString(tooltip) ? (
|
|
103
|
-
<span dangerouslySetInnerHTML={{ __html:
|
|
105
|
+
<span dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(tooltip) }} />
|
|
104
106
|
) : (
|
|
105
107
|
<span>{tooltip}</span>
|
|
106
108
|
)}
|
|
@@ -13,10 +13,11 @@ function isShortcutIcon(key: string) {
|
|
|
13
13
|
|
|
14
14
|
export const SilkeShortcuts = ({
|
|
15
15
|
shortcuts,
|
|
16
|
+
style,
|
|
16
17
|
...rest
|
|
17
18
|
}: { shortcuts?: KeyboardEventCode[] } & BoxDivProps) =>
|
|
18
19
|
shortcuts ? (
|
|
19
|
-
<SilkeBox gap="s">
|
|
20
|
+
<SilkeBox gap="s" style={style}>
|
|
20
21
|
{shortcuts.map((s, i) => (
|
|
21
22
|
<SilkeBox key={i}>
|
|
22
23
|
<SilkeBox
|
|
@@ -29,11 +30,15 @@ export const SilkeShortcuts = ({
|
|
|
29
30
|
gap="xs"
|
|
30
31
|
{...rest}
|
|
31
32
|
>
|
|
32
|
-
{Keyboard.getFormatted(s).map((keys) =>
|
|
33
|
+
{Keyboard.getFormatted(s).map((keys, i) =>
|
|
33
34
|
keys
|
|
34
35
|
.split(' ')
|
|
35
36
|
.map((f) =>
|
|
36
|
-
isShortcutIcon(f) ?
|
|
37
|
+
isShortcutIcon(f) ? (
|
|
38
|
+
<SilkeIcon icon={f as IconSymbol} key={i} />
|
|
39
|
+
) : (
|
|
40
|
+
<span key={i}>{f}</span>
|
|
41
|
+
),
|
|
37
42
|
),
|
|
38
43
|
)}
|
|
39
44
|
</SilkeBox>
|
|
@@ -10,6 +10,8 @@ import { SilkeText, SilkeTitle } from '../silke-text';
|
|
|
10
10
|
import { SilkeIcon } from '../silke-icon';
|
|
11
11
|
|
|
12
12
|
import styles from './silke-upload-field.scss';
|
|
13
|
+
import { SilkePopover } from '../silke-popover';
|
|
14
|
+
import { SilkeTooltip } from '../silke-tooltip';
|
|
13
15
|
|
|
14
16
|
export type FileModel = {
|
|
15
17
|
size?: number;
|
|
@@ -141,7 +143,7 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
141
143
|
};
|
|
142
144
|
|
|
143
145
|
if (invalidFormat) model.error = 'Not a valid format';
|
|
144
|
-
else if (tooLarge) model.error = `The file is too large, max size is ${maxSize}MB`;
|
|
146
|
+
else if (tooLarge) model.error = `The file is too large, max size is ${maxSize / 1024}MB`;
|
|
145
147
|
uploadFiles.push(model);
|
|
146
148
|
}
|
|
147
149
|
}
|
|
@@ -190,6 +192,7 @@ export function SilkeUploadField(props: SilkeUploadFieldProps) {
|
|
|
190
192
|
column
|
|
191
193
|
bg="neutral-10"
|
|
192
194
|
style={dropzoneStyle}
|
|
195
|
+
hAlign="center"
|
|
193
196
|
>
|
|
194
197
|
<SilkeIcon icon="file.arrow.up" className={styles.icon} />
|
|
195
198
|
<SilkeBox column gap="s">
|
|
@@ -249,6 +252,8 @@ type FileItemProps = {
|
|
|
249
252
|
};
|
|
250
253
|
|
|
251
254
|
function SilkeFileItem({ file, error, loading, onRemove, style }: FileItemProps) {
|
|
255
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
256
|
+
const [hover, setHover] = useState(false);
|
|
252
257
|
if (isString(file)) {
|
|
253
258
|
file = { name: last(file.split('/')) || 'Untitled', size: 0, type: 'test', url: file };
|
|
254
259
|
}
|
|
@@ -258,12 +263,24 @@ function SilkeFileItem({ file, error, loading, onRemove, style }: FileItemProps)
|
|
|
258
263
|
if (!error && !loading) cl += ' ' + styles.complete;
|
|
259
264
|
|
|
260
265
|
return (
|
|
261
|
-
<SilkeBox
|
|
266
|
+
<SilkeBox
|
|
267
|
+
ref={ref}
|
|
268
|
+
style={style}
|
|
269
|
+
className={cl}
|
|
270
|
+
vAlign="center"
|
|
271
|
+
onMouseEnter={() => setHover(true)}
|
|
272
|
+
onMouseLeave={() => setHover(false)}
|
|
273
|
+
>
|
|
262
274
|
<SilkeText overflow flex>
|
|
263
275
|
{file.name}
|
|
264
276
|
</SilkeText>
|
|
265
|
-
<SilkeButton icon="close" kind="ghost"
|
|
277
|
+
<SilkeButton icon="close" kind="ghost" onClick={onRemove} />
|
|
266
278
|
{!error && loading && <SilkeSkeleton className={styles.loader} />}
|
|
279
|
+
{error && (
|
|
280
|
+
<SilkeTooltip anchor={ref} show={hover} size="tiny" anchorOrigin="top-center">
|
|
281
|
+
<SilkeText size="small">{error}</SilkeText>
|
|
282
|
+
</SilkeTooltip>
|
|
283
|
+
)}
|
|
267
284
|
</SilkeBox>
|
|
268
285
|
);
|
|
269
286
|
}
|
|
@@ -32,8 +32,8 @@ export function SilkeVariablesWrapperForm(props: SilkeVariablesWrapperFormProps)
|
|
|
32
32
|
readOnly
|
|
33
33
|
/>
|
|
34
34
|
<SilkeBox hPad="s" hAlign="end" gap="s">
|
|
35
|
-
<SilkeButton
|
|
36
|
-
<SilkeButton
|
|
35
|
+
<SilkeButton label="Close" kind="ghost" onClick={props.onClose} />
|
|
36
|
+
<SilkeButton label="Create" kind="primary" type="submit" />
|
|
37
37
|
</SilkeBox>
|
|
38
38
|
</SilkeForm>
|
|
39
39
|
</TextFieldContext>
|