@wordpress/components 28.8.4 → 28.9.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 +26 -3
- package/build/autocomplete/index.js +4 -1
- package/build/autocomplete/index.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +3 -14
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -2
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +2 -14
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/styles.js +13 -13
- package/build/border-control/styles.js.map +1 -1
- package/build/border-control/types.js.map +1 -1
- package/build/box-control/index.js +4 -4
- package/build/box-control/index.js.map +1 -1
- package/build/box-control/types.js.map +1 -1
- package/build/composite/group-label.js +7 -1
- package/build/composite/group-label.js.map +1 -1
- package/build/composite/group.js +7 -1
- package/build/composite/group.js.map +1 -1
- package/build/composite/hover.js +8 -2
- package/build/composite/hover.js.map +1 -1
- package/build/composite/index.js +5 -1
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +16 -1
- package/build/composite/item.js.map +1 -1
- package/build/composite/row.js +7 -1
- package/build/composite/row.js.map +1 -1
- package/build/composite/typeahead.js +8 -2
- package/build/composite/typeahead.js.map +1 -1
- package/build/date-time/date/index.js +4 -2
- package/build/date-time/date/index.js.map +1 -1
- package/build/index.js +36 -5
- package/build/index.js.map +1 -1
- package/build/navigator/index.js +128 -32
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/legacy.js +179 -0
- package/build/navigator/legacy.js.map +1 -0
- package/build/navigator/{navigator-provider → navigator}/component.js +5 -40
- package/build/navigator/navigator/component.js.map +1 -0
- package/build/navigator/navigator-back-button/component.js +2 -38
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +1 -1
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/component.js +2 -37
- package/build/navigator/navigator-button/component.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +1 -1
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +40 -62
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-screen/use-screen-animate-presence.js +114 -0
- package/build/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
- package/build/navigator/navigator-to-parent-button/component.js +3 -7
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/navigator/styles.js +78 -35
- package/build/navigator/styles.js.map +1 -1
- package/build/navigator/types.js.map +1 -1
- package/build/navigator/use-navigator.js +4 -1
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/search-control/index.js +5 -2
- package/build/search-control/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +61 -28
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/use-track-overflow.js +73 -0
- package/build/tabs/use-track-overflow.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +6 -2
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +73 -8
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -19
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build/utils/element-rect.js +22 -13
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/hooks/use-on-value-update.js +3 -7
- package/build/utils/hooks/use-on-value-update.js.map +1 -1
- package/build-module/autocomplete/index.js +4 -1
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +3 -14
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -2
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +2 -14
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/styles.js +13 -13
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/border-control/types.js.map +1 -1
- package/build-module/box-control/index.js +4 -4
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/box-control/types.js.map +1 -1
- package/build-module/composite/group-label.js +7 -1
- package/build-module/composite/group-label.js.map +1 -1
- package/build-module/composite/group.js +7 -1
- package/build-module/composite/group.js.map +1 -1
- package/build-module/composite/hover.js +8 -2
- package/build-module/composite/hover.js.map +1 -1
- package/build-module/composite/index.js +5 -1
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +16 -1
- package/build-module/composite/item.js.map +1 -1
- package/build-module/composite/row.js +7 -1
- package/build-module/composite/row.js.map +1 -1
- package/build-module/composite/typeahead.js +8 -2
- package/build-module/composite/typeahead.js.map +1 -1
- package/build-module/date-time/date/index.js +4 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/index.js +14 -4
- package/build-module/index.js.map +1 -1
- package/build-module/navigator/index.js +130 -5
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/legacy.js +167 -0
- package/build-module/navigator/legacy.js.map +1 -0
- package/build-module/navigator/{navigator-provider → navigator}/component.js +4 -39
- package/build-module/navigator/navigator/component.js.map +1 -0
- package/build-module/navigator/navigator-back-button/component.js +1 -37
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/component.js +1 -36
- package/build-module/navigator/navigator-button/component.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +39 -61
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/use-screen-animate-presence.js +106 -0
- package/build-module/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
- package/build-module/navigator/navigator-to-parent-button/component.js +2 -6
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/navigator/styles.js +77 -33
- package/build-module/navigator/styles.js.map +1 -1
- package/build-module/navigator/types.js.map +1 -1
- package/build-module/navigator/use-navigator.js +4 -1
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/search-control/index.js +5 -2
- package/build-module/search-control/index.js.map +1 -1
- package/build-module/tabs/styles.js +3 -3
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +62 -29
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/use-track-overflow.js +67 -0
- package/build-module/tabs/use-track-overflow.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +6 -2
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +76 -10
- 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 +7 -7
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +12 -22
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +7 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-module/utils/element-rect.js +22 -12
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/hooks/use-on-value-update.js +3 -6
- package/build-module/utils/hooks/use-on-value-update.js.map +1 -1
- package/build-style/style-rtl.css +26 -13
- package/build-style/style.css +26 -13
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +5 -15
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +2 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +3 -2
- package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +3 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +2 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts +15 -30
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +12 -7
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +4 -4
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +3 -3
- package/build-types/composite/group-label.d.ts.map +1 -1
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/item.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts +22 -0
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/test/index.d.ts +2 -0
- package/build-types/composite/test/index.d.ts.map +1 -0
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
- package/build-types/index.d.ts +23 -4
- package/build-types/index.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +171 -5
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/legacy.d.ts +226 -0
- package/build-types/navigator/legacy.d.ts.map +1 -0
- package/build-types/navigator/navigator/component.d.ts +3 -0
- package/build-types/navigator/navigator/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +0 -35
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +0 -34
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +0 -35
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +16 -0
- package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -4
- package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +5 -5
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/styles.d.ts +20 -7
- package/build-types/navigator/styles.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +19 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts +4 -1
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/select-control/stories/index.story.d.ts +7 -0
- package/build-types/select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +2 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/use-track-overflow.d.ts +17 -0
- package/build-types/tabs/use-track-overflow.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.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.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +0 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +2 -1
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/utils/element-rect.d.ts +8 -0
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-on-value-update.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/autocomplete/index.tsx +4 -1
- package/src/border-box-control/border-box-control/README.md +22 -26
- package/src/border-box-control/border-box-control/component.tsx +3 -14
- package/src/border-box-control/stories/index.story.tsx +2 -1
- package/src/border-control/border-control/README.md +26 -36
- package/src/border-control/border-control/component.tsx +1 -2
- package/src/border-control/border-control-dropdown/component.tsx +1 -15
- package/src/border-control/stories/index.story.tsx +4 -10
- package/src/border-control/styles.ts +0 -1
- package/src/border-control/test/index.js +2 -15
- package/src/border-control/types.ts +12 -7
- package/src/box-control/README.md +9 -12
- package/src/box-control/index.tsx +4 -4
- package/src/box-control/stories/index.story.tsx +1 -1
- package/src/box-control/types.ts +3 -3
- package/src/composite/group-label.tsx +7 -5
- package/src/composite/group.tsx +7 -7
- package/src/composite/hover.tsx +7 -7
- package/src/composite/index.tsx +6 -1
- package/src/composite/item.tsx +19 -1
- package/src/composite/legacy/test/index.tsx +22 -21
- package/src/composite/row.tsx +7 -7
- package/src/composite/stories/index.story.tsx +42 -0
- package/src/composite/test/index.tsx +123 -0
- package/src/composite/typeahead.tsx +7 -7
- package/src/date-time/date/index.tsx +2 -0
- package/src/dropdown/stories/index.story.tsx +1 -0
- package/src/dropdown/style.scss +10 -13
- package/src/dropdown-menu/stories/index.story.tsx +3 -0
- package/src/index.ts +19 -1
- package/src/menu-group/style.scss +4 -1
- package/src/menu-items-choice/style.scss +2 -0
- package/src/navigator/README.md +176 -0
- package/src/navigator/index.tsx +131 -0
- package/src/navigator/legacy.ts +169 -0
- package/src/navigator/{navigator-provider → navigator}/component.tsx +6 -44
- package/src/navigator/navigator-back-button/component.tsx +1 -37
- package/src/navigator/navigator-back-button/hook.ts +1 -1
- package/src/navigator/navigator-button/component.tsx +1 -36
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-screen/component.tsx +48 -76
- package/src/navigator/navigator-screen/use-screen-animate-presence.ts +177 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +2 -7
- package/src/navigator/stories/index.story.tsx +55 -54
- package/src/navigator/styles.ts +112 -41
- package/src/navigator/test/index.tsx +47 -47
- package/src/navigator/types.ts +19 -1
- package/src/navigator/use-navigator.ts +4 -1
- package/src/search-control/index.tsx +2 -2
- package/src/select-control/stories/index.story.tsx +14 -1
- package/src/tabs/stories/index.story.tsx +106 -0
- package/src/tabs/styles.ts +54 -20
- package/src/tabs/tablist.tsx +60 -26
- package/src/tabs/use-track-overflow.ts +76 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +208 -44
- package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +18 -10
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +19 -9
- package/src/toggle-group-control/toggle-group-control/component.tsx +114 -6
- package/src/toggle-group-control/toggle-group-control/styles.ts +41 -0
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +10 -27
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -11
- package/src/toggle-group-control/types.ts +3 -1
- package/src/tools-panel/tools-panel/README.md +10 -10
- package/src/utils/element-rect.ts +32 -15
- package/src/utils/hooks/use-on-value-update.ts +3 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/build/navigator/navigator-provider/component.js.map +0 -1
- package/build/utils/hooks/use-event.js +0 -41
- package/build/utils/hooks/use-event.js.map +0 -1
- package/build-module/navigator/navigator-provider/component.js.map +0 -1
- package/build-module/utils/hooks/use-event.js +0 -35
- package/build-module/utils/hooks/use-event.js.map +0 -1
- package/build-types/navigator/navigator-provider/component.d.ts +0 -37
- package/build-types/navigator/navigator-provider/component.d.ts.map +0 -1
- package/build-types/utils/hooks/use-event.d.ts +0 -20
- package/build-types/utils/hooks/use-event.d.ts.map +0 -1
- package/src/navigator/index.ts +0 -6
- package/src/navigator/navigator-back-button/README.md +0 -15
- package/src/navigator/navigator-button/README.md +0 -38
- package/src/navigator/navigator-provider/README.md +0 -94
- package/src/navigator/navigator-screen/README.md +0 -33
- package/src/navigator/navigator-to-parent-button/README.md +0 -17
- package/src/utils/hooks/use-event.ts +0 -38
|
@@ -77,7 +77,7 @@ export type NavigatorContext = Navigator & {
|
|
|
77
77
|
removeScreen: (screen: Screen) => void;
|
|
78
78
|
match?: string;
|
|
79
79
|
};
|
|
80
|
-
export type
|
|
80
|
+
export type NavigatorProps = {
|
|
81
81
|
/**
|
|
82
82
|
* The initial active path.
|
|
83
83
|
*/
|
|
@@ -90,6 +90,24 @@ export type NavigatorProviderProps = {
|
|
|
90
90
|
export type NavigatorScreenProps = {
|
|
91
91
|
/**
|
|
92
92
|
* The screen's path, matched against the current path stored in the navigator.
|
|
93
|
+
*
|
|
94
|
+
* `Navigator` assumes that screens are organized hierarchically according
|
|
95
|
+
* to their `path`, which should follow a URL-like scheme where each path
|
|
96
|
+
* segment starts with and is separated by the `/` character.
|
|
97
|
+
*
|
|
98
|
+
* `Navigator` will treat "back" navigations as going to the parent screen —
|
|
99
|
+
* it is, therefore, the responsibility of the consumer of the component to
|
|
100
|
+
* create the correct screen hierarchy.
|
|
101
|
+
*
|
|
102
|
+
* For example:
|
|
103
|
+
* - `/` is the root of all paths. There should always be a screen with
|
|
104
|
+
* `path="/"`;
|
|
105
|
+
* - `/parent/child` is a child of `/parent`;
|
|
106
|
+
* - `/parent/child/grand-child` is a child of `/parent/child`;
|
|
107
|
+
* - `/parent/:param` is a child of `/parent` as well;
|
|
108
|
+
* - if the current screen has a `path="/parent/child/grand-child"`, when
|
|
109
|
+
* going "back" `Navigator` will try to recursively navigate the path
|
|
110
|
+
* hierarchy until a matching screen (or the root `/`) is found.
|
|
93
111
|
*/
|
|
94
112
|
path: string;
|
|
95
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAE,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAE,eAAe,EAAE,QAAQ,CAAE,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG;IACjD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAGF,MAAM,MAAM,S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B,GAAG,wBAAwB,GAAG;IAC7D;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Navigator } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Retrieves a `navigator` instance.
|
|
3
|
+
* Retrieves a `navigator` instance. This hook provides advanced functionality,
|
|
4
|
+
* such as imperatively navigating to a new location (with options like
|
|
5
|
+
* navigating back or skipping focus restoration) and accessing the current
|
|
6
|
+
* location and path parameters.
|
|
4
7
|
*/
|
|
5
8
|
export declare function useNavigator(): Navigator;
|
|
6
9
|
//# sourceMappingURL=use-navigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigator.d.ts","sourceRoot":"","sources":["../../src/navigator/use-navigator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"use-navigator.d.ts","sourceRoot":"","sources":["../../src/navigator/use-navigator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAWxC"}
|
|
@@ -21,6 +21,13 @@ export declare const WithLabelAndHelpText: import("@storybook/types").AnnotatedS
|
|
|
21
21
|
export declare const WithCustomChildren: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../../context").WordPressComponentProps<import("../types").SelectControlProps<string>, "select", false> & {
|
|
22
22
|
ref?: React.Ref<HTMLSelectElement>;
|
|
23
23
|
}>;
|
|
24
|
+
/**
|
|
25
|
+
* By default, the prefix is aligned with the edge of the input border, with no padding.
|
|
26
|
+
* If you want to apply standard padding in accordance with the size variant, wrap the element in the `<InputControlPrefixWrapper>` component.
|
|
27
|
+
*/
|
|
28
|
+
export declare const WithPrefix: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../../context").WordPressComponentProps<import("../types").SelectControlProps<string>, "select", false> & {
|
|
29
|
+
ref?: React.Ref<HTMLSelectElement>;
|
|
30
|
+
}>;
|
|
24
31
|
export declare const Minimal: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../../context").WordPressComponentProps<import("../types").SelectControlProps<string>, "select", false> & {
|
|
25
32
|
ref?: React.Ref<HTMLSelectElement>;
|
|
26
33
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,aAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,aAAa,MAAM,KAAK,CAAC;AAGhC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAerC,CAAC;AACF,eAAe,IAAI,CAAC;AAgCpB,eAAO,MAAM,OAAO;UA4DozC,MAAO,GAAG;EA5D1xC,CAAC;AAYzD,eAAO,MAAM,oBAAoB;gBAgD8yC,GAAG;EAhD7wC,CAAC;AAMtE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;gBAsCgzC,GAAG;EAtC/wC,CAAC;AAsBpE;;;GAGG;AACH,eAAO,MAAM,UAAU;gBAYwzC,GAAG;EAZvxC,CAAC;AAM5D,eAAO,MAAM,OAAO;gBAM2zC,GAAG;EAN1xC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { Meta } from '@storybook/react';
|
|
4
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
@@ -9,6 +9,7 @@ import Tabs from '..';
|
|
|
9
9
|
declare const meta: Meta<typeof Tabs>;
|
|
10
10
|
export default meta;
|
|
11
11
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
|
|
12
|
+
export declare const SizeAndOverflowPlayground: StoryFn<typeof Tabs>;
|
|
12
13
|
export declare const Vertical: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
|
|
13
14
|
export declare const DisabledTab: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
|
|
14
15
|
export declare const WithTabIconsAndTooltips: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("../types").TabsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tabs/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tabs/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,IAAI,MAAM,IAAI,CAAC;AAOtB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAiB5B,CAAC;AACF,eAAe,IAAI,CAAC;AA+BpB,eAAO,MAAM,OAAO,qHAAsB,CAAC;AAE3C,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAE,OAAO,IAAI,CAqG3D,CAAC;AAiBF,eAAO,MAAM,QAAQ,qHAA8B,CAAC;AAwBpD,eAAO,MAAM,WAAW,qHAAiC,CAAC;AA0C1D,eAAO,MAAM,uBAAuB,qHAEnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,qHAAsB,CAAC;AA0CpD,eAAO,MAAM,aAAa,qHAAmC,CAAC;AA0D9D,eAAO,MAAM,oBAAoB,qHAAiC,CAAC;AA6DnE,eAAO,MAAM,cAAc,qHAAoC,CAAC;AAqChE,eAAO,MAAM,kBAAkB,qHAAwC,CAAC;AAgCxE,eAAO,MAAM,cAAc,qHAAoC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/tabs/styles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAQ1C,eAAO,MAAM,cAAc;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/tabs/styles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAQ1C,eAAO,MAAM,cAAc;;SAczB,MAAI,WAAW;yGA0FhB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;UA0Ef,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;UAapB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tablist.d.ts","sourceRoot":"","sources":["../../src/tabs/tablist.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tablist.d.ts","sourceRoot":"","sources":["../../src/tabs/tablist.tsx"],"names":[],"mappings":"AAaA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAW5C,eAAO,MAAM,OAAO,mPAsGjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks if an element contains overflow and on which end by tracking the
|
|
3
|
+
* first and last child elements with an `IntersectionObserver` in relation
|
|
4
|
+
* to the parent element.
|
|
5
|
+
*
|
|
6
|
+
* Note that the returned value will only indicate whether the first or last
|
|
7
|
+
* element is currently "going out of bounds" but not whether it happens on
|
|
8
|
+
* the X or Y axis.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useTrackOverflow(parent: HTMLElement | undefined | null, children: {
|
|
11
|
+
first: HTMLElement | undefined | null;
|
|
12
|
+
last: HTMLElement | undefined | null;
|
|
13
|
+
}): {
|
|
14
|
+
first: boolean;
|
|
15
|
+
last: boolean;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=use-track-overflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-track-overflow.d.ts","sourceRoot":"","sources":["../../src/tabs/use-track-overflow.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,EACtC,QAAQ,EAAE;IACT,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;CACrC;;;EAqDD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const ToggleGroupControlAsButtonGroup: import("react").ForwardRefExoticComponent<
|
|
1
|
+
import type { ToggleGroupControlContextProps } from '../types';
|
|
2
|
+
export declare const ToggleGroupControlAsButtonGroup: import("react").ForwardRefExoticComponent<Pick<import("../types").ToggleGroupControlProps, "size" | "label" | "children" | "onChange" | "value" | "isAdaptiveWidth"> & Pick<ToggleGroupControlContextProps, "setSelectedElement"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size" | "label" | "children" | "onChange" | "value" | "as" | "isAdaptiveWidth" | "setSelectedElement"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
3
|
//# sourceMappingURL=as-button-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"as-button-group.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/as-button-group.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"as-button-group.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/as-button-group.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEX,8BAA8B,EAC9B,MAAM,UAAU,CAAC;AAyElB,eAAO,MAAM,+BAA+B,mfAE3C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const ToggleGroupControlAsRadioGroup: import("react").ForwardRefExoticComponent<
|
|
1
|
+
import type { ToggleGroupControlContextProps } from '../types';
|
|
2
|
+
export declare const ToggleGroupControlAsRadioGroup: import("react").ForwardRefExoticComponent<Pick<import("../types").ToggleGroupControlProps, "size" | "label" | "children" | "onChange" | "value" | "isAdaptiveWidth"> & Pick<ToggleGroupControlContextProps, "setSelectedElement"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "size" | "label" | "children" | "onChange" | "value" | "as" | "isAdaptiveWidth" | "setSelectedElement"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
3
|
//# sourceMappingURL=as-radio-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"as-radio-group.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/as-radio-group.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"as-radio-group.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/as-radio-group.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAEX,8BAA8B,EAC9B,MAAM,UAAU,CAAC;AAwFlB,eAAO,MAAM,8BAA8B,mfAE1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/component.tsx"],"names":[],"mappings":"AA6MA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;8CAG9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,kBAAkB,uCAI5B,IAAI,CAAE,uBAAuB,EAAE,SAAS,GAAG,gBAAgB,CAAE,GAAG;IAClE,IAAI,EAAE,WAAW,CAAE,uBAAuB,CAAE,MAAM,CAAE,CAAE,CAAC;CACvD,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control/styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,kBAAkB,uCAI5B,IAAI,CAAE,uBAAuB,EAAE,SAAS,GAAG,gBAAgB,CAAE,GAAG;IAClE,IAAI,EAAE,WAAW,CAAE,uBAAuB,CAAE,MAAM,CAAE,CAAE,CAAC;CACvD,8CAmDA,CAAC;AAyBF,eAAO,MAAM,sBAAsB,SAC5B,WAAW,CAAE,uBAAuB,CAAE,MAAM,CAAE,CAAE,8CActD,CAAC;AAEF,eAAO,MAAM,KAAK,2CAGjB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;SAhGF,MACzB,WAAW;yGAkGd,CAAC"}
|
package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-base/component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-base/component.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,KAAK,EACX,iCAAiC,EAEjC,MAAM,UAAU,CAAC;AAmJlB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,qCAAqC,2RAG1C,CAAC;AAEF,eAAe,qCAAqC,CAAC"}
|
|
@@ -11,5 +11,4 @@ export declare const ButtonContentView: import("@emotion/styled").StyledComponen
|
|
|
11
11
|
theme?: import("@emotion/react").Theme;
|
|
12
12
|
as?: React.ElementType;
|
|
13
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
-
export declare const backdropView: import("@emotion/utils").SerializedStyles;
|
|
15
14
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-base/styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,uBAAuB,EACvB,iCAAiC,EACjC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,SAAS;;SAgBnB,MAAO,WAAW;yGAXpB,CAAC;AAEF,eAAO,MAAM,UAAU,2CAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,iDAKpB,IAAI,CAAE,uBAAuB,EAAE,gBAAgB,GAAG,MAAM,CAAE,GAC5D,IAAI,CAAE,iCAAiC,EAAE,QAAQ,CAAE,GAAG;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB,8CA4CD,CAAC;AAqBF,eAAO,MAAM,iBAAiB;;eApEpB,WAAW;yGAwEpB,CAAC
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/toggle-group-control-option-base/styles.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,uBAAuB,EACvB,iCAAiC,EACjC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,SAAS;;SAgBnB,MAAO,WAAW;yGAXpB,CAAC;AAEF,eAAO,MAAM,UAAU,2CAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,iDAKpB,IAAI,CAAE,uBAAuB,EAAE,gBAAgB,GAAG,MAAM,CAAE,GAC5D,IAAI,CAAE,iCAAiC,EAAE,QAAQ,CAAE,GAAG;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB,8CA4CD,CAAC;AAqBF,eAAO,MAAM,iBAAiB;;eApEpB,WAAW;yGAwEpB,CAAC"}
|
|
@@ -121,6 +121,7 @@ export type ToggleGroupControlContextProps = {
|
|
|
121
121
|
size: ToggleGroupControlProps['size'];
|
|
122
122
|
value: ToggleGroupControlProps['value'];
|
|
123
123
|
setValue: (newValue: string | number | undefined) => void;
|
|
124
|
+
setSelectedElement: (element: HTMLElement | undefined) => void;
|
|
124
125
|
};
|
|
125
|
-
export type ToggleGroupControlMainControlProps = Pick<ToggleGroupControlProps, 'children' | 'isAdaptiveWidth' | 'label' | 'size' | 'onChange' | 'value'>;
|
|
126
|
+
export type ToggleGroupControlMainControlProps = Pick<ToggleGroupControlProps, 'children' | 'isAdaptiveWidth' | 'label' | 'size' | 'onChange' | 'value'> & Pick<ToggleGroupControlContextProps, 'setSelectedElement'>;
|
|
126
127
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1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kB,CAAC;IACtC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,uBAAuB,CAAE,SAAS,CAAE,CAAC;IAC9C,IAAI,EAAE,uBAAuB,CAAE,MAAM,CAAE,CAAC;IACxC,KAAK,EAAE,uBAAuB,CAAE,OAAO,CAAE,CAAC;IAC1C,QAAQ,EAAE,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,KAAM,IAAI,CAAC;IAC5D,kBAAkB,EAAE,CAAE,OAAO,EAAE,WAAW,GAAG,SAAS,KAAM,IAAI,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACpD,uBAAuB,EACvB,UAAU,GAAG,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACxE,GACA,IAAI,CAAE,8BAA8B,EAAE,oBAAoB,CAAE,CAAC"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* The position and dimensions of an element, relative to its offset parent.
|
|
3
3
|
*/
|
|
4
4
|
export type ElementOffsetRect = {
|
|
5
|
+
/**
|
|
6
|
+
* The element the rect belongs to.
|
|
7
|
+
*/
|
|
8
|
+
element: HTMLElement | undefined;
|
|
5
9
|
/**
|
|
6
10
|
* The distance from the top edge of the offset parent to the top edge of
|
|
7
11
|
* the element.
|
|
@@ -35,6 +39,7 @@ export type ElementOffsetRect = {
|
|
|
35
39
|
* An `ElementOffsetRect` object with all values set to zero.
|
|
36
40
|
*/
|
|
37
41
|
export declare const NULL_ELEMENT_OFFSET_RECT: {
|
|
42
|
+
element: undefined;
|
|
38
43
|
top: number;
|
|
39
44
|
right: number;
|
|
40
45
|
bottom: number;
|
|
@@ -60,6 +65,9 @@ export declare function getElementOffsetRect(element: HTMLElement): ElementOffse
|
|
|
60
65
|
* Tracks the position and dimensions of an element, relative to its offset
|
|
61
66
|
* parent. The element can be changed dynamically.
|
|
62
67
|
*
|
|
68
|
+
* When no element is provided (`null` or `undefined`), the hook will return
|
|
69
|
+
* a "null" rect, in which all values are `0` and `element` is `undefined`.
|
|
70
|
+
*
|
|
63
71
|
* **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s
|
|
64
72
|
* documentation for more details). When that happens, this hook will attempt
|
|
65
73
|
* to measure again after a frame, and if that fails, it will poll every 100
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-rect.d.ts","sourceRoot":"","sources":["../../src/utils/element-rect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"element-rect.d.ts","sourceRoot":"","sources":["../../src/utils/element-rect.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;CAQR,CAAC;AAE9B;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,WAAW,GAClB,iBAAiB,GAAG,SAAS,CA8C/B;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACxC,aAAa,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,qBAsC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-on-value-update.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-on-value-update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-on-value-update.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/use-on-value-update.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAE,CAAC,IAAK;IACrC,aAAa,EAAE,CAAC,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAE,CAAC;AAClC;;GAEG;AACH,KAAK,EAAE,CAAC;AACR;;GAEG;AACH,QAAQ,EAAE,CAAE,OAAO,EAAE,kBAAkB,CAAE,CAAC,CAAE,KAAM,IAAI,QAYtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.9.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"@types/gradient-parser": "0.1.3",
|
|
44
44
|
"@types/highlight-words-core": "1.2.1",
|
|
45
45
|
"@use-gesture/react": "^10.3.1",
|
|
46
|
-
"@wordpress/a11y": "^4.
|
|
47
|
-
"@wordpress/compose": "^7.
|
|
48
|
-
"@wordpress/date": "^5.
|
|
49
|
-
"@wordpress/deprecated": "^4.
|
|
50
|
-
"@wordpress/dom": "^4.
|
|
51
|
-
"@wordpress/element": "^6.
|
|
52
|
-
"@wordpress/escape-html": "^3.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/html-entities": "^4.
|
|
55
|
-
"@wordpress/i18n": "^5.
|
|
56
|
-
"@wordpress/icons": "^10.
|
|
57
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/primitives": "^4.
|
|
60
|
-
"@wordpress/private-apis": "^1.
|
|
61
|
-
"@wordpress/rich-text": "^7.
|
|
62
|
-
"@wordpress/warning": "^3.
|
|
46
|
+
"@wordpress/a11y": "^4.9.0",
|
|
47
|
+
"@wordpress/compose": "^7.9.0",
|
|
48
|
+
"@wordpress/date": "^5.9.0",
|
|
49
|
+
"@wordpress/deprecated": "^4.9.0",
|
|
50
|
+
"@wordpress/dom": "^4.9.0",
|
|
51
|
+
"@wordpress/element": "^6.9.0",
|
|
52
|
+
"@wordpress/escape-html": "^3.9.0",
|
|
53
|
+
"@wordpress/hooks": "^4.9.0",
|
|
54
|
+
"@wordpress/html-entities": "^4.9.0",
|
|
55
|
+
"@wordpress/i18n": "^5.9.0",
|
|
56
|
+
"@wordpress/icons": "^10.9.0",
|
|
57
|
+
"@wordpress/is-shallow-equal": "^5.9.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.9.0",
|
|
59
|
+
"@wordpress/primitives": "^4.9.0",
|
|
60
|
+
"@wordpress/private-apis": "^1.9.0",
|
|
61
|
+
"@wordpress/rich-text": "^7.9.0",
|
|
62
|
+
"@wordpress/warning": "^3.9.0",
|
|
63
63
|
"change-case": "^4.1.2",
|
|
64
64
|
"clsx": "^2.1.1",
|
|
65
65
|
"colord": "^2.7.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "2e5495c635910cb34bfaca3c6258d2e989f66214"
|
|
88
88
|
}
|
|
@@ -72,6 +72,9 @@ const getNodeText = ( node: React.ReactNode ): string => {
|
|
|
72
72
|
|
|
73
73
|
const EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];
|
|
74
74
|
|
|
75
|
+
// Used for generating the instance ID
|
|
76
|
+
const AUTOCOMPLETE_HOOK_REFERENCE = {};
|
|
77
|
+
|
|
75
78
|
export function useAutocomplete( {
|
|
76
79
|
record,
|
|
77
80
|
onChange,
|
|
@@ -79,7 +82,7 @@ export function useAutocomplete( {
|
|
|
79
82
|
completers,
|
|
80
83
|
contentRef,
|
|
81
84
|
}: UseAutocompleteProps ) {
|
|
82
|
-
const instanceId = useInstanceId(
|
|
85
|
+
const instanceId = useInstanceId( AUTOCOMPLETE_HOOK_REFERENCE );
|
|
83
86
|
const [ selectedIndex, setSelectedIndex ] = useState( 0 );
|
|
84
87
|
|
|
85
88
|
const [ filteredOptions, setFilteredOptions ] = useState<
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
# BorderBoxControl
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</div>
|
|
6
|
-
<br />
|
|
7
|
-
|
|
8
|
-
This component provides users with the ability to configure a single "flat"
|
|
9
|
-
border or separate borders per side.
|
|
3
|
+
An input control for the color, style, and width of the border of a box. The
|
|
4
|
+
border can be customized as a whole, or individually for each side of the box.
|
|
10
5
|
|
|
11
6
|
## Development guidelines
|
|
12
7
|
|
|
@@ -28,7 +23,7 @@ show "Mixed" placeholder text.
|
|
|
28
23
|
|
|
29
24
|
```jsx
|
|
30
25
|
import { useState } from 'react';
|
|
31
|
-
import {
|
|
26
|
+
import { BorderBoxControl } from '@wordpress/components';
|
|
32
27
|
import { __ } from '@wordpress/i18n';
|
|
33
28
|
|
|
34
29
|
const colors = [
|
|
@@ -76,35 +71,35 @@ colors are organized by multiple origins.
|
|
|
76
71
|
|
|
77
72
|
Each color may be an object containing a `name` and `color` value.
|
|
78
73
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
74
|
+
- Required: No
|
|
75
|
+
- Default: `[]`
|
|
81
76
|
|
|
82
77
|
### `disableCustomColors`: `boolean`
|
|
83
78
|
|
|
84
79
|
This toggles the ability to choose custom colors.
|
|
85
80
|
|
|
86
|
-
-
|
|
81
|
+
- Required: No
|
|
87
82
|
|
|
88
83
|
### `enableAlpha`: `boolean`
|
|
89
84
|
|
|
90
85
|
This controls whether the alpha channel will be offered when selecting
|
|
91
86
|
custom colors.
|
|
92
87
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
88
|
+
- Required: No
|
|
89
|
+
- Default: `false`
|
|
95
90
|
|
|
96
91
|
### `enableStyle`: `boolean`
|
|
97
92
|
|
|
98
93
|
This controls whether to support border style selections.
|
|
99
94
|
|
|
100
|
-
-
|
|
101
|
-
-
|
|
95
|
+
- Required: No
|
|
96
|
+
- Default: `true`
|
|
102
97
|
|
|
103
98
|
### `hideLabelFromVision`: `boolean`
|
|
104
99
|
|
|
105
100
|
Provides control over whether the label will only be visible to screen readers.
|
|
106
101
|
|
|
107
|
-
-
|
|
102
|
+
- Required: No
|
|
108
103
|
|
|
109
104
|
### `label`: `string`
|
|
110
105
|
|
|
@@ -113,7 +108,7 @@ If provided, a label will be generated using this as the content.
|
|
|
113
108
|
_Whether it is visible only to screen readers is controlled via
|
|
114
109
|
`hideLabelFromVision`._
|
|
115
110
|
|
|
116
|
-
-
|
|
111
|
+
- Required: No
|
|
117
112
|
|
|
118
113
|
### `onChange`: `( value?: Object ) => void`
|
|
119
114
|
|
|
@@ -123,7 +118,7 @@ borders, or `undefined`.
|
|
|
123
118
|
|
|
124
119
|
_Note: The will be `undefined` if a user clears all borders._
|
|
125
120
|
|
|
126
|
-
-
|
|
121
|
+
- Required: Yes
|
|
127
122
|
|
|
128
123
|
### `popoverPlacement`: `string`
|
|
129
124
|
|
|
@@ -133,21 +128,21 @@ By default, popovers are displayed relative to the button that initiated the pop
|
|
|
133
128
|
|
|
134
129
|
The available base placements are 'top', 'right', 'bottom', 'left'. Each of these base placements has an alignment in the form -start and -end. For example, 'right-start', or 'bottom-end'. These allow you to align the tooltip to the edges of the button, rather than centering it.
|
|
135
130
|
|
|
136
|
-
-
|
|
131
|
+
- Required: No
|
|
137
132
|
|
|
138
133
|
### `popoverOffset`: `number`
|
|
139
134
|
|
|
140
135
|
The space between the popover and the control wrapper.
|
|
141
136
|
|
|
142
|
-
-
|
|
137
|
+
- Required: No
|
|
143
138
|
|
|
144
139
|
### `size`: `string`
|
|
145
140
|
|
|
146
141
|
Size of the control.
|
|
147
142
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
143
|
+
- Required: No
|
|
144
|
+
- Default: `default`
|
|
145
|
+
- Allowed values: `default`, `__unstable-large`
|
|
151
146
|
|
|
152
147
|
### `value`: `Object`
|
|
153
148
|
|
|
@@ -158,6 +153,7 @@ properties or a "split" border which defines the previous properties but for
|
|
|
158
153
|
each side; `top`, `right`, `bottom`, and `left`.
|
|
159
154
|
|
|
160
155
|
Examples:
|
|
156
|
+
|
|
161
157
|
```js
|
|
162
158
|
const flatBorder = { color: '#72aee6', style: 'solid', width: '1px' };
|
|
163
159
|
const splitBorders = {
|
|
@@ -168,11 +164,11 @@ const splitBorders = {
|
|
|
168
164
|
};
|
|
169
165
|
```
|
|
170
166
|
|
|
171
|
-
-
|
|
167
|
+
- Required: No
|
|
172
168
|
|
|
173
169
|
### `__next40pxDefaultSize`: `boolean`
|
|
174
170
|
|
|
175
171
|
Start opting into the larger default height that will become the default size in a future version.
|
|
176
172
|
|
|
177
|
-
-
|
|
178
|
-
-
|
|
173
|
+
- Required: No
|
|
174
|
+
- Default: `false`
|
|
@@ -147,22 +147,11 @@ const UnconnectedBorderBoxControl = (
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* The second, a "split" view, contains a `BorderControl` for each side
|
|
153
|
-
* as well as a visualizer for the currently selected borders. Each view also
|
|
154
|
-
* contains a button to toggle between the two.
|
|
155
|
-
*
|
|
156
|
-
* When switching from the "split" view to "linked", if the individual side
|
|
157
|
-
* borders are not consistent, the "linked" view will display any border
|
|
158
|
-
* properties selections that are consistent while showing a mixed state for
|
|
159
|
-
* those that aren't. For example, if all borders had the same color and style
|
|
160
|
-
* but different widths, then the border dropdown in the "linked" view's
|
|
161
|
-
* `BorderControl` would show that consistent color and style but the "linked"
|
|
162
|
-
* view's width input would show "Mixed" placeholder text.
|
|
150
|
+
* An input control for the color, style, and width of the border of a box. The
|
|
151
|
+
* border can be customized as a whole, or individually for each side of the box.
|
|
163
152
|
*
|
|
164
153
|
* ```jsx
|
|
165
|
-
* import {
|
|
154
|
+
* import { BorderBoxControl } from '@wordpress/components';
|
|
166
155
|
* import { __ } from '@wordpress/i18n';
|
|
167
156
|
*
|
|
168
157
|
* const colors = [
|
|
@@ -16,7 +16,7 @@ import Button from '../../button';
|
|
|
16
16
|
import { BorderBoxControl } from '../';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof BorderBoxControl > = {
|
|
19
|
-
title: 'Components
|
|
19
|
+
title: 'Components/BorderBoxControl',
|
|
20
20
|
component: BorderBoxControl,
|
|
21
21
|
argTypes: {
|
|
22
22
|
onChange: { action: 'onChange' },
|
|
@@ -83,4 +83,5 @@ export const Default = Template.bind( {} );
|
|
|
83
83
|
Default.args = {
|
|
84
84
|
colors,
|
|
85
85
|
label: 'Borders',
|
|
86
|
+
enableStyle: true,
|
|
86
87
|
};
|