@wordpress/components 19.2.1-next.33ec3857e2.0 → 19.2.1
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 +6 -29
- package/build/angle-picker-control/index.js +0 -2
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/button/index.native.js +3 -13
- package/build/button/index.native.js.map +1 -1
- package/build/checkbox-control/index.js +1 -1
- package/build/checkbox-control/index.js.map +1 -1
- package/build/clipboard-button/index.js +2 -1
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/index.js +1 -13
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/color-display.js +2 -4
- package/build/color-picker/color-display.js.map +1 -1
- package/build/color-picker/hex-input.js +1 -3
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +1 -3
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/custom-gradient-picker/index.js +0 -1
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/date-time/date.js +86 -63
- package/build/date-time/date.js.map +1 -1
- package/build/divider/component.js +7 -8
- package/build/divider/component.js.map +1 -1
- package/build/divider/styles.js +13 -38
- package/build/divider/styles.js.map +1 -1
- package/build/drop-zone/index.js +6 -14
- package/build/drop-zone/index.js.map +1 -1
- package/build/drop-zone/provider.js +0 -1
- package/build/drop-zone/provider.js.map +1 -1
- package/build/flyout/styles.js +2 -2
- package/build/flyout/styles.js.map +1 -1
- package/build/focusable-iframe/index.js +0 -1
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/higher-order/with-focus-outside/index.js +0 -2
- package/build/higher-order/with-focus-outside/index.js.map +1 -1
- package/build/index.js +0 -8
- package/build/index.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +32 -44
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +3 -10
- package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +2 -4
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +6 -7
- package/build/mobile/color-settings/palette.screen.native.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/mobile/gridicons/index.native.js +1 -3
- package/build/mobile/gridicons/index.native.js.map +1 -1
- package/build/mobile/link-picker/index.native.js +4 -45
- package/build/mobile/link-picker/index.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +0 -10
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/modal/aria-helper.js +0 -2
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +8 -17
- package/build/modal/index.js.map +1 -1
- package/build/palette-edit/index.js +31 -27
- package/build/palette-edit/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +9 -33
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/style-provider/index.js +0 -2
- package/build/style-provider/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -7
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build/tools-panel/styles.js +10 -12
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel/component.js +8 -6
- package/build/tools-panel/tools-panel/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +8 -6
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +41 -23
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/z-stack/component.js.map +1 -1
- package/build/z-stack/styles.js +8 -10
- package/build/z-stack/styles.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -2
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/button/index.native.js +3 -13
- package/build-module/button/index.native.js.map +1 -1
- package/build-module/checkbox-control/index.js +1 -1
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/clipboard-button/index.js +2 -1
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/index.js +2 -14
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/color-display.js +2 -3
- package/build-module/color-picker/color-display.js.map +1 -1
- package/build-module/color-picker/hex-input.js +1 -2
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +1 -2
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +0 -1
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/date-time/date.js +87 -63
- package/build-module/date-time/date.js.map +1 -1
- package/build-module/divider/component.js +7 -8
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/styles.js +13 -37
- package/build-module/divider/styles.js.map +1 -1
- package/build-module/drop-zone/index.js +6 -14
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/drop-zone/provider.js +0 -1
- package/build-module/drop-zone/provider.js.map +1 -1
- package/build-module/flyout/styles.js +2 -2
- package/build-module/flyout/styles.js.map +1 -1
- package/build-module/focusable-iframe/index.js +0 -1
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/higher-order/with-focus-outside/index.js +0 -1
- package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +32 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +4 -10
- package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +2 -4
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +6 -7
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/gridicons/index.native.js +0 -1
- package/build-module/mobile/gridicons/index.native.js.map +1 -1
- package/build-module/mobile/link-picker/index.native.js +8 -50
- package/build-module/mobile/link-picker/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +0 -10
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/modal/aria-helper.js +0 -2
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +8 -15
- package/build-module/modal/index.js.map +1 -1
- package/build-module/palette-edit/index.js +30 -27
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +9 -33
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/style-provider/index.js +0 -1
- package/build-module/style-provider/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +3 -8
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +14 -25
- package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
- package/build-module/tools-panel/styles.js +11 -12
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel/component.js +8 -5
- package/build-module/tools-panel/tools-panel/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +8 -6
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +41 -23
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/z-stack/component.js.map +1 -1
- package/build-module/z-stack/styles.js +8 -13
- package/build-module/z-stack/styles.js.map +1 -1
- package/build-style/style-rtl.css +11 -23
- package/build-style/style.css +11 -23
- package/build-types/base-field/hook.d.ts +16 -16
- package/build-types/card/card/hook.d.ts +16 -16
- package/build-types/card/card-body/hook.d.ts +16 -16
- package/build-types/card/card-divider/hook.d.ts +18 -18
- package/build-types/card/card-footer/hook.d.ts +17 -17
- package/build-types/card/card-header/hook.d.ts +16 -16
- package/build-types/card/card-media/hook.d.ts +16 -16
- package/build-types/divider/component.d.ts +7 -8
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +2 -2
- package/build-types/divider/styles.d.ts.map +1 -1
- package/build-types/divider/types.d.ts +5 -5
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +15 -15
- package/build-types/flex/flex/hook.d.ts +16 -16
- package/build-types/flex/flex-block/hook.d.ts +16 -16
- package/build-types/flex/flex-item/hook.d.ts +16 -16
- package/build-types/flyout/flyout/hook.d.ts +17 -17
- package/build-types/flyout/styles.d.ts +9 -7
- package/build-types/flyout/styles.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +16 -16
- package/build-types/h-stack/hook.d.ts +16 -16
- package/build-types/heading/hook.d.ts +16 -16
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +2 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +1 -2
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +16 -16
- package/build-types/item-group/item-group/hook.d.ts +16 -16
- package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +16 -16
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +1 -1
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +16 -16
- package/build-types/surface/hook.d.ts +16 -16
- package/build-types/text/hook.d.ts +16 -16
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
- package/build-types/tools-panel/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +16 -16
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +16 -16
- package/build-types/ui/control-group/hook.d.ts +18 -18
- package/build-types/ui/control-label/hook.d.ts +16 -16
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/use-form-group.d.ts +55 -55
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +2 -2
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +16 -16
- package/build-types/z-stack/component.d.ts +1 -1
- package/build-types/z-stack/styles.d.ts.map +1 -1
- package/package.json +23 -21
- package/src/alignment-matrix-control/stories/index.js +1 -1
- package/src/angle-picker-control/index.js +0 -2
- package/src/base-control/stories/index.js +1 -1
- package/src/button/index.native.js +1 -15
- package/src/button/stories/index.js +1 -1
- package/src/button/style.scss +0 -14
- package/src/card/card/README.md +3 -3
- package/src/card/stories/index.js +1 -1
- package/src/card/test/__snapshots__/index.js.snap +6 -6
- package/src/checkbox-control/index.js +1 -1
- package/src/checkbox-control/stories/index.js +1 -1
- package/src/clipboard-button/index.js +2 -1
- package/src/color-indicator/stories/index.js +1 -1
- package/src/color-indicator/style.scss +8 -5
- package/src/color-palette/index.js +5 -13
- package/src/color-palette/stories/index.js +1 -1
- package/src/color-palette/test/__snapshots__/index.js.snap +0 -1
- package/src/color-picker/color-display.tsx +2 -3
- package/src/color-picker/hex-input.tsx +1 -2
- package/src/color-picker/input-with-slider.tsx +1 -2
- package/src/color-picker/stories/index.js +1 -1
- package/src/combobox-control/README.md +2 -2
- package/src/custom-gradient-picker/index.js +0 -1
- package/src/custom-gradient-picker/style.scss +4 -0
- package/src/date-time/README.md +0 -7
- package/src/date-time/date.js +84 -67
- package/src/date-time/stories/index.js +1 -1
- package/src/date-time/stories/time.js +1 -1
- package/src/date-time/test/date.js +29 -3
- package/src/dimension-control/README.md +1 -1
- package/src/divider/README.md +5 -33
- package/src/divider/component.tsx +7 -8
- package/src/divider/stories/index.js +17 -43
- package/src/divider/styles.ts +16 -53
- package/src/divider/test/__snapshots__/index.js.snap +11 -11
- package/src/divider/test/index.js +4 -4
- package/src/divider/types.ts +5 -5
- package/src/drop-zone/index.js +6 -14
- package/src/drop-zone/provider.js +0 -1
- package/src/dropdown-menu/stories/index.js +1 -1
- package/src/duotone-picker/README.md +1 -1
- package/src/elevation/stories/index.js +1 -1
- package/src/external-link/stories/index.js +1 -1
- package/src/flyout/styles.ts +2 -4
- package/src/focusable-iframe/index.js +0 -1
- package/src/font-size-picker/stories/index.js +1 -1
- package/src/form-token-field/stories/index.js +1 -1
- package/src/gradient-picker/stories/index.js +1 -1
- package/src/grid/stories/index.js +1 -1
- package/src/guide/stories/index.js +1 -1
- package/src/higher-order/with-focus-outside/index.js +0 -2
- package/src/icon/stories/index.js +1 -1
- package/src/index.js +0 -1
- package/src/input-control/stories/index.js +1 -2
- package/src/input-control/styles/input-control-styles.tsx +6 -16
- package/src/input-control/types.ts +1 -3
- package/src/item-group/stories/index.js +2 -84
- package/src/menu-item/README.md +2 -2
- package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +2 -6
- package/src/mobile/color-settings/index.native.js +0 -2
- package/src/mobile/color-settings/palette.screen.native.js +5 -8
- package/src/mobile/color-settings/style.native.scss +1 -1
- package/src/mobile/global-styles-context/utils.native.js +1 -1
- package/src/mobile/gridicons/index.native.js +3 -3
- package/src/mobile/inserter-button/style.native.scss +0 -1
- package/src/mobile/link-picker/index.native.js +7 -41
- package/src/mobile/link-settings/index.native.js +0 -11
- package/src/modal/README.md +0 -10
- package/src/modal/aria-helper.js +0 -2
- package/src/modal/index.js +55 -72
- package/src/modal/stories/index.js +1 -6
- package/src/modal/style.scss +0 -9
- package/src/modal/test/index.js +0 -11
- package/src/navigation/README.md +9 -0
- package/src/notice/stories/index.js +1 -1
- package/src/number-control/stories/index.js +1 -1
- package/src/palette-edit/index.js +106 -73
- package/src/panel/stories/index.js +1 -1
- package/src/placeholder/stories/index.js +1 -1
- package/src/popover/stories/index.js +1 -1
- package/src/query-controls/README.md +6 -138
- package/src/radio-group/README.md +1 -4
- package/src/range-control/stories/index.js +1 -1
- package/src/resizable-box/stories/index.js +1 -1
- package/src/scrollable/stories/index.js +1 -1
- package/src/search-control/stories/index.js +1 -1
- package/src/select-control/stories/index.js +1 -2
- package/src/select-control/styles/select-control-styles.ts +2 -25
- package/src/select-control/types.ts +1 -1
- package/src/slot-fill/stories/index.js +1 -1
- package/src/snackbar/stories/index.js +1 -1
- package/src/spacer/stories/index.js +1 -1
- package/src/style-provider/index.js +0 -2
- package/src/surface/stories/index.js +1 -1
- package/src/tab-panel/stories/index.js +1 -1
- package/src/text-control/stories/index.js +1 -1
- package/src/text-highlight/stories/index.js +1 -1
- package/src/textarea-control/stories/index.js +1 -1
- package/src/tip/stories/index.js +1 -1
- package/src/toggle-control/stories/index.js +1 -1
- package/src/toggle-group-control/stories/index.js +1 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -7
- package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +9 -24
- package/src/toolbar-button/stories/index.js +1 -1
- package/src/tools-panel/stories/index.js +0 -54
- package/src/tools-panel/styles.ts +1 -41
- package/src/tools-panel/test/index.js +137 -19
- package/src/tools-panel/tools-panel/README.md +3 -11
- package/src/tools-panel/tools-panel/component.tsx +5 -2
- package/src/tools-panel/tools-panel-item/hook.ts +14 -6
- package/src/tooltip/stories/index.js +1 -1
- package/src/tree-select/stories/index.js +1 -1
- package/src/truncate/stories/index.js +1 -1
- package/src/unit-control/stories/index.js +1 -19
- package/src/unit-control/styles/unit-control-styles.ts +46 -33
- package/src/unit-control/types.ts +2 -5
- package/src/z-stack/README.md +1 -1
- package/src/z-stack/component.tsx +1 -1
- package/src/z-stack/stories/index.js +1 -1
- package/src/z-stack/styles.ts +2 -7
- package/tsconfig.json +2 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/build/confirm-dialog/component.js +0 -103
- package/build/confirm-dialog/component.js.map +0 -1
- package/build/confirm-dialog/index.js +0 -16
- package/build/confirm-dialog/index.js.map +0 -1
- package/build/confirm-dialog/types.js +0 -6
- package/build/confirm-dialog/types.js.map +0 -1
- package/build/date-time/utils.js +0 -32
- package/build/date-time/utils.js.map +0 -1
- package/build-module/confirm-dialog/component.js +0 -84
- package/build-module/confirm-dialog/component.js.map +0 -1
- package/build-module/confirm-dialog/index.js +0 -6
- package/build-module/confirm-dialog/index.js.map +0 -1
- package/build-module/confirm-dialog/types.js +0 -2
- package/build-module/confirm-dialog/types.js.map +0 -1
- package/build-module/date-time/utils.js +0 -20
- package/build-module/date-time/utils.js.map +0 -1
- package/src/confirm-dialog/README.md +0 -128
- package/src/confirm-dialog/component.tsx +0 -114
- package/src/confirm-dialog/index.tsx +0 -6
- package/src/confirm-dialog/stories/index.js +0 -120
- package/src/confirm-dialog/test/index.js +0 -302
- package/src/confirm-dialog/types.ts +0 -26
- package/src/date-time/test/utils.js +0 -32
- package/src/date-time/utils.js +0 -18
- package/src/mobile/link-settings/test/edit.native.js +0 -432
|
@@ -4,20 +4,15 @@
|
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { boolean, select } from '@storybook/addon-knobs';
|
|
7
|
-
import { css } from '@emotion/react';
|
|
8
|
-
import styled from '@emotion/styled';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* WordPress dependencies
|
|
12
10
|
*/
|
|
13
|
-
import { typography
|
|
14
|
-
import { useMemo } from '@wordpress/element';
|
|
15
|
-
import { isRTL } from '@wordpress/i18n';
|
|
11
|
+
import { typography } from '@wordpress/icons';
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* Internal dependencies
|
|
19
15
|
*/
|
|
20
|
-
import { useCx } from '../../utils';
|
|
21
16
|
import { ItemGroup, Item } from '..';
|
|
22
17
|
import Button from '../../button';
|
|
23
18
|
import { FlexItem, FlexBlock } from '../../flex';
|
|
@@ -32,7 +27,7 @@ export default {
|
|
|
32
27
|
component: ItemGroup,
|
|
33
28
|
title: 'Components (Experimental)/ItemGroup',
|
|
34
29
|
parameters: {
|
|
35
|
-
knobs: {
|
|
30
|
+
knobs: { disabled: false },
|
|
36
31
|
},
|
|
37
32
|
};
|
|
38
33
|
|
|
@@ -122,58 +117,6 @@ const SimpleColorSwatch = ( { color, style } ) => (
|
|
|
122
117
|
/>
|
|
123
118
|
);
|
|
124
119
|
|
|
125
|
-
const ChevronWrapper = styled( FlexItem )`
|
|
126
|
-
display: block;
|
|
127
|
-
fill: currentColor;
|
|
128
|
-
transition: transform 0.15s ease-out;
|
|
129
|
-
`;
|
|
130
|
-
|
|
131
|
-
const ItemWithChevron = ( {
|
|
132
|
-
children,
|
|
133
|
-
className,
|
|
134
|
-
alwaysVisible,
|
|
135
|
-
...otherProps
|
|
136
|
-
} ) => {
|
|
137
|
-
const isRtlLayout = isRTL();
|
|
138
|
-
const cx = useCx();
|
|
139
|
-
|
|
140
|
-
const appearingChevron = css`
|
|
141
|
-
&:not( :hover ):not( :focus ) ${ ChevronWrapper } {
|
|
142
|
-
display: none;
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
|
|
146
|
-
const itemClassName = useMemo(
|
|
147
|
-
() => cx( ! alwaysVisible && appearingChevron, className ),
|
|
148
|
-
[ alwaysVisible, className ]
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
const chevronIconClassName = useMemo(
|
|
152
|
-
() =>
|
|
153
|
-
cx( css`
|
|
154
|
-
display: block;
|
|
155
|
-
fill: currentColor;
|
|
156
|
-
transform: ${ isRtlLayout ? 'scaleX( -100% )' : 'none' };
|
|
157
|
-
` ),
|
|
158
|
-
[ isRtlLayout ]
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
<Item { ...otherProps } className={ itemClassName }>
|
|
163
|
-
<HStack justify="flex-start">
|
|
164
|
-
<FlexBlock>{ children }</FlexBlock>
|
|
165
|
-
<ChevronWrapper>
|
|
166
|
-
<Icon
|
|
167
|
-
className={ chevronIconClassName }
|
|
168
|
-
icon={ chevronRight }
|
|
169
|
-
size={ 24 }
|
|
170
|
-
/>
|
|
171
|
-
</ChevronWrapper>
|
|
172
|
-
</HStack>
|
|
173
|
-
</Item>
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
120
|
export const complexLayouts = () => {
|
|
178
121
|
const colors = [
|
|
179
122
|
{
|
|
@@ -234,31 +177,6 @@ export const complexLayouts = () => {
|
|
|
234
177
|
</FlexItem>
|
|
235
178
|
</HStack>
|
|
236
179
|
</Item>
|
|
237
|
-
|
|
238
|
-
<ItemWithChevron onClick={ () => alert( 'Single color setting' ) }>
|
|
239
|
-
<HStack justify="flex-start">
|
|
240
|
-
<SimpleColorSwatch
|
|
241
|
-
color="#2FB63F"
|
|
242
|
-
style={ { flexShrink: 0 } }
|
|
243
|
-
/>
|
|
244
|
-
|
|
245
|
-
<Truncate>Chevron on hover and focus</Truncate>
|
|
246
|
-
</HStack>
|
|
247
|
-
</ItemWithChevron>
|
|
248
|
-
|
|
249
|
-
<ItemWithChevron
|
|
250
|
-
alwaysVisible
|
|
251
|
-
onClick={ () => alert( 'Single color setting' ) }
|
|
252
|
-
>
|
|
253
|
-
<HStack justify="flex-start">
|
|
254
|
-
<SimpleColorSwatch
|
|
255
|
-
color="#D175D0"
|
|
256
|
-
style={ { flexShrink: 0 } }
|
|
257
|
-
/>
|
|
258
|
-
|
|
259
|
-
<Truncate>Chevron always visible</Truncate>
|
|
260
|
-
</HStack>
|
|
261
|
-
</ItemWithChevron>
|
|
262
180
|
</ItemGroup>
|
|
263
181
|
);
|
|
264
182
|
};
|
package/src/menu-item/README.md
CHANGED
|
@@ -67,10 +67,10 @@ Whether or not the menu item is currently selected.
|
|
|
67
67
|
|
|
68
68
|
### `shortcut`
|
|
69
69
|
|
|
70
|
-
- Type: `string`
|
|
70
|
+
- Type: `string`
|
|
71
71
|
- Required: No
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Refer to documentation for [Shortcut's `shortcut` prop](/packages/components/src/shortcut/README.md#shortcut).
|
|
74
74
|
|
|
75
75
|
### `role`
|
|
76
76
|
|
|
@@ -16,19 +16,16 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
|
16
16
|
import Cell from './cell';
|
|
17
17
|
import cellStyles from './styles.scss';
|
|
18
18
|
import suggestionStyles from './link-suggestion-styles.scss';
|
|
19
|
-
import { posts, pages, empty
|
|
19
|
+
import { posts, pages, empty } from '../gridicons';
|
|
20
20
|
|
|
21
21
|
const icons = {
|
|
22
22
|
URL: globe,
|
|
23
|
-
clipboard,
|
|
24
23
|
post: posts,
|
|
25
24
|
page: pages,
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
const getSummaryForType = ( type ) => {
|
|
29
28
|
switch ( type ) {
|
|
30
|
-
case 'clipboard':
|
|
31
|
-
return __( 'From clipboard' );
|
|
32
29
|
case 'mailto':
|
|
33
30
|
return __( 'Add this email link' );
|
|
34
31
|
case 'tel':
|
|
@@ -39,7 +36,7 @@ const getSummaryForType = ( type ) => {
|
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
// we use some Cell styles here with a column flex-direction
|
|
42
|
-
function LinkSuggestionItemCell( { suggestion, onLinkPicked
|
|
39
|
+
function LinkSuggestionItemCell( { suggestion, onLinkPicked } ) {
|
|
43
40
|
const { title: contentTitle, url, type, isDirectEntry } = suggestion;
|
|
44
41
|
const title = isDirectEntry ? url : contentTitle;
|
|
45
42
|
const summary = isDirectEntry ? getSummaryForType( type ) : url;
|
|
@@ -61,7 +58,6 @@ function LinkSuggestionItemCell( { suggestion, onLinkPicked, ...props } ) {
|
|
|
61
58
|
|
|
62
59
|
return (
|
|
63
60
|
<Cell
|
|
64
|
-
{ ...props }
|
|
65
61
|
icon={ icons[ type ] || empty }
|
|
66
62
|
onPress={ pickLink }
|
|
67
63
|
separatorType={ 'none' }
|
|
@@ -28,7 +28,6 @@ const ColorSettingsMemo = memo(
|
|
|
28
28
|
gradientValue,
|
|
29
29
|
onGradientChange,
|
|
30
30
|
label,
|
|
31
|
-
hideNavigation,
|
|
32
31
|
} ) => {
|
|
33
32
|
useEffect( () => {
|
|
34
33
|
shouldEnableBottomSheetMaxHeight( true );
|
|
@@ -45,7 +44,6 @@ const ColorSettingsMemo = memo(
|
|
|
45
44
|
gradientValue,
|
|
46
45
|
onGradientChange,
|
|
47
46
|
label,
|
|
48
|
-
hideNavigation,
|
|
49
47
|
} }
|
|
50
48
|
>
|
|
51
49
|
<PaletteScreen />
|
|
@@ -26,7 +26,7 @@ import { colorsUtils } from './utils';
|
|
|
26
26
|
|
|
27
27
|
import styles from './style.scss';
|
|
28
28
|
|
|
29
|
-
const HIT_SLOP = { top:
|
|
29
|
+
const HIT_SLOP = { top: 22, bottom: 22, left: 22, right: 22 };
|
|
30
30
|
|
|
31
31
|
const PaletteScreen = () => {
|
|
32
32
|
const route = useRoute();
|
|
@@ -38,7 +38,6 @@ const PaletteScreen = () => {
|
|
|
38
38
|
onGradientChange,
|
|
39
39
|
colorValue,
|
|
40
40
|
defaultSettings,
|
|
41
|
-
hideNavigation = false,
|
|
42
41
|
} = route.params || {};
|
|
43
42
|
const { segments, isGradient } = colorsUtils;
|
|
44
43
|
const [ currentValue, setCurrentValue ] = useState( colorValue );
|
|
@@ -165,12 +164,10 @@ const PaletteScreen = () => {
|
|
|
165
164
|
}
|
|
166
165
|
return (
|
|
167
166
|
<View>
|
|
168
|
-
|
|
169
|
-
<NavBar
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
</NavBar>
|
|
173
|
-
) }
|
|
167
|
+
<NavBar>
|
|
168
|
+
<NavBar.BackButton onPress={ navigation.goBack } />
|
|
169
|
+
<NavBar.Heading>{ label } </NavBar.Heading>
|
|
170
|
+
</NavBar>
|
|
174
171
|
<ColorPalette
|
|
175
172
|
setColor={ setColor }
|
|
176
173
|
activeColor={ currentValue }
|
|
@@ -162,7 +162,7 @@ export function getBlockTypography(
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
if ( blockStyleAttributes?.fontSize
|
|
165
|
+
if ( blockStyleAttributes?.fontSize ) {
|
|
166
166
|
const mappedFontSize = find( fontSizes, {
|
|
167
167
|
slug: blockStyleAttributes?.fontSize,
|
|
168
168
|
} );
|
|
@@ -9,9 +9,6 @@ const fromPathData24x24 = ( pathData ) => (
|
|
|
9
9
|
</SVG>
|
|
10
10
|
);
|
|
11
11
|
|
|
12
|
-
export const clipboard = fromPathData24x24(
|
|
13
|
-
'M16 18H8v-2h8v2zm0-6H8v2h8v-2zm2-9h-2v2h2v15H6V5h2V3H6a2 2 0 00-2 2v15a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2zm-4 2V4a2 2 0 10-4 0v1a2 2 0 00-2 2v1h8V7a2 2 0 00-2-2z'
|
|
14
|
-
);
|
|
15
12
|
export const posts = fromPathData24x24(
|
|
16
13
|
'M16 19H3v-2h13v2zm5-10H3v2h18V9zM3 5v2h11V5H3zm14 0v2h4V5h-4zm-6 8v2h10v-2H11zm-8 0v2h5v-2H3z'
|
|
17
14
|
);
|
|
@@ -24,12 +21,15 @@ export const refresh = fromPathData24x24(
|
|
|
24
21
|
export const noticeOutline = fromPathData24x24(
|
|
25
22
|
'M12 4c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z'
|
|
26
23
|
);
|
|
24
|
+
|
|
27
25
|
export const empty = (
|
|
28
26
|
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" />
|
|
29
27
|
);
|
|
28
|
+
|
|
30
29
|
export const search = fromPathData24x24(
|
|
31
30
|
'M21,19l-5.154-5.154C16.574,12.742,17,11.421,17,10c0-3.866-3.134-7-7-7s-7,3.134-7,7c0,3.866,3.134,7,7,7 c1.421,0,2.742-0.426,3.846-1.154L19,21L21,19z M5,10c0-2.757,2.243-5,5-5s5,2.243,5,5s-2.243,5-5,5S5,12.757,5,10z'
|
|
32
31
|
);
|
|
32
|
+
|
|
33
33
|
export default {
|
|
34
34
|
empty,
|
|
35
35
|
posts,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { SafeAreaView, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import { lowerCase, startsWith } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
11
|
-
import { __
|
|
10
|
+
import { useState } from '@wordpress/element';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { BottomSheet, Icon } from '@wordpress/components';
|
|
13
|
-
import { getProtocol,
|
|
13
|
+
import { getProtocol, prependHTTP } from '@wordpress/url';
|
|
14
14
|
import { link, cancelCircleFilled } from '@wordpress/icons';
|
|
15
15
|
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
16
16
|
|
|
@@ -47,20 +47,12 @@ export const createDirectEntry = ( value ) => {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const getURLFromClipboard = async () => {
|
|
51
|
-
const text = await Clipboard.getString();
|
|
52
|
-
return !! text && isURL( text ) ? text : '';
|
|
53
|
-
};
|
|
54
|
-
|
|
55
50
|
export const LinkPicker = ( {
|
|
56
51
|
value: initialValue,
|
|
57
52
|
onLinkPicked,
|
|
58
53
|
onCancel: cancel,
|
|
59
54
|
} ) => {
|
|
60
|
-
const [
|
|
61
|
-
value: initialValue,
|
|
62
|
-
clipboardUrl: '',
|
|
63
|
-
} );
|
|
55
|
+
const [ value, setValue ] = useState( initialValue );
|
|
64
56
|
const directEntry = createDirectEntry( value );
|
|
65
57
|
|
|
66
58
|
// the title of a direct entry is displayed as the raw input value, but if we
|
|
@@ -74,7 +66,7 @@ export const LinkPicker = ( {
|
|
|
74
66
|
};
|
|
75
67
|
|
|
76
68
|
const clear = () => {
|
|
77
|
-
setValue(
|
|
69
|
+
setValue( '' );
|
|
78
70
|
};
|
|
79
71
|
|
|
80
72
|
const omniCellStyle = usePreferredColorSchemeStyle(
|
|
@@ -87,14 +79,6 @@ export const LinkPicker = ( {
|
|
|
87
79
|
styles.iconDark
|
|
88
80
|
);
|
|
89
81
|
|
|
90
|
-
useEffect( () => {
|
|
91
|
-
getURLFromClipboard()
|
|
92
|
-
.then( ( url ) => setValue( { value, clipboardUrl: url } ) )
|
|
93
|
-
.catch( () => setValue( { value, clipboardUrl: '' } ) );
|
|
94
|
-
}, [] );
|
|
95
|
-
|
|
96
|
-
// TODO: Localize the accessibility label.
|
|
97
|
-
// TODO: Decide on if `LinkSuggestionItemCell` with `isDirectEntry` makes sense.
|
|
98
82
|
return (
|
|
99
83
|
<SafeAreaView style={ styles.safeArea }>
|
|
100
84
|
<NavBar>
|
|
@@ -112,9 +96,7 @@ export const LinkPicker = ( {
|
|
|
112
96
|
autoCapitalize="none"
|
|
113
97
|
autoCorrect={ false }
|
|
114
98
|
keyboardType="url"
|
|
115
|
-
onChangeValue={
|
|
116
|
-
setValue( { value: newValue, clipboardUrl } );
|
|
117
|
-
} }
|
|
99
|
+
onChangeValue={ setValue }
|
|
118
100
|
onSubmit={ onSubmit }
|
|
119
101
|
/* eslint-disable-next-line jsx-a11y/no-autofocus */
|
|
120
102
|
autoFocus
|
|
@@ -133,22 +115,6 @@ export const LinkPicker = ( {
|
|
|
133
115
|
</TouchableOpacity>
|
|
134
116
|
) }
|
|
135
117
|
</BottomSheet.Cell>
|
|
136
|
-
{ !! clipboardUrl && clipboardUrl !== value && (
|
|
137
|
-
<BottomSheet.LinkSuggestionItemCell
|
|
138
|
-
accessible
|
|
139
|
-
accessibilityLabel={ sprintf(
|
|
140
|
-
/* translators: Copy URL from the clipboard, https://sample.url */
|
|
141
|
-
__( 'Copy URL from the clipboard, %s' ),
|
|
142
|
-
clipboardUrl
|
|
143
|
-
) }
|
|
144
|
-
suggestion={ {
|
|
145
|
-
type: 'clipboard',
|
|
146
|
-
url: clipboardUrl,
|
|
147
|
-
isDirectEntry: true,
|
|
148
|
-
} }
|
|
149
|
-
onLinkPicked={ pickLink }
|
|
150
|
-
/>
|
|
151
|
-
) }
|
|
152
118
|
{ !! value && (
|
|
153
119
|
<LinkPickerResults
|
|
154
120
|
query={ value }
|
|
@@ -93,7 +93,6 @@ function LinkSettings( {
|
|
|
93
93
|
const [ urlInputValue, setUrlInputValue ] = useState( '' );
|
|
94
94
|
const [ labelInputValue, setLabelInputValue ] = useState( '' );
|
|
95
95
|
const [ linkRelInputValue, setLinkRelInputValue ] = useState( '' );
|
|
96
|
-
const onCloseSettingsSheetConsumed = useRef( false );
|
|
97
96
|
const prevEditorSidebarOpenedRef = useRef();
|
|
98
97
|
|
|
99
98
|
const { onHandleClosingBottomSheet } = useContext( BottomSheetContext );
|
|
@@ -124,10 +123,6 @@ function LinkSettings( {
|
|
|
124
123
|
|
|
125
124
|
useEffect( () => {
|
|
126
125
|
const isSettingSheetOpen = isVisible || editorSidebarOpened;
|
|
127
|
-
if ( isSettingSheetOpen ) {
|
|
128
|
-
onCloseSettingsSheetConsumed.current = false;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
126
|
if ( options.url.autoFill && isSettingSheetOpen && ! url ) {
|
|
132
127
|
getURLFromClipboard();
|
|
133
128
|
}
|
|
@@ -179,12 +174,6 @@ function LinkSettings( {
|
|
|
179
174
|
}, [ urlInputValue, labelInputValue, linkRelInputValue, setAttributes ] );
|
|
180
175
|
|
|
181
176
|
const onCloseSettingsSheet = useCallback( () => {
|
|
182
|
-
if ( onCloseSettingsSheetConsumed.current ) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
onCloseSettingsSheetConsumed.current = true;
|
|
187
|
-
|
|
188
177
|
onSetAttributes();
|
|
189
178
|
|
|
190
179
|
if ( onClose ) {
|
package/src/modal/README.md
CHANGED
|
@@ -255,16 +255,6 @@ This property when set to `true` will render a full screen modal.
|
|
|
255
255
|
- Required: No
|
|
256
256
|
- Default: `false`
|
|
257
257
|
|
|
258
|
-
#### __experimentalHideHeader
|
|
259
|
-
|
|
260
|
-
When set to `true`, the Modal's header (including the icon, title and close button) will not be rendered.
|
|
261
|
-
|
|
262
|
-
*Warning*: This property is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
263
|
-
|
|
264
|
-
- Type: `boolean`
|
|
265
|
-
- Required: No
|
|
266
|
-
- Default: `false`
|
|
267
|
-
|
|
268
258
|
## Related components
|
|
269
259
|
|
|
270
260
|
- To notify a user with a message of medium importance, use `Notice`.
|
package/src/modal/aria-helper.js
CHANGED
package/src/modal/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//@ts-nocheck
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* External dependencies
|
|
5
3
|
*/
|
|
@@ -8,12 +6,7 @@ import classnames from 'classnames';
|
|
|
8
6
|
/**
|
|
9
7
|
* WordPress dependencies
|
|
10
8
|
*/
|
|
11
|
-
import {
|
|
12
|
-
createPortal,
|
|
13
|
-
useEffect,
|
|
14
|
-
useRef,
|
|
15
|
-
forwardRef,
|
|
16
|
-
} from '@wordpress/element';
|
|
9
|
+
import { createPortal, useEffect, useRef } from '@wordpress/element';
|
|
17
10
|
import {
|
|
18
11
|
useInstanceId,
|
|
19
12
|
useFocusReturn,
|
|
@@ -37,34 +30,31 @@ import StyleProvider from '../style-provider';
|
|
|
37
30
|
// Used to count the number of open modals.
|
|
38
31
|
let openModalCount = 0;
|
|
39
32
|
|
|
40
|
-
function Modal(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
__experimentalHideHeader = false,
|
|
66
|
-
} = props;
|
|
67
|
-
|
|
33
|
+
export default function Modal( {
|
|
34
|
+
bodyOpenClassName = 'modal-open',
|
|
35
|
+
role = 'dialog',
|
|
36
|
+
title = null,
|
|
37
|
+
focusOnMount = true,
|
|
38
|
+
shouldCloseOnEsc = true,
|
|
39
|
+
shouldCloseOnClickOutside = true,
|
|
40
|
+
isDismissable, // Deprecated
|
|
41
|
+
isDismissible = isDismissable || true,
|
|
42
|
+
/* accessibility */
|
|
43
|
+
aria = {
|
|
44
|
+
labelledby: null,
|
|
45
|
+
describedby: null,
|
|
46
|
+
},
|
|
47
|
+
onRequestClose,
|
|
48
|
+
icon,
|
|
49
|
+
closeButtonLabel,
|
|
50
|
+
children,
|
|
51
|
+
style,
|
|
52
|
+
overlayClassName,
|
|
53
|
+
className,
|
|
54
|
+
contentLabel,
|
|
55
|
+
onKeyDown,
|
|
56
|
+
isFullScreen = false,
|
|
57
|
+
} ) {
|
|
68
58
|
const ref = useRef();
|
|
69
59
|
const instanceId = useInstanceId( Modal );
|
|
70
60
|
const headingId = title
|
|
@@ -116,7 +106,7 @@ function Modal( props, forwardedRef ) {
|
|
|
116
106
|
return createPortal(
|
|
117
107
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
118
108
|
<div
|
|
119
|
-
ref={
|
|
109
|
+
ref={ ref }
|
|
120
110
|
className={ classnames(
|
|
121
111
|
'components-modal__screen-overlay',
|
|
122
112
|
overlayClassName
|
|
@@ -149,43 +139,38 @@ function Modal( props, forwardedRef ) {
|
|
|
149
139
|
onKeyDown={ onKeyDown }
|
|
150
140
|
>
|
|
151
141
|
<div
|
|
152
|
-
className={
|
|
153
|
-
'hide-header': __experimentalHideHeader,
|
|
154
|
-
} ) }
|
|
142
|
+
className={ 'components-modal__content' }
|
|
155
143
|
role="document"
|
|
156
144
|
>
|
|
157
|
-
|
|
158
|
-
<div className="components-modal__header">
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
</h1>
|
|
175
|
-
) }
|
|
176
|
-
</div>
|
|
177
|
-
{ isDismissible && (
|
|
178
|
-
<Button
|
|
179
|
-
onClick={ onRequestClose }
|
|
180
|
-
icon={ closeSmall }
|
|
181
|
-
label={
|
|
182
|
-
closeButtonLabel ||
|
|
183
|
-
__( 'Close dialog' )
|
|
184
|
-
}
|
|
185
|
-
/>
|
|
145
|
+
<div className="components-modal__header">
|
|
146
|
+
<div className="components-modal__header-heading-container">
|
|
147
|
+
{ icon && (
|
|
148
|
+
<span
|
|
149
|
+
className="components-modal__icon-container"
|
|
150
|
+
aria-hidden
|
|
151
|
+
>
|
|
152
|
+
{ icon }
|
|
153
|
+
</span>
|
|
154
|
+
) }
|
|
155
|
+
{ title && (
|
|
156
|
+
<h1
|
|
157
|
+
id={ headingId }
|
|
158
|
+
className="components-modal__header-heading"
|
|
159
|
+
>
|
|
160
|
+
{ title }
|
|
161
|
+
</h1>
|
|
186
162
|
) }
|
|
187
163
|
</div>
|
|
188
|
-
|
|
164
|
+
{ isDismissible && (
|
|
165
|
+
<Button
|
|
166
|
+
onClick={ onRequestClose }
|
|
167
|
+
icon={ closeSmall }
|
|
168
|
+
label={
|
|
169
|
+
closeButtonLabel || __( 'Close dialog' )
|
|
170
|
+
}
|
|
171
|
+
/>
|
|
172
|
+
) }
|
|
173
|
+
</div>
|
|
189
174
|
{ children }
|
|
190
175
|
</div>
|
|
191
176
|
</div>
|
|
@@ -194,5 +179,3 @@ function Modal( props, forwardedRef ) {
|
|
|
194
179
|
document.body
|
|
195
180
|
);
|
|
196
181
|
}
|
|
197
|
-
|
|
198
|
-
export default forwardRef( Modal );
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
title: 'Components/Modal',
|
|
21
21
|
component: Modal,
|
|
22
22
|
parameters: {
|
|
23
|
-
knobs: {
|
|
23
|
+
knobs: { disabled: false },
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -55,10 +55,6 @@ export const _default = () => {
|
|
|
55
55
|
'shouldCloseOnClickOutside',
|
|
56
56
|
true
|
|
57
57
|
);
|
|
58
|
-
const __experimentalHideHeader = boolean(
|
|
59
|
-
'__experimentalHideHeader',
|
|
60
|
-
false
|
|
61
|
-
);
|
|
62
58
|
|
|
63
59
|
const iconComponent = showIcon ? <Icon icon={ wordpress } /> : null;
|
|
64
60
|
|
|
@@ -69,7 +65,6 @@ export const _default = () => {
|
|
|
69
65
|
shouldCloseOnEsc,
|
|
70
66
|
shouldCloseOnClickOutside,
|
|
71
67
|
title,
|
|
72
|
-
__experimentalHideHeader,
|
|
73
68
|
};
|
|
74
69
|
|
|
75
70
|
return <ModalExample { ...modalProps } />;
|
package/src/modal/style.scss
CHANGED
package/src/modal/test/index.js
CHANGED
|
@@ -46,15 +46,4 @@ describe( 'Modal', () => {
|
|
|
46
46
|
const titleId = within( dialog ).getByText( 'Test Title' ).id;
|
|
47
47
|
expect( dialog ).toHaveAttribute( 'aria-labelledby', titleId );
|
|
48
48
|
} );
|
|
49
|
-
|
|
50
|
-
it( 'hides the header when the `__experimentalHideHeader` prop is used', () => {
|
|
51
|
-
render(
|
|
52
|
-
<Modal title="Test Title" __experimentalHideHeader>
|
|
53
|
-
<p>Modal content</p>
|
|
54
|
-
</Modal>
|
|
55
|
-
);
|
|
56
|
-
const dialog = screen.getByRole( 'dialog' );
|
|
57
|
-
const title = within( dialog ).queryByText( 'Test Title' );
|
|
58
|
-
expect( title ).not.toBeInTheDocument();
|
|
59
|
-
} );
|
|
60
49
|
} );
|
package/src/navigation/README.md
CHANGED
|
@@ -44,6 +44,15 @@ const MyNavigation = () => (
|
|
|
44
44
|
</Navigation>
|
|
45
45
|
);
|
|
46
46
|
```
|
|
47
|
+
## CSS Classes leveraged
|
|
48
|
+
|
|
49
|
+
The structural CSS for the navigation block targets generic classnames across menu items of multiple types including those automatically generated by the Page List block. Here are some of the notable classnames and what they are used for:
|
|
50
|
+
|
|
51
|
+
- `.wp-block-navigation__submenu-container` is applied to submenus to main menu items.
|
|
52
|
+
- `.wp-block-navigation-item` is applied to every menu item.
|
|
53
|
+
- `.wp-block-navigation-item__content` is applied to the link inside a menu item.
|
|
54
|
+
- `.wp-block-navigation-item__label` is applied to the innermost container around the menu item text label.
|
|
55
|
+
- `.wp-block-navigation__submenu-icon` is applied to the submenu indicator (chevron).
|
|
47
56
|
|
|
48
57
|
## Navigation Props
|
|
49
58
|
|