@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
|
@@ -15,15 +15,15 @@ export const ToggleGroupControl = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
size
|
|
17
17
|
} = _ref;
|
|
18
|
-
return /*#__PURE__*/css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", CONFIG.controlBorderRadius, ";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ", CONFIG.transitionDurationFastest, " linear;", reduceMotion('transition'), " ", toggleGroupControlSize(size), " &:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", CONFIG.controlBoxShadowFocus, ";outline:none;z-index:1;}" + (process.env.NODE_ENV === "production" ? "" : ";label:ToggleGroupControl;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdCVSIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RvZ2dsZS1ncm91cC1jb250cm9sL3RvZ2dsZS1ncm91cC1jb250cm9sL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ09ORklHLCBDT0xPUlMsIHJlZHVjZU1vdGlvbiB9IGZyb20gJy4uLy4uL3V0aWxzJztcbmltcG9ydCB0eXBlIHsgVG9nZ2xlR3JvdXBDb250cm9sUHJvcHMgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBUb2dnbGVHcm91cENvbnRyb2wgPSAoIHtcblx0c2l6ZSxcbn06IHtcblx0c2l6ZTogTm9uTnVsbGFibGU8IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzWyAnc2l6ZScgXSA+O1xufSApID0+
|
|
18
|
+
return /*#__PURE__*/css("background:", COLORS.ui.background, ";border:1px solid transparent;border-radius:", CONFIG.controlBorderRadius, ";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ", CONFIG.transitionDurationFastest, " linear;", reduceMotion('transition'), " ", toggleGroupControlSize(size), " &:focus-within{border-color:", COLORS.ui.borderFocus, ";box-shadow:", CONFIG.controlBoxShadowFocus, ";outline:none;z-index:1;}" + (process.env.NODE_ENV === "production" ? "" : ";label:ToggleGroupControl;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdCVSIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RvZ2dsZS1ncm91cC1jb250cm9sL3RvZ2dsZS1ncm91cC1jb250cm9sL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ09ORklHLCBDT0xPUlMsIHJlZHVjZU1vdGlvbiB9IGZyb20gJy4uLy4uL3V0aWxzJztcbmltcG9ydCB0eXBlIHsgVG9nZ2xlR3JvdXBDb250cm9sUHJvcHMgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBUb2dnbGVHcm91cENvbnRyb2wgPSAoIHtcblx0c2l6ZSxcbn06IHtcblx0c2l6ZTogTm9uTnVsbGFibGU8IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzWyAnc2l6ZScgXSA+O1xufSApID0+IGNzc2Bcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLnVpLmJhY2tncm91bmQgf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dlJzogJzQwcHgnLFxuXHR9O1xuXG5cdHJldHVybiBjc3NgXG5cdFx0bWluLWhlaWdodDogJHsgaGVpZ2h0c1sgc2l6ZSBdIH07XG5cdGA7XG59O1xuXG5leHBvcnQgY29uc3QgYmxvY2sgPSBjc3NgXG5cdGRpc3BsYXk6IGZsZXg7XG5cdHdpZHRoOiAxMDAlO1xuYDtcblxuZXhwb3J0IGNvbnN0IEJhY2tkcm9wVmlldyA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQ6ICR7IENPTE9SUy5ncmF5WyA5MDAgXSB9O1xuXHRib3JkZXItcmFkaXVzOiAkeyBDT05GSUcuY29udHJvbEJvcmRlclJhZGl1cyB9O1xuXHRib3gtc2hhZG93OiAkeyBDT05GSUcudG9nZ2xlR3JvdXBDb250cm9sQmFja2Ryb3BCb3hTaGFkb3cgfTtcblx0bGVmdDogMDtcblx0cG9zaXRpb246IGFic29sdXRlO1xuXHR0b3A6IDJweDtcblx0Ym90dG9tOiAycHg7XG5cdHRyYW5zaXRpb246IHRyYW5zZm9ybSAkeyBDT05GSUcudHJhbnNpdGlvbkR1cmF0aW9uRmFzdCB9IGVhc2U7XG5cdCR7IHJlZHVjZU1vdGlvbiggJ3RyYW5zaXRpb24nICkgfVxuXHR6LWluZGV4OiAxO1xuYDtcblxuZXhwb3J0IGNvbnN0IFZpc3VhbExhYmVsV3JhcHBlciA9IHN0eWxlZC5kaXZgXG5cdC8vIE1ha2VzIHRoZSBpbmxpbmUgbGFiZWwgYmUgdGhlIGNvcnJlY3QgaGVpZ2h0LCBlcXVpdmFsZW50IHRvIHNldHRpbmcgbGluZS1oZWlnaHQ6IDBcblx0ZGlzcGxheTogZmxleDtcbmA7XG4iXX0= */");
|
|
19
19
|
};
|
|
20
|
-
export const border = /*#__PURE__*/css("border-color:", COLORS.ui.border, ";&:hover{border-color:", COLORS.ui.borderHover, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:border;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
20
|
+
export const border = /*#__PURE__*/css("border-color:", COLORS.ui.border, ";&:hover{border-color:", COLORS.ui.borderHover, ";}" + (process.env.NODE_ENV === "production" ? "" : ";label:border;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFDeUIiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy90b2dnbGUtZ3JvdXAtY29udHJvbC90b2dnbGUtZ3JvdXAtY29udHJvbC9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTkZJRywgQ09MT1JTLCByZWR1Y2VNb3Rpb24gfSBmcm9tICcuLi8uLi91dGlscyc7XG5pbXBvcnQgdHlwZSB7IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgVG9nZ2xlR3JvdXBDb250cm9sID0gKCB7XG5cdHNpemUsXG59OiB7XG5cdHNpemU6IE5vbk51bGxhYmxlPCBUb2dnbGVHcm91cENvbnRyb2xQcm9wc1sgJ3NpemUnIF0gPjtcbn0gKSA9PiBjc3NgXG5cdGJhY2tncm91bmQ6ICR7IENPTE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c6ICc0MHB4Jyxcblx0fTtcblxuXHRyZXR1cm4gY3NzYFxuXHRcdG1pbi1oZWlnaHQ6ICR7IGhlaWdodHNbIHNpemUgXSB9O1xuXHRgO1xufTtcblxuZXhwb3J0IGNvbnN0IGJsb2NrID0gY3NzYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHR3aWR0aDogMTAwJTtcbmA7XG5cbmV4cG9ydCBjb25zdCBCYWNrZHJvcFZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiAkeyBDT0xPUlMuZ3JheVsgOTAwIF0gfTtcblx0Ym9yZGVyLXJhZGl1czogJHsgQ09ORklHLmNvbnRyb2xCb3JkZXJSYWRpdXMgfTtcblx0Ym94LXNoYWRvdzogJHsgQ09ORklHLnRvZ2dsZUdyb3VwQ29udHJvbEJhY2tkcm9wQm94U2hhZG93IH07XG5cdGxlZnQ6IDA7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAycHg7XG5cdGJvdHRvbTogMnB4O1xuXHR0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gJHsgQ09ORklHLnRyYW5zaXRpb25EdXJhdGlvbkZhc3QgfSBlYXNlO1xuXHQkeyByZWR1Y2VNb3Rpb24oICd0cmFuc2l0aW9uJyApIH1cblx0ei1pbmRleDogMTtcbmA7XG5cbmV4cG9ydCBjb25zdCBWaXN1YWxMYWJlbFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHQvLyBNYWtlcyB0aGUgaW5saW5lIGxhYmVsIGJlIHRoZSBjb3JyZWN0IGhlaWdodCwgZXF1aXZhbGVudCB0byBzZXR0aW5nIGxpbmUtaGVpZ2h0OiAwXG5cdGRpc3BsYXk6IGZsZXg7XG5gO1xuIl19 */");
|
|
21
21
|
export const toggleGroupControlSize = size => {
|
|
22
22
|
const heights = {
|
|
23
23
|
default: '36px',
|
|
24
24
|
'__unstable-large': '40px'
|
|
25
25
|
};
|
|
26
|
-
return /*#__PURE__*/css("min-height:", heights[size], ";" + (process.env.NODE_ENV === "production" ? "" : ";label:toggleGroupControlSize;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFEVyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RvZ2dsZS1ncm91cC1jb250cm9sL3RvZ2dsZS1ncm91cC1jb250cm9sL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ09ORklHLCBDT0xPUlMsIHJlZHVjZU1vdGlvbiB9IGZyb20gJy4uLy4uL3V0aWxzJztcbmltcG9ydCB0eXBlIHsgVG9nZ2xlR3JvdXBDb250cm9sUHJvcHMgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBUb2dnbGVHcm91cENvbnRyb2wgPSAoIHtcblx0c2l6ZSxcbn06IHtcblx0c2l6ZTogTm9uTnVsbGFibGU8IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzWyAnc2l6ZScgXSA+O1xufSApID0+
|
|
26
|
+
return /*#__PURE__*/css("min-height:", heights[size], ";" + (process.env.NODE_ENV === "production" ? "" : ";label:toggleGroupControlSize;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/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dGRpc3BsYXk6IGZsZXg7XG5cdHdpZHRoOiAxMDAlO1xuYDtcblxuZXhwb3J0IGNvbnN0IEJhY2tkcm9wVmlldyA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQ6ICR7IENPTE9SUy5ncmF5WyA5MDAgXSB9O1xuXHRib3JkZXItcmFkaXVzOiAkeyBDT05GSUcuY29udHJvbEJvcmRlclJhZGl1cyB9O1xuXHRib3gtc2hhZG93OiAkeyBDT05GSUcudG9nZ2xlR3JvdXBDb250cm9sQmFja2Ryb3BCb3hTaGFkb3cgfTtcblx0bGVmdDogMDtcblx0cG9zaXRpb246IGFic29sdXRlO1xuXHR0b3A6IDJweDtcblx0Ym90dG9tOiAycHg7XG5cdHRyYW5zaXRpb246IHRyYW5zZm9ybSAkeyBDT05GSUcudHJhbnNpdGlvbkR1cmF0aW9uRmFzdCB9IGVhc2U7XG5cdCR7IHJlZHVjZU1vdGlvbiggJ3RyYW5zaXRpb24nICkgfVxuXHR6LWluZGV4OiAxO1xuYDtcblxuZXhwb3J0IGNvbnN0IFZpc3VhbExhYmVsV3JhcHBlciA9IHN0eWxlZC5kaXZgXG5cdC8vIE1ha2VzIHRoZSBpbmxpbmUgbGFiZWwgYmUgdGhlIGNvcnJlY3QgaGVpZ2h0LCBlcXVpdmFsZW50IHRvIHNldHRpbmcgbGluZS1oZWlnaHQ6IDBcblx0ZGlzcGxheTogZmxleDtcbmA7XG4iXX0= */");
|
|
27
27
|
};
|
|
28
28
|
export const block = process.env.NODE_ENV === "production" ? {
|
|
29
29
|
name: "7whenc",
|
|
@@ -31,13 +31,27 @@ export const block = process.env.NODE_ENV === "production" ? {
|
|
|
31
31
|
} : {
|
|
32
32
|
name: "2dfrl8-block",
|
|
33
33
|
styles: "display:flex;width:100%;label:block;",
|
|
34
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
34
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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V4cG9ydCBjb25zdCBCYWNrZHJvcFZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiAkeyBDT0xPUlMuZ3JheVsgOTAwIF0gfTtcblx0Ym9yZGVyLXJhZGl1czogJHsgQ09ORklHLmNvbnRyb2xCb3JkZXJSYWRpdXMgfTtcblx0Ym94LXNoYWRvdzogJHsgQ09ORklHLnRvZ2dsZUdyb3VwQ29udHJvbEJhY2tkcm9wQm94U2hhZG93IH07XG5cdGxlZnQ6IDA7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAycHg7XG5cdGJvdHRvbTogMnB4O1xuXHR0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gJHsgQ09ORklHLnRyYW5zaXRpb25EdXJhdGlvbkZhc3QgfSBlYXNlO1xuXHQkeyByZWR1Y2VNb3Rpb24oICd0cmFuc2l0aW9uJyApIH1cblx0ei1pbmRleDogMTtcbmA7XG5cbmV4cG9ydCBjb25zdCBWaXN1YWxMYWJlbFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHQvLyBNYWtlcyB0aGUgaW5saW5lIGxhYmVsIGJlIHRoZSBjb3JyZWN0IGhlaWdodCwgZXF1aXZhbGVudCB0byBzZXR0aW5nIGxpbmUtaGVpZ2h0OiAwXG5cdGRpc3BsYXk6IGZsZXg7XG5gO1xuIl19 */",
|
|
35
35
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
36
36
|
};
|
|
37
37
|
export const BackdropView = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
38
|
+
target: "eakva831"
|
|
39
|
+
} : {
|
|
40
|
+
target: "eakva831",
|
|
41
|
+
label: "BackdropView"
|
|
42
|
+
})("background:", COLORS.gray[900], ";border-radius:", CONFIG.controlBorderRadius, ";box-shadow:", CONFIG.toggleGroupControlBackdropBoxShadow, ";left:0;position:absolute;top:2px;bottom:2px;transition:transform ", CONFIG.transitionDurationFast, " ease;", reduceMotion('transition'), " z-index:1;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStEc0MiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy90b2dnbGUtZ3JvdXAtY29udHJvbC90b2dnbGUtZ3JvdXAtY29udHJvbC9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTkZJRywgQ09MT1JTLCByZWR1Y2VNb3Rpb24gfSBmcm9tICcuLi8uLi91dGlscyc7XG5pbXBvcnQgdHlwZSB7IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgVG9nZ2xlR3JvdXBDb250cm9sID0gKCB7XG5cdHNpemUsXG59OiB7XG5cdHNpemU6IE5vbk51bGxhYmxlPCBUb2dnbGVHcm91cENvbnRyb2xQcm9wc1sgJ3NpemUnIF0gPjtcbn0gKSA9PiBjc3NgXG5cdGJhY2tncm91bmQ6ICR7IENPTE9SUy51aS5iYWNrZ3JvdW5kIH07XG5cdGJvcmRlcjogMXB4IHNvbGlkIHRyYW5zcGFyZW50O1xuXHRib3JkZXItcmFkaXVzOiAkeyBDT05GSUcuY29udHJvbEJvcmRlclJhZGl1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0IGJsb2NrID0gY3NzYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHR3aWR0aDogMTAwJTtcbmA7XG5cbmV4cG9ydCBjb25zdCBCYWNrZHJvcFZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiAkeyBDT0xPUlMuZ3JheVsgOTAwIF0gfTtcblx0Ym9yZGVyLXJhZGl1czogJHsgQ09ORklHLmNvbnRyb2xCb3JkZXJSYWRpdXMgfTtcblx0Ym94LXNoYWRvdzogJHsgQ09ORklHLnRvZ2dsZUdyb3VwQ29udHJvbEJhY2tkcm9wQm94U2hhZG93IH07XG5cdGxlZnQ6IDA7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAycHg7XG5cdGJvdHRvbTogMnB4O1xuXHR0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gJHsgQ09ORklHLnRyYW5zaXRpb25EdXJhdGlvbkZhc3QgfSBlYXNlO1xuXHQkeyByZWR1Y2VNb3Rpb24oICd0cmFuc2l0aW9uJyApIH1cblx0ei1pbmRleDogMTtcbmA7XG5cbmV4cG9ydCBjb25zdCBWaXN1YWxMYWJlbFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHQvLyBNYWtlcyB0aGUgaW5saW5lIGxhYmVsIGJlIHRoZSBjb3JyZWN0IGhlaWdodCwgZXF1aXZhbGVudCB0byBzZXR0aW5nIGxpbmUtaGVpZ2h0OiAwXG5cdGRpc3BsYXk6IGZsZXg7XG5gO1xuIl19 */"));
|
|
43
|
+
export const VisualLabelWrapper = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
38
44
|
target: "eakva830"
|
|
39
45
|
} : {
|
|
40
46
|
target: "eakva830",
|
|
41
|
-
label: "
|
|
42
|
-
})(
|
|
47
|
+
label: "VisualLabelWrapper"
|
|
48
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
49
|
+
name: "zjik7",
|
|
50
|
+
styles: "display:flex"
|
|
51
|
+
} : {
|
|
52
|
+
name: "zjik7",
|
|
53
|
+
styles: "display:flex",
|
|
54
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvdG9nZ2xlLWdyb3VwLWNvbnRyb2wvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRFNEMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy90b2dnbGUtZ3JvdXAtY29udHJvbC90b2dnbGUtZ3JvdXAtY29udHJvbC9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTkZJRywgQ09MT1JTLCByZWR1Y2VNb3Rpb24gfSBmcm9tICcuLi8uLi91dGlscyc7XG5pbXBvcnQgdHlwZSB7IFRvZ2dsZUdyb3VwQ29udHJvbFByb3BzIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgVG9nZ2xlR3JvdXBDb250cm9sID0gKCB7XG5cdHNpemUsXG59OiB7XG5cdHNpemU6IE5vbk51bGxhYmxlPCBUb2dnbGVHcm91cENvbnRyb2xQcm9wc1sgJ3NpemUnIF0gPjtcbn0gKSA9PiBjc3NgXG5cdGJhY2tncm91bmQ6ICR7IENPTE9SUy51aS5iYWNrZ3JvdW5kIH07XG5cdGJvcmRlcjogMXB4IHNvbGlkIHRyYW5zcGFyZW50O1xuXHRib3JkZXItcmFkaXVzOiAkeyBDT05GSUc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ufTtcblxuZXhwb3J0IGNvbnN0IGJsb2NrID0gY3NzYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHR3aWR0aDogMTAwJTtcbmA7XG5cbmV4cG9ydCBjb25zdCBCYWNrZHJvcFZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiAkeyBDT0xPUlMuZ3JheVsgOTAwIF0gfTtcblx0Ym9yZGVyLXJhZGl1czogJHsgQ09ORklHLmNvbnRyb2xCb3JkZXJSYWRpdXMgfTtcblx0Ym94LXNoYWRvdzogJHsgQ09ORklHLnRvZ2dsZUdyb3VwQ29udHJvbEJhY2tkcm9wQm94U2hhZG93IH07XG5cdGxlZnQ6IDA7XG5cdHBvc2l0aW9uOiBhYnNvbHV0ZTtcblx0dG9wOiAycHg7XG5cdGJvdHRvbTogMnB4O1xuXHR0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gJHsgQ09ORklHLnRyYW5zaXRpb25EdXJhdGlvbkZhc3QgfSBlYXNlO1xuXHQkeyByZWR1Y2VNb3Rpb24oICd0cmFuc2l0aW9uJyApIH1cblx0ei1pbmRleDogMTtcbmA7XG5cbmV4cG9ydCBjb25zdCBWaXN1YWxMYWJlbFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHQvLyBNYWtlcyB0aGUgaW5saW5lIGxhYmVsIGJlIHRoZSBjb3JyZWN0IGhlaWdodCwgZXF1aXZhbGVudCB0byBzZXR0aW5nIGxpbmUtaGVpZ2h0OiAwXG5cdGRpc3BsYXk6IGZsZXg7XG5gO1xuIl19 */",
|
|
55
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
56
|
+
});
|
|
43
57
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/styles.ts"],"names":["css","CONFIG","COLORS","reduceMotion","ToggleGroupControl","size","ui","background","controlBorderRadius","transitionDurationFastest","toggleGroupControlSize","borderFocus","controlBoxShadowFocus","border","borderHover","heights","default","block","BackdropView","gray","toggleGroupControlBackdropBoxShadow","transitionDurationFast"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,YAAzB,QAA6C,aAA7C;AAGA,OAAO,MAAMC,kBAAkB,GAAG;AAAA,MAAE;AACnCC,IAAAA;AADmC,GAAF;AAAA,sBAI3BL,GAJ2B,gBAKlBE,MAAM,CAACI,EAAP,CAAUC,UALQ,kDAOfN,MAAM,CAACO,mBAPQ,0FAYRP,MAAM,CAACQ,yBAZC,cAa9BN,YAAY,CAAE,YAAF,CAbkB,OAe9BO,sBAAsB,CAAEL,IAAF,CAfQ,mCAkBfH,MAAM,CAACI,EAAP,CAAUK,WAlBK,kBAmBjBV,MAAM,CAACW,qBAnBU;AAAA,CAA3B;AAyBP,OAAO,MAAMC,MAAM,gBAAGb,GAAH,kBACDE,MAAM,CAACI,EAAP,CAAUO,MADT,4BAIAX,MAAM,CAACI,EAAP,CAAUQ,WAJV,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/styles.ts"],"names":["css","CONFIG","COLORS","reduceMotion","ToggleGroupControl","size","ui","background","controlBorderRadius","transitionDurationFastest","toggleGroupControlSize","borderFocus","controlBoxShadowFocus","border","borderHover","heights","default","block","BackdropView","gray","toggleGroupControlBackdropBoxShadow","transitionDurationFast","VisualLabelWrapper"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,YAAzB,QAA6C,aAA7C;AAGA,OAAO,MAAMC,kBAAkB,GAAG;AAAA,MAAE;AACnCC,IAAAA;AADmC,GAAF;AAAA,sBAI3BL,GAJ2B,gBAKlBE,MAAM,CAACI,EAAP,CAAUC,UALQ,kDAOfN,MAAM,CAACO,mBAPQ,0FAYRP,MAAM,CAACQ,yBAZC,cAa9BN,YAAY,CAAE,YAAF,CAbkB,OAe9BO,sBAAsB,CAAEL,IAAF,CAfQ,mCAkBfH,MAAM,CAACI,EAAP,CAAUK,WAlBK,kBAmBjBV,MAAM,CAACW,qBAnBU;AAAA,CAA3B;AAyBP,OAAO,MAAMC,MAAM,gBAAGb,GAAH,kBACDE,MAAM,CAACI,EAAP,CAAUO,MADT,4BAIAX,MAAM,CAACI,EAAP,CAAUQ,WAJV,qhGAAZ;AAQP,OAAO,MAAMJ,sBAAsB,GAClCL,IADqC,IAEjC;AACJ,QAAMU,OAAO,GAAG;AACfC,IAAAA,OAAO,EAAE,MADM;AAEf,wBAAoB;AAFL,GAAhB;AAKA,sBAAOhB,GAAP,gBACgBe,OAAO,CAAEV,IAAF,CADvB;AAGA,CAXM;AAaP,OAAO,MAAMY,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAX;AAKP,OAAO,MAAMC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,kBACThB,MAAM,CAACiB,IAAP,CAAa,GAAb,CADS,qBAENlB,MAAM,CAACO,mBAFD,kBAGTP,MAAM,CAACmB,mCAHE,wEAQCnB,MAAM,CAACoB,sBARR,YASrBlB,YAAY,CAAE,YAAF,CATS,+9FAAlB;AAaP,OAAO,MAAMmB,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAxB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { CONFIG, COLORS, reduceMotion } from '../../utils';\nimport type { ToggleGroupControlProps } from '../types';\n\nexport const ToggleGroupControl = ( {\n\tsize,\n}: {\n\tsize: NonNullable< ToggleGroupControlProps[ 'size' ] >;\n} ) => css`\n\tbackground: ${ COLORS.ui.background };\n\tborder: 1px solid transparent;\n\tborder-radius: ${ CONFIG.controlBorderRadius };\n\tdisplay: inline-flex;\n\tmin-width: 0;\n\tpadding: 2px;\n\tposition: relative;\n\ttransition: transform ${ CONFIG.transitionDurationFastest } linear;\n\t${ reduceMotion( 'transition' ) }\n\n\t${ toggleGroupControlSize( size ) }\n\n\t&:focus-within {\n\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\tbox-shadow: ${ CONFIG.controlBoxShadowFocus };\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n`;\n\nexport const border = css`\n\tborder-color: ${ COLORS.ui.border };\n\n\t&:hover {\n\t\tborder-color: ${ COLORS.ui.borderHover };\n\t}\n`;\n\nexport const toggleGroupControlSize = (\n\tsize: NonNullable< ToggleGroupControlProps[ 'size' ] >\n) => {\n\tconst heights = {\n\t\tdefault: '36px',\n\t\t'__unstable-large': '40px',\n\t};\n\n\treturn css`\n\t\tmin-height: ${ heights[ size ] };\n\t`;\n};\n\nexport const block = css`\n\tdisplay: flex;\n\twidth: 100%;\n`;\n\nexport const BackdropView = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: ${ CONFIG.controlBorderRadius };\n\tbox-shadow: ${ CONFIG.toggleGroupControlBackdropBoxShadow };\n\tleft: 0;\n\tposition: absolute;\n\ttop: 2px;\n\tbottom: 2px;\n\ttransition: transform ${ CONFIG.transitionDurationFast } ease;\n\t${ reduceMotion( 'transition' ) }\n\tz-index: 1;\n`;\n\nexport const VisualLabelWrapper = styled.div`\n\t// Makes the inline label be the correct height, equivalent to setting line-height: 0\n\tdisplay: flex;\n`;\n"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { includes } from 'lodash';
|
|
8
4
|
/**
|
|
9
5
|
* WordPress dependencies
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
7
|
import { Children, cloneElement, concatChildren, useEffect, useState, useRef } from '@wordpress/element';
|
|
13
8
|
import { useDebounce, useMergeRefs } from '@wordpress/compose';
|
|
14
9
|
/**
|
|
@@ -199,7 +194,7 @@ function Tooltip(props) {
|
|
|
199
194
|
|
|
200
195
|
delayedSetIsOver.cancel();
|
|
201
196
|
|
|
202
|
-
const _isOver =
|
|
197
|
+
const _isOver = ['focus', 'mouseenter'].includes(event.type);
|
|
203
198
|
|
|
204
199
|
if (_isOver === isOver) {
|
|
205
200
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["includes","Children","cloneElement","concatChildren","useEffect","useState","useRef","useDebounce","useMergeRefs","Popover","Shortcut","TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","mergedRefs","children","ref","getRegularElement","addPopoverToGrandchildren","anchorRef","grandchildren","isOver","offset","position","shortcut","text","emitToChild","eventName","event","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","childRef","existingChildRef","toArray","mergedChildRefs","createMouseDown","target","tagName","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";AAAA;;AACA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,YAFD,EAGCC,cAHD,EAICC,SAJD,EAKCC,QALD,EAMCC,MAND,QAOO,oBAPP;AAQA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,MAAqB,aAArB;AAEA;AACA;AACA;AACA;AACA;;AACA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GrBa,IAAAA,OAAO,EAAEb,kBAAkB,CAAE,SAAF,CAHN;AAIrBc,IAAAA,OAAO,EAAEd,kBAAkB,CAAE,SAAF,CAJN;AAKrBe,IAAAA,MAAM,EAAEf,kBAAkB,CAAE,QAAF,CALL;AAMrBgB,IAAAA,WAAW,EAAElB,gBAAgB,CAAE,WAAF;AANR,GAAtB;AASA,QAAMvC,KAAK,GAAGd,QAAQ,CAACgC,IAAT,CAAef,QAAf,CAAd;AACA,QAAM;AAAEA,IAAAA,QAAQ,EAAEK,aAAZ;AAA2BY,IAAAA;AAA3B,MAAwCpB,KAAK,CAACmB,KAApD;AACA,QAAMuC,qBAAqB,GAAGtC,QAAQ,GACnCtB,kBADmC,GAEnCO,iBAFH;AAIA,QAAMsD,WAAW,GAAG;AACnBpD,IAAAA,SAAS,EAAEoB,QADQ;AAEnBlB,IAAAA,MAFmB;AAGnBC,IAAAA,MAAM,EAAE,CAHW;AAInBC,IAAAA,QAJmB;AAKnBC,IAAAA,QALmB;AAMnBC,IAAAA;AANmB,GAApB;AAQA,QAAMZ,mBAAmB,GAAGK,yBAAyB,CAAE;AACtDE,IAAAA,aADsD;AAEtD,OAAGmD;AAFmD,GAAF,CAArD;AAKA,SAAOD,qBAAqB,CAAE;AAC7B1D,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA,mBAH6B;AAI7BC,IAAAA,UAAU,EAAE4B;AAJiB,GAAF,CAA5B;AAMA;;AAED,eAAeT,OAAf","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n} from '@wordpress/element';\nimport { useDebounce, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( {\n\teventHandlers,\n\tchild,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t\tref: mergedRefs,\n\t\t\t} ) }\n\t\t</span>,\n\t\t{ ...eventHandlers }\n\t);\n};\n\nconst getRegularElement = ( {\n\tchild,\n\teventHandlers,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t\tref: mergedRefs,\n\t} );\n};\n\nconst addPopoverToGrandchildren = ( {\n\tanchorRef,\n\tgrandchildren,\n\tisOver,\n\toffset,\n\tposition,\n\tshortcut,\n\ttext,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ offset }\n\t\t\t\tanchorRef={ anchorRef }\n\t\t\t\t__unstableShift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\t// Create a reference to the Tooltip's child, to be passed to the Popover\n\t// so that the Tooltip can be correctly positioned. Also, merge with the\n\t// existing ref for the first child, so that its ref is preserved.\n\tconst childRef = useRef( null );\n\tconst existingChildRef = Children.toArray( children )[ 0 ]?.ref;\n\tconst mergedChildRefs = useMergeRefs( [ childRef, existingChildRef ] );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// In firefox, the mouse down event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\t// In firefox, the mouse up event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = includes( [ 'focus', 'mouseenter' ], event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tanchorRef: childRef,\n\t\tisOver,\n\t\toffset: 4,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t\tmergedRefs: mergedChildRefs,\n\t} );\n}\n\nexport default Tooltip;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["Children","cloneElement","concatChildren","useEffect","useState","useRef","useDebounce","useMergeRefs","Popover","Shortcut","TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","mergedRefs","children","ref","getRegularElement","addPopoverToGrandchildren","anchorRef","grandchildren","isOver","offset","position","shortcut","text","emitToChild","eventName","event","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","childRef","existingChildRef","toArray","mergedChildRefs","createMouseDown","target","tagName","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","includes","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";AAAA;;AAEA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,cAHD,EAICC,SAJD,EAKCC,QALD,EAMCC,MAND,QAOO,oBAPP;AAQA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,MAAqB,aAArB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAG,GAAtB;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG,QAKpB;AAAA,MALsB;AAC5BC,IAAAA,aAD4B;AAE5BC,IAAAA,KAF4B;AAG5BC,IAAAA,mBAH4B;AAI5BC,IAAAA;AAJ4B,GAKtB;AACN,SAAOf,YAAY,CAClB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,YAAY,CAAEU,YAAF,EAAgBE,aAAhB,CADf,EAEGZ,YAAY,CAAEa,KAAF,EAAS;AACtBG,IAAAA,QAAQ,EAAEF,mBADY;AAEtBG,IAAAA,GAAG,EAAEF;AAFiB,GAAT,CAFf,CADkB,EAQlB,EAAE,GAAGH;AAAL,GARkB,CAAnB;AAUA,CAhBD;;AAkBA,MAAMM,iBAAiB,GAAG,SAKnB;AAAA,MALqB;AAC3BL,IAAAA,KAD2B;AAE3BD,IAAAA,aAF2B;AAG3BE,IAAAA,mBAH2B;AAI3BC,IAAAA;AAJ2B,GAKrB;AACN,SAAOf,YAAY,CAAEa,KAAF,EAAS,EAC3B,GAAGD,aADwB;AAE3BI,IAAAA,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AAKA,SAAOD,qBAAqB,CAAE;AAC7B3D,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA,mBAH6B;AAI7BC,IAAAA,UAAU,EAAE4B;AAJiB,GAAF,CAA5B;AAMA;;AAED,eAAeT,OAAf","sourcesContent":["// @ts-nocheck\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n} from '@wordpress/element';\nimport { useDebounce, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( {\n\teventHandlers,\n\tchild,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t\tref: mergedRefs,\n\t\t\t} ) }\n\t\t</span>,\n\t\t{ ...eventHandlers }\n\t);\n};\n\nconst getRegularElement = ( {\n\tchild,\n\teventHandlers,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t\tref: mergedRefs,\n\t} );\n};\n\nconst addPopoverToGrandchildren = ( {\n\tanchorRef,\n\tgrandchildren,\n\tisOver,\n\toffset,\n\tposition,\n\tshortcut,\n\ttext,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ offset }\n\t\t\t\tanchorRef={ anchorRef }\n\t\t\t\t__unstableShift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\t// Create a reference to the Tooltip's child, to be passed to the Popover\n\t// so that the Tooltip can be correctly positioned. Also, merge with the\n\t// existing ref for the first child, so that its ref is preserved.\n\tconst childRef = useRef( null );\n\tconst existingChildRef = Children.toArray( children )[ 0 ]?.ref;\n\tconst mergedChildRefs = useMergeRefs( [ childRef, existingChildRef ] );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// In firefox, the mouse down event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\t// In firefox, the mouse up event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = [ 'focus', 'mouseenter' ].includes( event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tanchorRef: childRef,\n\t\tisOver,\n\t\toffset: 4,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t\tmergedRefs: mergedChildRefs,\n\t} );\n}\n\nexport default Tooltip;\n"]}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { createElement } from "@wordpress/element";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { includes } from 'lodash';
|
|
8
4
|
/**
|
|
9
5
|
* WordPress dependencies
|
|
10
6
|
*/
|
|
11
|
-
|
|
12
7
|
import { focus } from '@wordpress/dom';
|
|
13
8
|
import { forwardRef, useCallback } from '@wordpress/element';
|
|
14
9
|
import { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';
|
|
@@ -71,7 +66,7 @@ function TreeGrid(_ref, ref) {
|
|
|
71
66
|
|
|
72
67
|
const hasModifierKeyPressed = metaKey || ctrlKey || altKey;
|
|
73
68
|
|
|
74
|
-
if (hasModifierKeyPressed || !
|
|
69
|
+
if (hasModifierKeyPressed || ![UP, DOWN, LEFT, RIGHT, HOME, END].includes(keyCode)) {
|
|
75
70
|
return;
|
|
76
71
|
} // The event will be handled, stop propagation.
|
|
77
72
|
|
|
@@ -95,7 +90,7 @@ function TreeGrid(_ref, ref) {
|
|
|
95
90
|
const canExpandCollapse = 0 === currentColumnIndex;
|
|
96
91
|
const cannotFocusNextColumn = canExpandCollapse && activeRow.getAttribute('aria-expanded') === 'false' && keyCode === RIGHT;
|
|
97
92
|
|
|
98
|
-
if (
|
|
93
|
+
if ([LEFT, RIGHT].includes(keyCode)) {
|
|
99
94
|
// Calculate to the next element.
|
|
100
95
|
let nextIndex;
|
|
101
96
|
|
|
@@ -169,7 +164,7 @@ function TreeGrid(_ref, ref) {
|
|
|
169
164
|
// doesn't try to handle key navigation.
|
|
170
165
|
|
|
171
166
|
event.preventDefault();
|
|
172
|
-
} else if (
|
|
167
|
+
} else if ([UP, DOWN].includes(keyCode)) {
|
|
173
168
|
// Calculate the rowIndex of the next row.
|
|
174
169
|
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
|
|
175
170
|
const currentRowIndex = rows.indexOf(activeRow);
|
|
@@ -210,7 +205,7 @@ function TreeGrid(_ref, ref) {
|
|
|
210
205
|
// doesn't try to handle key navigation.
|
|
211
206
|
|
|
212
207
|
event.preventDefault();
|
|
213
|
-
} else if (
|
|
208
|
+
} else if ([HOME, END].includes(keyCode)) {
|
|
214
209
|
// Calculate the rowIndex of the next row.
|
|
215
210
|
const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
|
|
216
211
|
const currentRowIndex = rows.indexOf(activeRow);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["includes","focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsCC,GAAtC,QAAiD,qBAAjD;AAEA;AACA;AACA;;AACA,OAAO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nB,CAAiC7C,KAAjC,GA1CgD,CA4ChD;AACA;;AACAwB,MAAAA,UAAU,CAAEG,KAAF,EAASY,SAAT,EAAoBa,IAAI,CAAEQ,YAAF,CAAxB,CAAV,CA9CgD,CAgDhD;AACA;;AACAjC,MAAAA,KAAK,CAACsB,cAAN;AACA;AACD,GAjO2B,EAkO5B,CAAE3B,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CAlO4B,CAA7B;AAqOA;;AACA;;AACA,SACC,cAAC,uBAAD,QACC,oCACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGN;AAJP,MAMC,6BAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;AAED,eAAepB,UAAU,CAAEkB,QAAF,CAAzB;AACA,SAAS2C,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\t...props\n\t},\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT, HOME, END ], keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ HOME, END ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA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AAN;AACA;AACA,OAnC8C,CAqC/C;;;AACA,YAAMJ,SAAS,GAAGC,IAAI,CAACE,GAAL,CACjBR,kBADiB,EAEjBqB,mBAAmB,CAAC9C,MAApB,GAA6B,CAFZ,CAAlB;AAIA8C,MAAAA,mBAAmB,CAAEhB,SAAF,CAAnB,CAAiC9C,KAAjC,GA1C+C,CA4C/C;AACA;;AACAwB,MAAAA,UAAU,CAAEG,KAAF,EAASa,SAAT,EAAoBa,IAAI,CAAEQ,YAAF,CAAxB,CAAV,CA9C+C,CAgD/C;AACA;;AACAlC,MAAAA,KAAK,CAACuB,cAAN;AACA;AACD,GAjO2B,EAkO5B,CAAE5B,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CAlO4B,CAA7B;AAqOA;;AACA;;AACA,SACC,cAAC,uBAAD,QACC,oCACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGN;AAJP,MAMC,6BAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;AAED,eAAepB,UAAU,CAAEkB,QAAF,CAAzB;AACA,SAAS4C,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\t...props\n\t},\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! [ UP, DOWN, LEFT, RIGHT, HOME, END ].includes( keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( [ LEFT, RIGHT ].includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( [ UP, DOWN ].includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( [ HOME, END ].includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
|
|
@@ -34,4 +34,15 @@ const ALL_UNICODE_DASH_CHARACTERS = new RegExp(`[${[// - (hyphen-minus)
|
|
|
34
34
|
export const normalizeTextString = value => {
|
|
35
35
|
return removeAccents(value).toLocaleLowerCase().replace(ALL_UNICODE_DASH_CHARACTERS, '-');
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Escapes the RegExp special characters.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} string Input string.
|
|
41
|
+
*
|
|
42
|
+
* @return {string} Regex-escaped string.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
export function escapeRegExp(string) {
|
|
46
|
+
return string.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
|
|
47
|
+
}
|
|
37
48
|
//# sourceMappingURL=strings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/utils/strings.ts"],"names":["removeAccents","ALL_UNICODE_DASH_CHARACTERS","RegExp","join","normalizeTextString","value","toLocaleLowerCase","replace"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAP,MAA0B,gBAA1B;AAEA,MAAMC,2BAA2B,GAAG,IAAIC,MAAJ,CAClC,IAAI,CACJ;AACA,QAFI,EAGJ;AACA,QAJI,EAKJ;AACA,QANI,EAOJ;AACA,QARI,EASJ;AACA,QAVI,EAWJ;AACA,QAZI,EAaJ;AACA,QAdI,EAeJ;AACA,QAhBI,EAiBJ;AACA,QAlBI,EAmBJ;AACA,QApBI,EAqBJ;AACA,QAtBI,EAuBJ;AACA,QAxBI,EAyBJ;AACA,QA1BI,EA2BJ;AACA,QA5BI,EA6BJ;AACA,QA9BI,EA+BJ;AACA,QAhCI,EAiCJ;AACA,QAlCI,EAmCJ;AACA,QApCI,EAqCJ;AACA,QAtCI,EAuCJ;AACA,QAxCI,EAyCJ;AACA,QA1CI,EA2CJ;AACA,QA5CI,EA6CJ;AACA,QA9CI,EA+CJ;AACA,QAhDI,EAiDJ;AACA,QAlDI,EAmDJ;AACA,QApDI,EAqDJ;AACA,QAtDI,EAuDJ;AACA,QAxDI,EAyDHC,IAzDG,CAyDG,EAzDH,CAyDS,GA1DqB,EA2DnC,GA3DmC,CAApC;AA8DA,OAAO,MAAMC,mBAAmB,GAAKC,KAAF,IAA6B;AAC/D,SAAOL,aAAa,CAAEK,KAAF,CAAb,CACLC,iBADK,GAELC,OAFK,CAEIN,2BAFJ,EAEiC,GAFjC,CAAP;AAGA,CAJM","sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\nconst ALL_UNICODE_DASH_CHARACTERS = new RegExp(\n\t`[${ [\n\t\t// - (hyphen-minus)\n\t\t'\\u002d',\n\t\t// ~ (tilde)\n\t\t'\\u007e',\n\t\t// (soft hyphen)\n\t\t'\\u00ad',\n\t\t// ֊ (armenian hyphen)\n\t\t'\\u058a',\n\t\t// ־ (hebrew punctuation maqaf)\n\t\t'\\u05be',\n\t\t// ᐀ (canadian syllabics hyphen)\n\t\t'\\u1400',\n\t\t// ᠆ (mongolian todo soft hyphen)\n\t\t'\\u1806',\n\t\t// ‐ (hyphen)\n\t\t'\\u2010',\n\t\t// non-breaking hyphen)\n\t\t'\\u2011',\n\t\t// ‒ (figure dash)\n\t\t'\\u2012',\n\t\t// – (en dash)\n\t\t'\\u2013',\n\t\t// — (em dash)\n\t\t'\\u2014',\n\t\t// ― (horizontal bar)\n\t\t'\\u2015',\n\t\t// ⁓ (swung dash)\n\t\t'\\u2053',\n\t\t// superscript minus)\n\t\t'\\u207b',\n\t\t// subscript minus)\n\t\t'\\u208b',\n\t\t// − (minus sign)\n\t\t'\\u2212',\n\t\t// ⸗ (double oblique hyphen)\n\t\t'\\u2e17',\n\t\t// ⸺ (two-em dash)\n\t\t'\\u2e3a',\n\t\t// ⸻ (three-em dash)\n\t\t'\\u2e3b',\n\t\t// 〜 (wave dash)\n\t\t'\\u301c',\n\t\t// 〰 (wavy dash)\n\t\t'\\u3030',\n\t\t// ゠ (katakana-hiragana double hyphen)\n\t\t'\\u30a0',\n\t\t// ︱ (presentation form for vertical em dash)\n\t\t'\\ufe31',\n\t\t// ︲ (presentation form for vertical en dash)\n\t\t'\\ufe32',\n\t\t// ﹘ (small em dash)\n\t\t'\\ufe58',\n\t\t// ﹣ (small hyphen-minus)\n\t\t'\\ufe63',\n\t\t// - (fullwidth hyphen-minus)\n\t\t'\\uff0d',\n\t].join( '' ) }]`,\n\t'g'\n);\n\nexport const normalizeTextString = ( value: string ): string => {\n\treturn removeAccents( value )\n\t\t.toLocaleLowerCase()\n\t\t.replace( ALL_UNICODE_DASH_CHARACTERS, '-' );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/utils/strings.ts"],"names":["removeAccents","ALL_UNICODE_DASH_CHARACTERS","RegExp","join","normalizeTextString","value","toLocaleLowerCase","replace","escapeRegExp","string"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAP,MAA0B,gBAA1B;AAEA,MAAMC,2BAA2B,GAAG,IAAIC,MAAJ,CAClC,IAAI,CACJ;AACA,QAFI,EAGJ;AACA,QAJI,EAKJ;AACA,QANI,EAOJ;AACA,QARI,EASJ;AACA,QAVI,EAWJ;AACA,QAZI,EAaJ;AACA,QAdI,EAeJ;AACA,QAhBI,EAiBJ;AACA,QAlBI,EAmBJ;AACA,QApBI,EAqBJ;AACA,QAtBI,EAuBJ;AACA,QAxBI,EAyBJ;AACA,QA1BI,EA2BJ;AACA,QA5BI,EA6BJ;AACA,QA9BI,EA+BJ;AACA,QAhCI,EAiCJ;AACA,QAlCI,EAmCJ;AACA,QApCI,EAqCJ;AACA,QAtCI,EAuCJ;AACA,QAxCI,EAyCJ;AACA,QA1CI,EA2CJ;AACA,QA5CI,EA6CJ;AACA,QA9CI,EA+CJ;AACA,QAhDI,EAiDJ;AACA,QAlDI,EAmDJ;AACA,QApDI,EAqDJ;AACA,QAtDI,EAuDJ;AACA,QAxDI,EAyDHC,IAzDG,CAyDG,EAzDH,CAyDS,GA1DqB,EA2DnC,GA3DmC,CAApC;AA8DA,OAAO,MAAMC,mBAAmB,GAAKC,KAAF,IAA6B;AAC/D,SAAOL,aAAa,CAAEK,KAAF,CAAb,CACLC,iBADK,GAELC,OAFK,CAEIN,2BAFJ,EAEiC,GAFjC,CAAP;AAGA,CAJM;AAMP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASO,YAAT,CAAuBC,MAAvB,EAAgD;AACtD,SAAOA,MAAM,CAACF,OAAP,CAAgB,qBAAhB,EAAuC,MAAvC,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\nconst ALL_UNICODE_DASH_CHARACTERS = new RegExp(\n\t`[${ [\n\t\t// - (hyphen-minus)\n\t\t'\\u002d',\n\t\t// ~ (tilde)\n\t\t'\\u007e',\n\t\t// (soft hyphen)\n\t\t'\\u00ad',\n\t\t// ֊ (armenian hyphen)\n\t\t'\\u058a',\n\t\t// ־ (hebrew punctuation maqaf)\n\t\t'\\u05be',\n\t\t// ᐀ (canadian syllabics hyphen)\n\t\t'\\u1400',\n\t\t// ᠆ (mongolian todo soft hyphen)\n\t\t'\\u1806',\n\t\t// ‐ (hyphen)\n\t\t'\\u2010',\n\t\t// non-breaking hyphen)\n\t\t'\\u2011',\n\t\t// ‒ (figure dash)\n\t\t'\\u2012',\n\t\t// – (en dash)\n\t\t'\\u2013',\n\t\t// — (em dash)\n\t\t'\\u2014',\n\t\t// ― (horizontal bar)\n\t\t'\\u2015',\n\t\t// ⁓ (swung dash)\n\t\t'\\u2053',\n\t\t// superscript minus)\n\t\t'\\u207b',\n\t\t// subscript minus)\n\t\t'\\u208b',\n\t\t// − (minus sign)\n\t\t'\\u2212',\n\t\t// ⸗ (double oblique hyphen)\n\t\t'\\u2e17',\n\t\t// ⸺ (two-em dash)\n\t\t'\\u2e3a',\n\t\t// ⸻ (three-em dash)\n\t\t'\\u2e3b',\n\t\t// 〜 (wave dash)\n\t\t'\\u301c',\n\t\t// 〰 (wavy dash)\n\t\t'\\u3030',\n\t\t// ゠ (katakana-hiragana double hyphen)\n\t\t'\\u30a0',\n\t\t// ︱ (presentation form for vertical em dash)\n\t\t'\\ufe31',\n\t\t// ︲ (presentation form for vertical en dash)\n\t\t'\\ufe32',\n\t\t// ﹘ (small em dash)\n\t\t'\\ufe58',\n\t\t// ﹣ (small hyphen-minus)\n\t\t'\\ufe63',\n\t\t// - (fullwidth hyphen-minus)\n\t\t'\\uff0d',\n\t].join( '' ) }]`,\n\t'g'\n);\n\nexport const normalizeTextString = ( value: string ): string => {\n\treturn removeAccents( value )\n\t\t.toLocaleLowerCase()\n\t\t.replace( ALL_UNICODE_DASH_CHARACTERS, '-' );\n};\n\n/**\n * Escapes the RegExp special characters.\n *\n * @param {string} string Input string.\n *\n * @return {string} Regex-escaped string.\n */\nexport function escapeRegExp( string: string ): string {\n\treturn string.replace( /[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&' );\n}\n"]}
|
|
@@ -769,13 +769,7 @@ svg.components-checkbox-control__indeterminate {
|
|
|
769
769
|
line-height: 22px;
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
-
.components-palette-edit__popover
|
|
773
|
-
margin-top: 0;
|
|
774
|
-
}
|
|
775
|
-
.components-palette-edit__popover .components-custom-gradient-picker__ui-line {
|
|
776
|
-
margin-bottom: 0;
|
|
777
|
-
}
|
|
778
|
-
.components-palette-edit__popover .components-custom-gradient-picker {
|
|
772
|
+
.components-palette-edit__popover-gradient-picker {
|
|
779
773
|
width: 280px;
|
|
780
774
|
padding: 8px;
|
|
781
775
|
}
|
|
@@ -916,19 +910,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
916
910
|
outline-width: 2px;
|
|
917
911
|
}
|
|
918
912
|
|
|
919
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content {
|
|
920
|
-
overflow: visible;
|
|
921
|
-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.05);
|
|
922
|
-
border: none;
|
|
923
|
-
outline: none;
|
|
924
|
-
border-radius: 2px;
|
|
925
|
-
padding: 0;
|
|
926
|
-
}
|
|
927
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content .react-colorful__saturation {
|
|
928
|
-
border-top-left-radius: 2px;
|
|
929
|
-
border-top-right-radius: 2px;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
913
|
.components-color-palette__custom-color-name {
|
|
933
914
|
text-align: right;
|
|
934
915
|
}
|
|
@@ -2444,11 +2425,11 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2444
2425
|
display: flex;
|
|
2445
2426
|
box-shadow: none;
|
|
2446
2427
|
min-width: 100px;
|
|
2447
|
-
border-radius: 2px;
|
|
2448
2428
|
-webkit-backdrop-filter: blur(100px);
|
|
2449
2429
|
backdrop-filter: blur(100px);
|
|
2450
2430
|
background-color: rgba(255, 255, 255, 0.1);
|
|
2451
2431
|
border: 1px dashed currentColor;
|
|
2432
|
+
border-radius: 2px;
|
|
2452
2433
|
overflow: hidden;
|
|
2453
2434
|
}
|
|
2454
2435
|
.is-dark-theme .components-placeholder.has-illustration {
|
package/build-style/style.css
CHANGED
|
@@ -769,13 +769,7 @@ svg.components-checkbox-control__indeterminate {
|
|
|
769
769
|
line-height: 22px;
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
-
.components-palette-edit__popover
|
|
773
|
-
margin-top: 0;
|
|
774
|
-
}
|
|
775
|
-
.components-palette-edit__popover .components-custom-gradient-picker__ui-line {
|
|
776
|
-
margin-bottom: 0;
|
|
777
|
-
}
|
|
778
|
-
.components-palette-edit__popover .components-custom-gradient-picker {
|
|
772
|
+
.components-palette-edit__popover-gradient-picker {
|
|
779
773
|
width: 280px;
|
|
780
774
|
padding: 8px;
|
|
781
775
|
}
|
|
@@ -918,19 +912,6 @@ input.components-combobox-control__input[type=text]:focus {
|
|
|
918
912
|
outline-width: 2px;
|
|
919
913
|
}
|
|
920
914
|
|
|
921
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content {
|
|
922
|
-
overflow: visible;
|
|
923
|
-
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.05);
|
|
924
|
-
border: none;
|
|
925
|
-
outline: none;
|
|
926
|
-
border-radius: 2px;
|
|
927
|
-
padding: 0;
|
|
928
|
-
}
|
|
929
|
-
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content .react-colorful__saturation {
|
|
930
|
-
border-top-right-radius: 2px;
|
|
931
|
-
border-top-left-radius: 2px;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
915
|
.components-color-palette__custom-color-name {
|
|
935
916
|
text-align: left;
|
|
936
917
|
}
|
|
@@ -2449,11 +2430,11 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2449
2430
|
display: flex;
|
|
2450
2431
|
box-shadow: none;
|
|
2451
2432
|
min-width: 100px;
|
|
2452
|
-
border-radius: 2px;
|
|
2453
2433
|
-webkit-backdrop-filter: blur(100px);
|
|
2454
2434
|
backdrop-filter: blur(100px);
|
|
2455
2435
|
background-color: rgba(255, 255, 255, 0.1);
|
|
2456
2436
|
border: 1px dashed currentColor;
|
|
2437
|
+
border-radius: 2px;
|
|
2457
2438
|
overflow: hidden;
|
|
2458
2439
|
}
|
|
2459
2440
|
.is-dark-theme .components-placeholder.has-illustration {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.js"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Props } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* `Card` provides a flexible and extensible content container.
|
|
4
4
|
* `Card` also provides a convenient set of sub-components such as `CardBody`,
|
|
5
5
|
* `CardHeader`, `CardFooter`, and more.
|
|
6
6
|
*
|
|
7
|
-
* @example
|
|
8
7
|
* ```jsx
|
|
9
8
|
* import {
|
|
10
9
|
* Card,
|
|
@@ -32,5 +31,6 @@ export default ConnectedCard;
|
|
|
32
31
|
* }
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
|
-
declare const
|
|
34
|
+
export declare const Card: import("../../ui/context").WordPressComponent<"div", Props, true>;
|
|
35
|
+
export default Card;
|
|
36
36
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/card/card/component.
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/card/card/component.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAsDtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,IAAI,mEAA4C,CAAC;AAE9D,eAAe,IAAI,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* Internal dependencies
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
+
import { WordPressComponentProps } from '../../ui/context';
|
|
6
|
+
import type { Props } from '../types';
|
|
7
|
+
declare type CardProps = WordPressComponentProps<Props, 'div'>;
|
|
8
|
+
export declare function useCard(props: CardProps): {
|
|
5
9
|
elevation: number;
|
|
6
10
|
isBorderless: boolean;
|
|
7
11
|
isRounded: boolean;
|
|
@@ -266,4 +270,5 @@ export function useCard(props: import('../../ui/context').WordPressComponentProp
|
|
|
266
270
|
is?: string | undefined;
|
|
267
271
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
268
272
|
};
|
|
273
|
+
export {};
|
|
269
274
|
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/card/card/hook.
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/card/card/hook.ts"],"names":[],"mappings":";AAMA;;GAEG;AACH,OAAO,EAAoB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAI7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,aAAK,SAAS,GAAG,uBAAuB,CAAE,KAAK,EAAE,KAAK,CAAE,CAAC;AA6BzD,wBAAgB,OAAO,CAAE,KAAK,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BxC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from
|
|
2
|
-
export { useCard } from
|
|
1
|
+
export { default } from './component';
|
|
2
|
+
export { useCard } from './hook';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/card/card/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/card/card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BodyProps } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* `CardBody` renders an optional content area for a `Card`.
|
|
4
4
|
* Multiple `CardBody` components can be used within `Card` if needed.
|
|
5
5
|
*
|
|
6
|
-
* @example
|
|
7
6
|
* ```jsx
|
|
8
7
|
* import { Card, CardBody } from `@wordpress/components`;
|
|
9
8
|
*
|
|
@@ -14,5 +13,6 @@ export default ConnectedCardBody;
|
|
|
14
13
|
* </Card>
|
|
15
14
|
* ```
|
|
16
15
|
*/
|
|
17
|
-
declare const
|
|
16
|
+
export declare const CardBody: import("../../ui/context").WordPressComponent<"div", BodyProps, true>;
|
|
17
|
+
export default CardBody;
|
|
18
18
|
//# sourceMappingURL=component.d.ts.map
|