@wordpress/components 20.0.1-next.d6164808d3.0 → 20.0.2-next.957ca95e4c.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 +29 -1
- package/CONTRIBUTING.md +12 -12
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js +7 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +3 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/card/card/component.js +6 -11
- package/build/card/card/component.js.map +1 -1
- package/build/card/card/hook.js +0 -10
- package/build/card/card/hook.js.map +1 -1
- package/build/card/card/index.js.map +1 -1
- package/build/card/card-body/component.js +7 -8
- package/build/card/card-body/component.js.map +1 -1
- package/build/card/card-body/hook.js +0 -4
- package/build/card/card-body/hook.js.map +1 -1
- package/build/card/card-body/index.js.map +1 -1
- package/build/card/card-divider/component.js +7 -8
- package/build/card/card-divider/component.js.map +1 -1
- package/build/card/card-divider/hook.js +0 -4
- package/build/card/card-divider/hook.js.map +1 -1
- package/build/card/card-divider/index.js.map +1 -1
- package/build/card/card-footer/component.js +7 -8
- package/build/card/card-footer/component.js.map +1 -1
- package/build/card/card-footer/hook.js +0 -4
- package/build/card/card-footer/hook.js.map +1 -1
- package/build/card/card-footer/index.js.map +1 -1
- package/build/card/card-header/component.js +7 -8
- package/build/card/card-header/component.js.map +1 -1
- package/build/card/card-header/hook.js +0 -4
- package/build/card/card-header/hook.js.map +1 -1
- package/build/card/card-header/index.js.map +1 -1
- package/build/card/card-media/component.js +7 -7
- package/build/card/card-media/component.js.map +1 -1
- package/build/card/card-media/hook.js +0 -4
- package/build/card/card-media/hook.js.map +1 -1
- package/build/card/card-media/index.js.map +1 -1
- package/build/card/context.js.map +1 -1
- package/build/card/index.js.map +1 -1
- package/build/card/styles.js +17 -17
- package/build/card/styles.js.map +1 -1
- package/build/clipboard-button/index.js +16 -1
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +6 -2
- package/build/color-palette/index.js.map +1 -1
- package/build/custom-gradient-picker/index.js +11 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date/index.js +25 -6
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +22 -12
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date-time/index.js +1 -3
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/date-time/styles.js +19 -5
- package/build/date-time/date-time/styles.js.map +1 -1
- package/build/date-time/time/styles.js +12 -12
- package/build/date-time/time/styles.js.map +1 -1
- package/build/drop-zone/index.js +2 -4
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown-menu/index.js +1 -3
- package/build/dropdown-menu/index.js.map +1 -1
- package/build/dropdown-menu/index.native.js +0 -17
- package/build/dropdown-menu/index.native.js.map +1 -1
- package/build/focal-point-picker/controls.js +4 -4
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +4 -6
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/grid.js +6 -35
- package/build/focal-point-picker/grid.js.map +1 -1
- package/build/focal-point-picker/index.js +160 -330
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/media.js +4 -34
- package/build/focal-point-picker/media.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +14 -14
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/utils.js +2 -6
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/focusable-iframe/index.js +6 -0
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/form-token-field/index.js +18 -15
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +12 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/index.js +8 -6
- package/build/guide/index.js.map +1 -1
- package/build/higher-order/with-constrained-tabbing/index.js +1 -1
- package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build/higher-order/with-spoken-messages/index.js +2 -0
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/isolated-event-container/index.js +4 -0
- package/build/isolated-event-container/index.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +1 -1
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/navigable-container/menu.js +3 -9
- package/build/navigable-container/menu.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +1 -3
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/palette-edit/index.js +6 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +15 -35
- package/build/popover/index.js.map +1 -1
- package/build/text-highlight/index.js +4 -4
- package/build/text-highlight/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +23 -8
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/tooltip/index.js +1 -7
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/index.js +4 -10
- package/build/tree-grid/index.js.map +1 -1
- package/build/utils/strings.js +13 -0
- package/build/utils/strings.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +12 -12
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js +6 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +2 -1
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/card/card/component.js +5 -10
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/card/hook.js +0 -9
- package/build-module/card/card/hook.js.map +1 -1
- package/build-module/card/card/index.js.map +1 -1
- package/build-module/card/card-body/component.js +7 -8
- package/build-module/card/card-body/component.js.map +1 -1
- package/build-module/card/card-body/hook.js +0 -4
- package/build-module/card/card-body/hook.js.map +1 -1
- package/build-module/card/card-body/index.js.map +1 -1
- package/build-module/card/card-divider/component.js +7 -8
- package/build-module/card/card-divider/component.js.map +1 -1
- package/build-module/card/card-divider/hook.js +0 -4
- package/build-module/card/card-divider/hook.js.map +1 -1
- package/build-module/card/card-divider/index.js.map +1 -1
- package/build-module/card/card-footer/component.js +7 -8
- package/build-module/card/card-footer/component.js.map +1 -1
- package/build-module/card/card-footer/hook.js +0 -4
- package/build-module/card/card-footer/hook.js.map +1 -1
- package/build-module/card/card-footer/index.js.map +1 -1
- package/build-module/card/card-header/component.js +7 -8
- package/build-module/card/card-header/component.js.map +1 -1
- package/build-module/card/card-header/hook.js +0 -4
- package/build-module/card/card-header/hook.js.map +1 -1
- package/build-module/card/card-header/index.js.map +1 -1
- package/build-module/card/card-media/component.js +7 -7
- package/build-module/card/card-media/component.js.map +1 -1
- package/build-module/card/card-media/hook.js +0 -4
- package/build-module/card/card-media/hook.js.map +1 -1
- package/build-module/card/card-media/index.js.map +1 -1
- package/build-module/card/context.js.map +1 -1
- package/build-module/card/index.js.map +1 -1
- package/build-module/card/styles.js +17 -17
- package/build-module/card/styles.js.map +1 -1
- package/build-module/clipboard-button/index.js +17 -1
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +5 -2
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +10 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date/index.js +27 -8
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +21 -5
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date-time/index.js +2 -3
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/date-time/styles.js +20 -1
- package/build-module/date-time/date-time/styles.js.map +1 -1
- package/build-module/date-time/time/styles.js +12 -12
- package/build-module/date-time/time/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +2 -3
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown-menu/index.js +1 -2
- package/build-module/dropdown-menu/index.js.map +1 -1
- package/build-module/dropdown-menu/index.native.js +0 -16
- package/build-module/dropdown-menu/index.native.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +4 -4
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +4 -6
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/grid.js +6 -34
- package/build-module/focal-point-picker/grid.js.map +1 -1
- package/build-module/focal-point-picker/index.js +158 -325
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/media.js +4 -36
- package/build-module/focal-point-picker/media.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -14
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +2 -6
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/focusable-iframe/index.js +6 -0
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/form-token-field/index.js +18 -14
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +11 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/index.js +8 -5
- package/build-module/guide/index.js.map +1 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js +1 -1
- package/build-module/higher-order/with-constrained-tabbing/index.js.map +1 -1
- package/build-module/higher-order/with-spoken-messages/index.js +2 -0
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/isolated-event-container/index.js +3 -0
- package/build-module/isolated-event-container/index.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +2 -2
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/navigable-container/menu.js +3 -8
- package/build-module/navigable-container/menu.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +1 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/palette-edit/index.js +6 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +15 -35
- package/build-module/popover/index.js.map +1 -1
- package/build-module/text-highlight/index.js +2 -5
- package/build-module/text-highlight/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +20 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/tooltip/index.js +1 -6
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/index.js +4 -9
- package/build-module/tree-grid/index.js.map +1 -1
- package/build-module/utils/strings.js +11 -0
- package/build-module/utils/strings.js.map +1 -1
- package/build-style/style-rtl.css +2 -21
- package/build-style/style.css +2 -21
- package/build-types/animation/index.d.ts +2 -0
- package/build-types/animation/index.d.ts.map +1 -0
- package/build-types/card/card/component.d.ts +3 -3
- package/build-types/card/card/component.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +7 -2
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card/index.d.ts +2 -2
- package/build-types/card/card/index.d.ts.map +1 -1
- package/build-types/card/card-body/component.d.ts +3 -3
- package/build-types/card/card-body/component.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +5 -2
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-body/index.d.ts +2 -2
- package/build-types/card/card-body/index.d.ts.map +1 -1
- package/build-types/card/card-divider/component.d.ts +3 -3
- package/build-types/card/card-divider/component.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +5 -2
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/index.d.ts +2 -2
- package/build-types/card/card-divider/index.d.ts.map +1 -1
- package/build-types/card/card-footer/component.d.ts +3 -3
- package/build-types/card/card-footer/component.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +5 -2
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/index.d.ts +2 -2
- package/build-types/card/card-footer/index.d.ts.map +1 -1
- package/build-types/card/card-header/component.d.ts +3 -3
- package/build-types/card/card-header/component.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +5 -2
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-header/index.d.ts +2 -2
- package/build-types/card/card-header/index.d.ts.map +1 -1
- package/build-types/card/card-media/component.d.ts +3 -4
- package/build-types/card/card-media/component.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +6 -5
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/card/card-media/index.d.ts +2 -2
- package/build-types/card/card-media/index.d.ts.map +1 -1
- package/build-types/card/context.d.ts +3 -2
- package/build-types/card/context.d.ts.map +1 -1
- package/build-types/card/index.d.ts +6 -6
- package/build-types/card/index.d.ts.map +1 -1
- package/build-types/card/stories/index.d.ts +12 -0
- package/build-types/card/stories/index.d.ts.map +1 -0
- package/build-types/card/styles.d.ts +20 -22
- package/build-types/card/styles.d.ts.map +1 -1
- package/build-types/card/test/index.d.ts +2 -0
- package/build-types/card/test/index.d.ts.map +1 -0
- package/build-types/card/types.d.ts +7 -1
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/clipboard-button/index.d.ts +16 -0
- package/build-types/clipboard-button/index.d.ts.map +1 -0
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/composite/index.d.ts +2 -0
- package/build-types/composite/index.d.ts.map +1 -0
- package/build-types/date-time/date/index.d.ts +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +4 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +13 -0
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/disclosure/index.d.ts +2 -0
- package/build-types/disclosure/index.d.ts.map +1 -0
- package/build-types/dropdown-menu/index.d.ts.map +1 -1
- package/build-types/focusable-iframe/index.d.ts +8 -0
- package/build-types/focusable-iframe/index.d.ts.map +1 -0
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/test/index.d.ts +2 -0
- package/build-types/form-token-field/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts +3 -0
- package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts +4 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -0
- package/build-types/isolated-event-container/index.d.ts +3 -0
- package/build-types/isolated-event-container/index.d.ts.map +1 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts +3 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +1 -0
- package/build-types/navigable-container/menu.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +0 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/radio-context/index.d.ts +6 -0
- package/build-types/radio-context/index.d.ts.map +1 -0
- package/build-types/text-highlight/index.d.ts +0 -3
- package/build-types/text-highlight/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +4 -0
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/utils/strings.d.ts +8 -0
- package/build-types/utils/strings.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -0
- package/src/autocomplete/get-default-use-items.js +6 -1
- package/src/autocomplete/index.js +2 -1
- package/src/card/card/{component.js → component.tsx} +13 -9
- package/src/card/card/{hook.js → hook.ts} +11 -11
- package/src/card/card/{index.js → index.ts} +0 -0
- package/src/card/card-body/{component.js → component.tsx} +13 -9
- package/src/card/card-body/{hook.js → hook.ts} +5 -5
- package/src/card/card-body/{index.js → index.ts} +0 -0
- package/src/card/card-divider/{component.js → component.tsx} +16 -10
- package/src/card/card-divider/{hook.js → hook.ts} +5 -5
- package/src/card/card-divider/{index.js → index.ts} +0 -0
- package/src/card/card-footer/{component.js → component.tsx} +13 -9
- package/src/card/card-footer/{hook.js → hook.ts} +5 -5
- package/src/card/card-footer/{index.js → index.ts} +0 -0
- package/src/card/card-header/{component.js → component.tsx} +13 -9
- package/src/card/card-header/{hook.js → hook.ts} +5 -5
- package/src/card/card-header/{index.js → index.ts} +0 -0
- package/src/card/card-media/{component.js → component.tsx} +13 -8
- package/src/card/card-media/{hook.js → hook.ts} +5 -5
- package/src/card/card-media/{index.js → index.ts} +0 -0
- package/src/card/{context.js → context.ts} +0 -0
- package/src/card/{index.js → index.ts} +0 -0
- package/src/card/stories/index.tsx +75 -0
- package/src/card/{styles.js → styles.ts} +0 -0
- package/src/card/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/card/test/{index.js → index.tsx} +3 -3
- package/src/card/types.ts +8 -1
- package/src/clipboard-button/index.js +13 -0
- package/src/color-palette/index.js +8 -5
- package/src/color-palette/style.scss +0 -14
- package/src/color-palette/test/__snapshots__/index.js.snap +11 -4
- package/src/custom-gradient-picker/index.js +12 -0
- package/src/custom-gradient-picker/stories/index.js +3 -0
- package/src/date-time/date/index.tsx +26 -6
- package/src/date-time/date/styles.ts +6 -0
- package/src/date-time/date/test/index.tsx +6 -2
- package/src/date-time/date-time/index.tsx +3 -4
- package/src/date-time/date-time/styles.ts +9 -0
- package/src/date-time/time/styles.ts +1 -0
- package/src/drop-zone/index.js +2 -3
- package/src/dropdown-menu/index.js +1 -2
- package/src/dropdown-menu/index.native.js +0 -13
- package/src/dropdown-menu/test/index.js +54 -58
- package/src/focal-point-picker/README.md +3 -6
- package/src/focal-point-picker/controls.js +4 -4
- package/src/focal-point-picker/focal-point.js +2 -8
- package/src/focal-point-picker/grid.js +5 -41
- package/src/focal-point-picker/index.js +161 -303
- package/src/focal-point-picker/media.js +4 -28
- package/src/focal-point-picker/styles/focal-point-picker-style.js +5 -8
- package/src/focal-point-picker/test/index.js +1 -1
- package/src/focal-point-picker/utils.js +2 -6
- package/src/focusable-iframe/index.js +5 -0
- package/src/form-token-field/index.tsx +17 -23
- package/src/form-token-field/test/index.tsx +2106 -0
- package/src/gradient-picker/README.md +9 -0
- package/src/gradient-picker/index.js +9 -0
- package/src/gradient-picker/stories/index.js +1 -0
- package/src/guide/index.js +6 -3
- package/src/guide/test/index.js +138 -1
- package/src/higher-order/with-constrained-tabbing/index.js +1 -1
- package/src/higher-order/with-spoken-messages/index.js +2 -0
- package/src/isolated-event-container/index.js +3 -0
- package/src/mobile/global-styles-context/utils.native.js +7 -2
- package/src/navigable-container/menu.js +3 -7
- package/src/navigation/menu/menu-title-search.js +1 -2
- package/src/palette-edit/index.js +14 -10
- package/src/palette-edit/style.scss +3 -11
- package/src/placeholder/style.scss +1 -4
- package/src/popover/index.js +17 -35
- package/src/popover/stories/index.js +0 -1
- package/src/text-highlight/index.tsx +1 -5
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +62 -44
- package/src/toggle-group-control/toggle-group-control/component.tsx +3 -2
- package/src/toggle-group-control/toggle-group-control/styles.ts +5 -0
- package/src/tooltip/index.js +1 -5
- package/src/tree-grid/index.js +4 -9
- package/src/utils/strings.ts +11 -0
- package/tsconfig.json +45 -76
- package/tsconfig.tsbuildinfo +1 -1
- package/build/ui/__storybook-utils/example-grid.js +0 -88
- package/build/ui/__storybook-utils/example-grid.js.map +0 -1
- package/build/ui/__storybook-utils/index.js +0 -19
- package/build/ui/__storybook-utils/index.js.map +0 -1
- package/build/ui/__storybook-utils/page.js +0 -43
- package/build/ui/__storybook-utils/page.js.map +0 -1
- package/build/utils/keyboard.js +0 -41
- package/build/utils/keyboard.js.map +0 -1
- package/build-module/ui/__storybook-utils/example-grid.js +0 -69
- package/build-module/ui/__storybook-utils/example-grid.js.map +0 -1
- package/build-module/ui/__storybook-utils/index.js +0 -2
- package/build-module/ui/__storybook-utils/index.js.map +0 -1
- package/build-module/ui/__storybook-utils/page.js +0 -32
- package/build-module/ui/__storybook-utils/page.js.map +0 -1
- package/build-module/utils/keyboard.js +0 -33
- package/build-module/utils/keyboard.js.map +0 -1
- package/build-types/form-token-field/test/lib/fixtures.d.ts +0 -26
- package/build-types/form-token-field/test/lib/fixtures.d.ts.map +0 -1
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +0 -21
- package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +0 -1
- package/build-types/utils/keyboard.d.ts +0 -12
- package/build-types/utils/keyboard.d.ts.map +0 -1
- package/src/card/stories/index.js +0 -209
- package/src/form-token-field/test/index.js +0 -442
- package/src/form-token-field/test/lib/fixtures.js +0 -89
- package/src/form-token-field/test/lib/token-field-wrapper.tsx +0 -71
- package/src/guide/test/page-control.js +0 -40
- package/src/ui/__storybook-utils/example-grid.js +0 -61
- package/src/ui/__storybook-utils/index.js +0 -1
- package/src/ui/__storybook-utils/page.js +0 -29
- package/src/utils/keyboard.js +0 -28
- package/src/utils/test/keyboard.js +0 -34
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ExampleMetaContent = exports.ExampleGridItem = exports.ExampleGrid = void 0;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _grid = require("../../grid");
|
|
11
|
-
|
|
12
|
-
var _surface = require("../../surface");
|
|
13
|
-
|
|
14
|
-
var _text = require("../../text");
|
|
15
|
-
|
|
16
|
-
var _view = require("../../view");
|
|
17
|
-
|
|
18
|
-
var _vStack = require("../../v-stack");
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
const Container = _ref => {
|
|
24
|
-
let {
|
|
25
|
-
children
|
|
26
|
-
} = _ref;
|
|
27
|
-
return (0, _element.createElement)("div", {
|
|
28
|
-
style: {
|
|
29
|
-
maxWidth: 1280,
|
|
30
|
-
width: '100%',
|
|
31
|
-
marginLeft: 'auto',
|
|
32
|
-
marginRight: 'auto'
|
|
33
|
-
}
|
|
34
|
-
}, children);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const ExampleGrid = _ref2 => {
|
|
38
|
-
let {
|
|
39
|
-
children
|
|
40
|
-
} = _ref2;
|
|
41
|
-
return (0, _element.createElement)(Container, null, (0, _element.createElement)(_grid.Grid, {
|
|
42
|
-
columns: [2, 2, 4],
|
|
43
|
-
gap: "1px"
|
|
44
|
-
}, children));
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
exports.ExampleGrid = ExampleGrid;
|
|
48
|
-
|
|
49
|
-
const ExampleGridItem = _ref3 => {
|
|
50
|
-
let {
|
|
51
|
-
children
|
|
52
|
-
} = _ref3;
|
|
53
|
-
return (0, _element.createElement)(_surface.Surface, {
|
|
54
|
-
variant: "secondary",
|
|
55
|
-
style: {
|
|
56
|
-
padding: 20
|
|
57
|
-
}
|
|
58
|
-
}, (0, _element.createElement)(_vStack.VStack, {
|
|
59
|
-
alignment: "center"
|
|
60
|
-
}, children));
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
exports.ExampleGridItem = ExampleGridItem;
|
|
64
|
-
|
|
65
|
-
const ExampleMetaContent = _ref4 => {
|
|
66
|
-
let {
|
|
67
|
-
title,
|
|
68
|
-
items = []
|
|
69
|
-
} = _ref4;
|
|
70
|
-
return (0, _element.createElement)(_grid.Grid, {
|
|
71
|
-
templateColumns: "60px 1fr"
|
|
72
|
-
}, (0, _element.createElement)(_view.View, null, (0, _element.createElement)(_text.Text, {
|
|
73
|
-
size: "caption",
|
|
74
|
-
weight: "bold",
|
|
75
|
-
align: "right",
|
|
76
|
-
isBlock: true
|
|
77
|
-
}, title)), (0, _element.createElement)(_vStack.VStack, {
|
|
78
|
-
spacing: 1
|
|
79
|
-
}, items.map((item, index) => (0, _element.createElement)(_view.View, {
|
|
80
|
-
key: index
|
|
81
|
-
}, (0, _element.createElement)(_text.Text, {
|
|
82
|
-
size: "caption",
|
|
83
|
-
isBlock: true
|
|
84
|
-
}, item)))));
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
exports.ExampleMetaContent = ExampleMetaContent;
|
|
88
|
-
//# sourceMappingURL=example-grid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/example-grid.js"],"names":["Container","children","maxWidth","width","marginLeft","marginRight","ExampleGrid","ExampleGridItem","padding","ExampleMetaContent","title","items","map","item","index"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,MAAMA,SAAS,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACjB;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,QAAQ,EAAE,IADH;AAEPC,MAAAA,KAAK,EAAE,MAFA;AAGPC,MAAAA,UAAU,EAAE,MAHL;AAIPC,MAAAA,WAAW,EAAE;AAJN;AADT,KAQGJ,QARH,CADiB;AAAA,CAAlB;;AAaO,MAAMK,WAAW,GAAG;AAAA,MAAE;AAAEL,IAAAA;AAAF,GAAF;AAAA,SAC1B,4BAAC,SAAD,QACC,4BAAC,UAAD;AAAM,IAAA,OAAO,EAAG,CAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,CAAhB;AAA8B,IAAA,GAAG,EAAC;AAAlC,KACGA,QADH,CADD,CAD0B;AAAA,CAApB;;;;AAQA,MAAMM,eAAe,GAAG;AAAA,MAAE;AAAEN,IAAAA;AAAF,GAAF;AAAA,SAC9B,4BAAC,gBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,KAAK,EAAG;AACPO,MAAAA,OAAO,EAAE;AADF;AAFT,KAMC,4BAAC,cAAD;AAAQ,IAAA,SAAS,EAAC;AAAlB,KAA6BP,QAA7B,CAND,CAD8B;AAAA,CAAxB;;;;AAWA,MAAMQ,kBAAkB,GAAG,SAA6B;AAAA,MAA3B;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAK,GAAG;AAAjB,GAA2B;AAC9D,SACC,4BAAC,UAAD;AAAM,IAAA,eAAe,EAAC;AAAtB,KACC,4BAAC,UAAD,QACC,4BAAC,UAAD;AAAM,IAAA,IAAI,EAAC,SAAX;AAAqB,IAAA,MAAM,EAAC,MAA5B;AAAmC,IAAA,KAAK,EAAC,OAAzC;AAAiD,IAAA,OAAO;AAAxD,KACGD,KADH,CADD,CADD,EAMC,4BAAC,cAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACGC,KAAK,CAACC,GAAN,CAAW,CAAEC,IAAF,EAAQC,KAAR,KACZ,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGA;AAAZ,KACC,4BAAC,UAAD;AAAM,IAAA,IAAI,EAAC,SAAX;AAAqB,IAAA,OAAO;AAA5B,KACGD,IADH,CADD,CADC,CADH,CAND,CADD;AAkBA,CAnBM","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Grid } from '../../grid';\nimport { Surface } from '../../surface';\nimport { Text } from '../../text';\nimport { View } from '../../view';\nimport { VStack } from '../../v-stack';\n\nconst Container = ( { children } ) => (\n\t<div\n\t\tstyle={ {\n\t\t\tmaxWidth: 1280,\n\t\t\twidth: '100%',\n\t\t\tmarginLeft: 'auto',\n\t\t\tmarginRight: 'auto',\n\t\t} }\n\t>\n\t\t{ children }\n\t</div>\n);\n\nexport const ExampleGrid = ( { children } ) => (\n\t<Container>\n\t\t<Grid columns={ [ 2, 2, 4 ] } gap=\"1px\">\n\t\t\t{ children }\n\t\t</Grid>\n\t</Container>\n);\n\nexport const ExampleGridItem = ( { children } ) => (\n\t<Surface\n\t\tvariant=\"secondary\"\n\t\tstyle={ {\n\t\t\tpadding: 20,\n\t\t} }\n\t>\n\t\t<VStack alignment=\"center\">{ children }</VStack>\n\t</Surface>\n);\n\nexport const ExampleMetaContent = ( { title, items = [] } ) => {\n\treturn (\n\t\t<Grid templateColumns=\"60px 1fr\">\n\t\t\t<View>\n\t\t\t\t<Text size=\"caption\" weight=\"bold\" align=\"right\" isBlock>\n\t\t\t\t\t{ title }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t<View key={ index }>\n\t\t\t\t\t\t<Text size=\"caption\" isBlock>\n\t\t\t\t\t\t\t{ item }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t</Grid>\n\t);\n};\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _exampleGrid = require("./example-grid");
|
|
8
|
-
|
|
9
|
-
Object.keys(_exampleGrid).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _exampleGrid[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _exampleGrid[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/index.js"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './example-grid';\n"]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _vStack = require("../../v-stack");
|
|
11
|
-
|
|
12
|
-
var _view = require("../../view");
|
|
13
|
-
|
|
14
|
-
var _heading = require("../../heading");
|
|
15
|
-
|
|
16
|
-
var _divider = require("../../divider");
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
function Page(_ref) {
|
|
22
|
-
let {
|
|
23
|
-
title = 'Component',
|
|
24
|
-
children
|
|
25
|
-
} = _ref;
|
|
26
|
-
return (0, _element.createElement)("div", {
|
|
27
|
-
style: {
|
|
28
|
-
paddingTop: 24,
|
|
29
|
-
paddingBottom: '20vh',
|
|
30
|
-
maxWidth: '1280px',
|
|
31
|
-
marginLeft: 'auto',
|
|
32
|
-
marginRight: 'auto'
|
|
33
|
-
}
|
|
34
|
-
}, (0, _element.createElement)(_vStack.VStack, {
|
|
35
|
-
spacing: 6
|
|
36
|
-
}, (0, _element.createElement)(_heading.Heading, {
|
|
37
|
-
size: 1
|
|
38
|
-
}, title), (0, _element.createElement)(_divider.Divider, null), (0, _element.createElement)(_view.View, null, children)));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var _default = Page;
|
|
42
|
-
exports.default = _default;
|
|
43
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/page.js"],"names":["Page","title","children","paddingTop","paddingBottom","maxWidth","marginLeft","marginRight"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,SAASA,IAAT,OAAmD;AAAA,MAApC;AAAEC,IAAAA,KAAK,GAAG,WAAV;AAAuBC,IAAAA;AAAvB,GAAoC;AAClD,SACC;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,UAAU,EAAE,EADL;AAEPC,MAAAA,aAAa,EAAE,MAFR;AAGPC,MAAAA,QAAQ,EAAE,QAHH;AAIPC,MAAAA,UAAU,EAAE,MAJL;AAKPC,MAAAA,WAAW,EAAE;AALN;AADT,KASC,4BAAC,cAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD;AAAS,IAAA,IAAI,EAAG;AAAhB,KAAsBN,KAAtB,CADD,EAEC,4BAAC,gBAAD,OAFD,EAGC,4BAAC,UAAD,QAAQC,QAAR,CAHD,CATD,CADD;AAiBA;;eAEcF,I","sourcesContent":["/**\n * Internal dependencies\n */\nimport { VStack } from '../../v-stack';\nimport { View } from '../../view';\nimport { Heading } from '../../heading';\nimport { Divider } from '../../divider';\n\nfunction Page( { title = 'Component', children } ) {\n\treturn (\n\t\t<div\n\t\t\tstyle={ {\n\t\t\t\tpaddingTop: 24,\n\t\t\t\tpaddingBottom: '20vh',\n\t\t\t\tmaxWidth: '1280px',\n\t\t\t\tmarginLeft: 'auto',\n\t\t\t\tmarginRight: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<Heading size={ 1 }>{ title }</Heading>\n\t\t\t\t<Divider />\n\t\t\t\t<View>{ children }</View>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default Page;\n"]}
|
package/build/utils/keyboard.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.normalizeArrowKey = normalizeArrowKey;
|
|
7
|
-
|
|
8
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @type {number[]}
|
|
16
|
-
*/
|
|
17
|
-
const arrowKeys = [_keycodes.RIGHT, _keycodes.UP, _keycodes.DOWN, _keycodes.LEFT];
|
|
18
|
-
/**
|
|
19
|
-
* Normalizes the 'key' property of a KeyboardEvent in IE/Edge
|
|
20
|
-
*
|
|
21
|
-
* Source:
|
|
22
|
-
* https://github.com/downshift-js/downshift/blob/a71005bd879d05d7dcb892d1e0dc5c6ca74e9d39/src/utils.js#L279
|
|
23
|
-
*
|
|
24
|
-
* @param {import('react').KeyboardEvent} event A keyboardEvent object
|
|
25
|
-
*
|
|
26
|
-
* @return {string} The keyboard key
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
function normalizeArrowKey(event) {
|
|
30
|
-
const {
|
|
31
|
-
key,
|
|
32
|
-
keyCode
|
|
33
|
-
} = event;
|
|
34
|
-
|
|
35
|
-
if (arrowKeys.includes(keyCode) && key.indexOf('Arrow') !== 0) {
|
|
36
|
-
return `Arrow${key}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return key;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=keyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/keyboard.js"],"names":["arrowKeys","RIGHT","UP","DOWN","LEFT","normalizeArrowKey","event","key","keyCode","includes","indexOf"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,CAAEC,eAAF,EAASC,YAAT,EAAaC,cAAb,EAAmBC,cAAnB,CAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,iBAAT,CAA4BC,KAA5B,EAAoC;AAC1C,QAAM;AAAEC,IAAAA,GAAF;AAAOC,IAAAA;AAAP,MAAmBF,KAAzB;;AAEA,MAAKN,SAAS,CAACS,QAAV,CAAoBD,OAApB,KAAiCD,GAAG,CAACG,OAAJ,CAAa,OAAb,MAA2B,CAAjE,EAAqE;AACpE,WAAQ,QAAQH,GAAK,EAArB;AACA;;AACD,SAAOA,GAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RIGHT, UP, DOWN, LEFT } from '@wordpress/keycodes';\n\n/**\n * @type {number[]}\n */\nconst arrowKeys = [ RIGHT, UP, DOWN, LEFT ];\n\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n *\n * Source:\n * https://github.com/downshift-js/downshift/blob/a71005bd879d05d7dcb892d1e0dc5c6ca74e9d39/src/utils.js#L279\n *\n * @param {import('react').KeyboardEvent} event A keyboardEvent object\n *\n * @return {string} The keyboard key\n */\nexport function normalizeArrowKey( event ) {\n\tconst { key, keyCode } = event;\n\n\tif ( arrowKeys.includes( keyCode ) && key.indexOf( 'Arrow' ) !== 0 ) {\n\t\treturn `Arrow${ key }`;\n\t}\n\treturn key;\n}\n"]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Internal dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { Grid } from '../../grid';
|
|
7
|
-
import { Surface } from '../../surface';
|
|
8
|
-
import { Text } from '../../text';
|
|
9
|
-
import { View } from '../../view';
|
|
10
|
-
import { VStack } from '../../v-stack';
|
|
11
|
-
|
|
12
|
-
const Container = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
children
|
|
15
|
-
} = _ref;
|
|
16
|
-
return createElement("div", {
|
|
17
|
-
style: {
|
|
18
|
-
maxWidth: 1280,
|
|
19
|
-
width: '100%',
|
|
20
|
-
marginLeft: 'auto',
|
|
21
|
-
marginRight: 'auto'
|
|
22
|
-
}
|
|
23
|
-
}, children);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const ExampleGrid = _ref2 => {
|
|
27
|
-
let {
|
|
28
|
-
children
|
|
29
|
-
} = _ref2;
|
|
30
|
-
return createElement(Container, null, createElement(Grid, {
|
|
31
|
-
columns: [2, 2, 4],
|
|
32
|
-
gap: "1px"
|
|
33
|
-
}, children));
|
|
34
|
-
};
|
|
35
|
-
export const ExampleGridItem = _ref3 => {
|
|
36
|
-
let {
|
|
37
|
-
children
|
|
38
|
-
} = _ref3;
|
|
39
|
-
return createElement(Surface, {
|
|
40
|
-
variant: "secondary",
|
|
41
|
-
style: {
|
|
42
|
-
padding: 20
|
|
43
|
-
}
|
|
44
|
-
}, createElement(VStack, {
|
|
45
|
-
alignment: "center"
|
|
46
|
-
}, children));
|
|
47
|
-
};
|
|
48
|
-
export const ExampleMetaContent = _ref4 => {
|
|
49
|
-
let {
|
|
50
|
-
title,
|
|
51
|
-
items = []
|
|
52
|
-
} = _ref4;
|
|
53
|
-
return createElement(Grid, {
|
|
54
|
-
templateColumns: "60px 1fr"
|
|
55
|
-
}, createElement(View, null, createElement(Text, {
|
|
56
|
-
size: "caption",
|
|
57
|
-
weight: "bold",
|
|
58
|
-
align: "right",
|
|
59
|
-
isBlock: true
|
|
60
|
-
}, title)), createElement(VStack, {
|
|
61
|
-
spacing: 1
|
|
62
|
-
}, items.map((item, index) => createElement(View, {
|
|
63
|
-
key: index
|
|
64
|
-
}, createElement(Text, {
|
|
65
|
-
size: "caption",
|
|
66
|
-
isBlock: true
|
|
67
|
-
}, item)))));
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=example-grid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/example-grid.js"],"names":["Grid","Surface","Text","View","VStack","Container","children","maxWidth","width","marginLeft","marginRight","ExampleGrid","ExampleGridItem","padding","ExampleMetaContent","title","items","map","item","index"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,YAArB;AACA,SAASC,OAAT,QAAwB,eAAxB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,MAAT,QAAuB,eAAvB;;AAEA,MAAMC,SAAS,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACjB;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,QAAQ,EAAE,IADH;AAEPC,MAAAA,KAAK,EAAE,MAFA;AAGPC,MAAAA,UAAU,EAAE,MAHL;AAIPC,MAAAA,WAAW,EAAE;AAJN;AADT,KAQGJ,QARH,CADiB;AAAA,CAAlB;;AAaA,OAAO,MAAMK,WAAW,GAAG;AAAA,MAAE;AAAEL,IAAAA;AAAF,GAAF;AAAA,SAC1B,cAAC,SAAD,QACC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAG,CAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,CAAhB;AAA8B,IAAA,GAAG,EAAC;AAAlC,KACGA,QADH,CADD,CAD0B;AAAA,CAApB;AAQP,OAAO,MAAMM,eAAe,GAAG;AAAA,MAAE;AAAEN,IAAAA;AAAF,GAAF;AAAA,SAC9B,cAAC,OAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,KAAK,EAAG;AACPO,MAAAA,OAAO,EAAE;AADF;AAFT,KAMC,cAAC,MAAD;AAAQ,IAAA,SAAS,EAAC;AAAlB,KAA6BP,QAA7B,CAND,CAD8B;AAAA,CAAxB;AAWP,OAAO,MAAMQ,kBAAkB,GAAG,SAA6B;AAAA,MAA3B;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAK,GAAG;AAAjB,GAA2B;AAC9D,SACC,cAAC,IAAD;AAAM,IAAA,eAAe,EAAC;AAAtB,KACC,cAAC,IAAD,QACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC,SAAX;AAAqB,IAAA,MAAM,EAAC,MAA5B;AAAmC,IAAA,KAAK,EAAC,OAAzC;AAAiD,IAAA,OAAO;AAAxD,KACGD,KADH,CADD,CADD,EAMC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACGC,KAAK,CAACC,GAAN,CAAW,CAAEC,IAAF,EAAQC,KAAR,KACZ,cAAC,IAAD;AAAM,IAAA,GAAG,EAAGA;AAAZ,KACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC,SAAX;AAAqB,IAAA,OAAO;AAA5B,KACGD,IADH,CADD,CADC,CADH,CAND,CADD;AAkBA,CAnBM","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Grid } from '../../grid';\nimport { Surface } from '../../surface';\nimport { Text } from '../../text';\nimport { View } from '../../view';\nimport { VStack } from '../../v-stack';\n\nconst Container = ( { children } ) => (\n\t<div\n\t\tstyle={ {\n\t\t\tmaxWidth: 1280,\n\t\t\twidth: '100%',\n\t\t\tmarginLeft: 'auto',\n\t\t\tmarginRight: 'auto',\n\t\t} }\n\t>\n\t\t{ children }\n\t</div>\n);\n\nexport const ExampleGrid = ( { children } ) => (\n\t<Container>\n\t\t<Grid columns={ [ 2, 2, 4 ] } gap=\"1px\">\n\t\t\t{ children }\n\t\t</Grid>\n\t</Container>\n);\n\nexport const ExampleGridItem = ( { children } ) => (\n\t<Surface\n\t\tvariant=\"secondary\"\n\t\tstyle={ {\n\t\t\tpadding: 20,\n\t\t} }\n\t>\n\t\t<VStack alignment=\"center\">{ children }</VStack>\n\t</Surface>\n);\n\nexport const ExampleMetaContent = ( { title, items = [] } ) => {\n\treturn (\n\t\t<Grid templateColumns=\"60px 1fr\">\n\t\t\t<View>\n\t\t\t\t<Text size=\"caption\" weight=\"bold\" align=\"right\" isBlock>\n\t\t\t\t\t{ title }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t<View key={ index }>\n\t\t\t\t\t\t<Text size=\"caption\" isBlock>\n\t\t\t\t\t\t\t{ item }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</View>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t</Grid>\n\t);\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/index.js"],"names":[],"mappings":"AAAA,cAAc,gBAAd","sourcesContent":["export * from './example-grid';\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Internal dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { VStack } from '../../v-stack';
|
|
7
|
-
import { View } from '../../view';
|
|
8
|
-
import { Heading } from '../../heading';
|
|
9
|
-
import { Divider } from '../../divider';
|
|
10
|
-
|
|
11
|
-
function Page(_ref) {
|
|
12
|
-
let {
|
|
13
|
-
title = 'Component',
|
|
14
|
-
children
|
|
15
|
-
} = _ref;
|
|
16
|
-
return createElement("div", {
|
|
17
|
-
style: {
|
|
18
|
-
paddingTop: 24,
|
|
19
|
-
paddingBottom: '20vh',
|
|
20
|
-
maxWidth: '1280px',
|
|
21
|
-
marginLeft: 'auto',
|
|
22
|
-
marginRight: 'auto'
|
|
23
|
-
}
|
|
24
|
-
}, createElement(VStack, {
|
|
25
|
-
spacing: 6
|
|
26
|
-
}, createElement(Heading, {
|
|
27
|
-
size: 1
|
|
28
|
-
}, title), createElement(Divider, null), createElement(View, null, children)));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default Page;
|
|
32
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/ui/__storybook-utils/page.js"],"names":["VStack","View","Heading","Divider","Page","title","children","paddingTop","paddingBottom","maxWidth","marginLeft","marginRight"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,eAAvB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,OAAT,QAAwB,eAAxB;AACA,SAASC,OAAT,QAAwB,eAAxB;;AAEA,SAASC,IAAT,OAAmD;AAAA,MAApC;AAAEC,IAAAA,KAAK,GAAG,WAAV;AAAuBC,IAAAA;AAAvB,GAAoC;AAClD,SACC;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,UAAU,EAAE,EADL;AAEPC,MAAAA,aAAa,EAAE,MAFR;AAGPC,MAAAA,QAAQ,EAAE,QAHH;AAIPC,MAAAA,UAAU,EAAE,MAJL;AAKPC,MAAAA,WAAW,EAAE;AALN;AADT,KASC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,OAAD;AAAS,IAAA,IAAI,EAAG;AAAhB,KAAsBN,KAAtB,CADD,EAEC,cAAC,OAAD,OAFD,EAGC,cAAC,IAAD,QAAQC,QAAR,CAHD,CATD,CADD;AAiBA;;AAED,eAAeF,IAAf","sourcesContent":["/**\n * Internal dependencies\n */\nimport { VStack } from '../../v-stack';\nimport { View } from '../../view';\nimport { Heading } from '../../heading';\nimport { Divider } from '../../divider';\n\nfunction Page( { title = 'Component', children } ) {\n\treturn (\n\t\t<div\n\t\t\tstyle={ {\n\t\t\t\tpaddingTop: 24,\n\t\t\t\tpaddingBottom: '20vh',\n\t\t\t\tmaxWidth: '1280px',\n\t\t\t\tmarginLeft: 'auto',\n\t\t\t\tmarginRight: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<Heading size={ 1 }>{ title }</Heading>\n\t\t\t\t<Divider />\n\t\t\t\t<View>{ children }</View>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default Page;\n"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { RIGHT, UP, DOWN, LEFT } from '@wordpress/keycodes';
|
|
5
|
-
/**
|
|
6
|
-
* @type {number[]}
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const arrowKeys = [RIGHT, UP, DOWN, LEFT];
|
|
10
|
-
/**
|
|
11
|
-
* Normalizes the 'key' property of a KeyboardEvent in IE/Edge
|
|
12
|
-
*
|
|
13
|
-
* Source:
|
|
14
|
-
* https://github.com/downshift-js/downshift/blob/a71005bd879d05d7dcb892d1e0dc5c6ca74e9d39/src/utils.js#L279
|
|
15
|
-
*
|
|
16
|
-
* @param {import('react').KeyboardEvent} event A keyboardEvent object
|
|
17
|
-
*
|
|
18
|
-
* @return {string} The keyboard key
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
export function normalizeArrowKey(event) {
|
|
22
|
-
const {
|
|
23
|
-
key,
|
|
24
|
-
keyCode
|
|
25
|
-
} = event;
|
|
26
|
-
|
|
27
|
-
if (arrowKeys.includes(keyCode) && key.indexOf('Arrow') !== 0) {
|
|
28
|
-
return `Arrow${key}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return key;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=keyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/keyboard.js"],"names":["RIGHT","UP","DOWN","LEFT","arrowKeys","normalizeArrowKey","event","key","keyCode","includes","indexOf"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,EAAgBC,EAAhB,EAAoBC,IAApB,EAA0BC,IAA1B,QAAsC,qBAAtC;AAEA;AACA;AACA;;AACA,MAAMC,SAAS,GAAG,CAAEJ,KAAF,EAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,CAAlB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,iBAAT,CAA4BC,KAA5B,EAAoC;AAC1C,QAAM;AAAEC,IAAAA,GAAF;AAAOC,IAAAA;AAAP,MAAmBF,KAAzB;;AAEA,MAAKF,SAAS,CAACK,QAAV,CAAoBD,OAApB,KAAiCD,GAAG,CAACG,OAAJ,CAAa,OAAb,MAA2B,CAAjE,EAAqE;AACpE,WAAQ,QAAQH,GAAK,EAArB;AACA;;AACD,SAAOA,GAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RIGHT, UP, DOWN, LEFT } from '@wordpress/keycodes';\n\n/**\n * @type {number[]}\n */\nconst arrowKeys = [ RIGHT, UP, DOWN, LEFT ];\n\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n *\n * Source:\n * https://github.com/downshift-js/downshift/blob/a71005bd879d05d7dcb892d1e0dc5c6ca74e9d39/src/utils.js#L279\n *\n * @param {import('react').KeyboardEvent} event A keyboardEvent object\n *\n * @return {string} The keyboard key\n */\nexport function normalizeArrowKey( event ) {\n\tconst { key, keyCode } = event;\n\n\tif ( arrowKeys.includes( keyCode ) && key.indexOf( 'Arrow' ) !== 0 ) {\n\t\treturn `Arrow${ key }`;\n\t}\n\treturn key;\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
namespace specialTokens {
|
|
3
|
-
const textEscaped: string[];
|
|
4
|
-
const htmlEscaped: string[];
|
|
5
|
-
const textUnescaped: string[];
|
|
6
|
-
const htmlUnescaped: string[];
|
|
7
|
-
}
|
|
8
|
-
namespace specialSuggestions {
|
|
9
|
-
const _default: string[];
|
|
10
|
-
export { _default as default };
|
|
11
|
-
const textEscaped_1: string[];
|
|
12
|
-
export { textEscaped_1 as textEscaped };
|
|
13
|
-
const textUnescaped_1: string[];
|
|
14
|
-
export { textUnescaped_1 as textUnescaped };
|
|
15
|
-
export const matchAmpersandUnescaped: string[][];
|
|
16
|
-
export const matchAmpersandSequence: string[][];
|
|
17
|
-
export const matchAmpersandEscaped: never[];
|
|
18
|
-
}
|
|
19
|
-
namespace matchingSuggestions {
|
|
20
|
-
const th: string[][];
|
|
21
|
-
const so: string[][];
|
|
22
|
-
const at: string[][];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export default _default;
|
|
26
|
-
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/form-token-field/test/lib/fixtures.js"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { ComponentProps } from 'react';
|
|
5
|
-
/**
|
|
6
|
-
* WordPress dependencies
|
|
7
|
-
*/
|
|
8
|
-
import { Component } from '@wordpress/element';
|
|
9
|
-
import type { FormTokenFieldProps } from '../../types';
|
|
10
|
-
import FormTokenField from '../../';
|
|
11
|
-
declare class TokenFieldWrapper extends Component<FormTokenFieldProps, {
|
|
12
|
-
tokenSuggestions: ComponentProps<typeof FormTokenField>['suggestions'];
|
|
13
|
-
tokens: ComponentProps<typeof FormTokenField>['value'];
|
|
14
|
-
isExpanded: boolean;
|
|
15
|
-
}> {
|
|
16
|
-
constructor(props: FormTokenFieldProps);
|
|
17
|
-
render(): JSX.Element;
|
|
18
|
-
onTokensChange(value: ComponentProps<typeof FormTokenField>['value']): void;
|
|
19
|
-
}
|
|
20
|
-
export default TokenFieldWrapper;
|
|
21
|
-
//# sourceMappingURL=token-field-wrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-field-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/form-token-field/test/lib/token-field-wrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,cAAc,MAAM,QAAQ,CAAC;AAYpC,cAAM,iBAAkB,SAAQ,SAAS,CACxC,mBAAmB,EACnB;IACC,gBAAgB,EAAE,cAAc,CAC/B,OAAO,cAAc,CACrB,CAAE,aAAa,CAAE,CAAC;IACnB,MAAM,EAAE,cAAc,CAAE,OAAO,cAAc,CAAE,CAAE,OAAO,CAAE,CAAC;IAC3D,UAAU,EAAE,OAAO,CAAC;CACpB,CACD;gBACa,KAAK,EAAE,mBAAmB;IAUvC,MAAM;IAgBN,cAAc,CACb,KAAK,EAAE,cAAc,CAAE,OAAO,cAAc,CAAE,CAAE,OAAO,CAAE;CAI1D;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalizes the 'key' property of a KeyboardEvent in IE/Edge
|
|
3
|
-
*
|
|
4
|
-
* Source:
|
|
5
|
-
* https://github.com/downshift-js/downshift/blob/a71005bd879d05d7dcb892d1e0dc5c6ca74e9d39/src/utils.js#L279
|
|
6
|
-
*
|
|
7
|
-
* @param {import('react').KeyboardEvent} event A keyboardEvent object
|
|
8
|
-
*
|
|
9
|
-
* @return {string} The keyboard key
|
|
10
|
-
*/
|
|
11
|
-
export function normalizeArrowKey(event: import('react').KeyboardEvent): string;
|
|
12
|
-
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/utils/keyboard.js"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,yCAJW,OAAO,OAAO,EAAE,aAAa,GAE5B,MAAM,CASjB"}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { boolean, select, number } from '@storybook/addon-knobs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import {
|
|
10
|
-
Card,
|
|
11
|
-
CardHeader,
|
|
12
|
-
CardBody,
|
|
13
|
-
CardDivider,
|
|
14
|
-
CardMedia,
|
|
15
|
-
CardFooter,
|
|
16
|
-
} from '../index';
|
|
17
|
-
import { Text } from '../../text';
|
|
18
|
-
import { Heading } from '../../heading';
|
|
19
|
-
import Button from '../../button';
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
component: Card,
|
|
23
|
-
title: 'Components/Card',
|
|
24
|
-
parameters: {
|
|
25
|
-
knobs: { disable: false },
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const KNOBS_GROUPS = {
|
|
30
|
-
Card: 'Card',
|
|
31
|
-
CardBody: 'CardBody',
|
|
32
|
-
CardHeader: 'CardHeader',
|
|
33
|
-
CardFooter: 'CardFooter',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Using `unset` instead of `undefined` as Storybook seems to sometimes pass an
|
|
37
|
-
// empty string instead of `undefined`, which is not ideal.
|
|
38
|
-
// https://github.com/storybookjs/storybook/issues/800
|
|
39
|
-
const PROP_UNSET = 'unset';
|
|
40
|
-
|
|
41
|
-
export const _default = () => {
|
|
42
|
-
const cardProps = {
|
|
43
|
-
isBorderless: boolean( 'Card: isBorderless', false, KNOBS_GROUPS.Card ),
|
|
44
|
-
isRounded: boolean( 'Card: isRounded', true, KNOBS_GROUPS.Card ),
|
|
45
|
-
elevation: number( 'Card: elevation', 0, {}, KNOBS_GROUPS.Card ),
|
|
46
|
-
size: select(
|
|
47
|
-
'Card: size',
|
|
48
|
-
{
|
|
49
|
-
large: 'large',
|
|
50
|
-
medium: 'medium',
|
|
51
|
-
small: 'small',
|
|
52
|
-
xSmall: 'xSmall',
|
|
53
|
-
},
|
|
54
|
-
'medium',
|
|
55
|
-
KNOBS_GROUPS.Card
|
|
56
|
-
),
|
|
57
|
-
style: {
|
|
58
|
-
width: select(
|
|
59
|
-
'Card: width (via inline styles)',
|
|
60
|
-
{
|
|
61
|
-
'640px': 640,
|
|
62
|
-
'360px': 360,
|
|
63
|
-
'240px': 240,
|
|
64
|
-
'50%': '50%',
|
|
65
|
-
'100%': '100%',
|
|
66
|
-
},
|
|
67
|
-
360,
|
|
68
|
-
KNOBS_GROUPS.Card
|
|
69
|
-
),
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const cardHeaderProps = {
|
|
74
|
-
isBorderless: select(
|
|
75
|
-
'CardHeader: isBorderless',
|
|
76
|
-
{
|
|
77
|
-
'unset (defaults to the value set on the <Card> parent)':
|
|
78
|
-
PROP_UNSET,
|
|
79
|
-
true: true,
|
|
80
|
-
false: false,
|
|
81
|
-
},
|
|
82
|
-
PROP_UNSET,
|
|
83
|
-
KNOBS_GROUPS.CardHeader
|
|
84
|
-
),
|
|
85
|
-
isShady: boolean(
|
|
86
|
-
'CardHeader: isShady',
|
|
87
|
-
false,
|
|
88
|
-
KNOBS_GROUPS.CardHeader
|
|
89
|
-
),
|
|
90
|
-
size: select(
|
|
91
|
-
'CardHeader: size',
|
|
92
|
-
{
|
|
93
|
-
'unset (defaults to the value set on the <Card> parent)':
|
|
94
|
-
PROP_UNSET,
|
|
95
|
-
large: 'large',
|
|
96
|
-
medium: 'medium',
|
|
97
|
-
small: 'small',
|
|
98
|
-
xSmall: 'xSmall',
|
|
99
|
-
},
|
|
100
|
-
PROP_UNSET,
|
|
101
|
-
KNOBS_GROUPS.CardHeader
|
|
102
|
-
),
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const cardBodyProps = {
|
|
106
|
-
isShady: boolean( 'CardBody: isShady', false, KNOBS_GROUPS.CardBody ),
|
|
107
|
-
size: select(
|
|
108
|
-
'CardBody: size',
|
|
109
|
-
{
|
|
110
|
-
'unset (defaults to the value set on the <Card> parent)':
|
|
111
|
-
PROP_UNSET,
|
|
112
|
-
large: 'large',
|
|
113
|
-
medium: 'medium',
|
|
114
|
-
small: 'small',
|
|
115
|
-
xSmall: 'xSmall',
|
|
116
|
-
},
|
|
117
|
-
PROP_UNSET,
|
|
118
|
-
KNOBS_GROUPS.CardBody
|
|
119
|
-
),
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const cardFooterProps = {
|
|
123
|
-
isBorderless: select(
|
|
124
|
-
'CardFooter: isBorderless',
|
|
125
|
-
{
|
|
126
|
-
'unset (defaults to the value set on the <Card> parent)':
|
|
127
|
-
PROP_UNSET,
|
|
128
|
-
true: true,
|
|
129
|
-
false: false,
|
|
130
|
-
},
|
|
131
|
-
PROP_UNSET,
|
|
132
|
-
KNOBS_GROUPS.CardFooter
|
|
133
|
-
),
|
|
134
|
-
isShady: boolean(
|
|
135
|
-
'CardFooter: isShady',
|
|
136
|
-
false,
|
|
137
|
-
KNOBS_GROUPS.CardFooter
|
|
138
|
-
),
|
|
139
|
-
justify: select(
|
|
140
|
-
'CardFooter: justify',
|
|
141
|
-
{
|
|
142
|
-
flexStart: 'flex-start',
|
|
143
|
-
flexEnd: 'flex-end',
|
|
144
|
-
center: 'center',
|
|
145
|
-
spaceAround: 'space-around',
|
|
146
|
-
spaceBetween: 'space-between',
|
|
147
|
-
spaceEvenly: 'space-evenly',
|
|
148
|
-
},
|
|
149
|
-
'space-between',
|
|
150
|
-
KNOBS_GROUPS.CardFooter
|
|
151
|
-
),
|
|
152
|
-
size: select(
|
|
153
|
-
'CardFooter: size',
|
|
154
|
-
{
|
|
155
|
-
'unset (defaults to the value set on the <Card> parent)':
|
|
156
|
-
PROP_UNSET,
|
|
157
|
-
large: 'large',
|
|
158
|
-
medium: 'medium',
|
|
159
|
-
small: 'small',
|
|
160
|
-
xSmall: 'xSmall',
|
|
161
|
-
},
|
|
162
|
-
PROP_UNSET,
|
|
163
|
-
KNOBS_GROUPS.CardFooter
|
|
164
|
-
),
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// Do not pass the `size` and `isBorderless` props when their value is `undefined`.
|
|
168
|
-
// This allows the `CardHeader`, `CardBody` and `CardFooter` components to use
|
|
169
|
-
// the values that are set on the parent `Card` component by default.
|
|
170
|
-
for ( const componentProps of [
|
|
171
|
-
cardHeaderProps,
|
|
172
|
-
cardFooterProps,
|
|
173
|
-
cardBodyProps,
|
|
174
|
-
] ) {
|
|
175
|
-
for ( const prop of [ 'isBorderless', 'size' ] ) {
|
|
176
|
-
if ( componentProps[ prop ] === PROP_UNSET ) {
|
|
177
|
-
delete componentProps[ prop ];
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return (
|
|
183
|
-
<Card { ...cardProps }>
|
|
184
|
-
<CardHeader { ...cardHeaderProps }>
|
|
185
|
-
<Heading>CardHeader</Heading>
|
|
186
|
-
</CardHeader>
|
|
187
|
-
<CardBody { ...cardBodyProps }>
|
|
188
|
-
<Text>CardBody</Text>
|
|
189
|
-
</CardBody>
|
|
190
|
-
<CardBody { ...cardBodyProps }>
|
|
191
|
-
<Text>CardBody (before CardDivider)</Text>
|
|
192
|
-
</CardBody>
|
|
193
|
-
<CardDivider />
|
|
194
|
-
<CardBody { ...cardBodyProps }>
|
|
195
|
-
<Text>CardBody (after CardDivider)</Text>
|
|
196
|
-
</CardBody>
|
|
197
|
-
<CardMedia>
|
|
198
|
-
<img
|
|
199
|
-
alt="Card Media"
|
|
200
|
-
src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
|
|
201
|
-
/>
|
|
202
|
-
</CardMedia>
|
|
203
|
-
<CardFooter { ...cardFooterProps }>
|
|
204
|
-
<Text>CardFooter</Text>
|
|
205
|
-
<Button variant="secondary">Action Button</Button>
|
|
206
|
-
</CardFooter>
|
|
207
|
-
</Card>
|
|
208
|
-
);
|
|
209
|
-
};
|