@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","keyframes","
|
|
1
|
+
{"version":3,"names":["css","keyframes","navigatorWrapper","process","env","NODE_ENV","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","fadeIn","from","opacity","fadeOut","to","slideFromRight","transform","slideToLeft","slideFromLeft","slideToRight","FADE","DURATION","EASING","DELAY","IN","OUT","SLIDE","TOTAL_ANIMATION_DURATION","Math","max","ANIMATION_END_NAMES","end","in","out","start","ANIMATION","navigatorScreenAnimation","direction","type","navigatorScreen"],"sources":["@wordpress/components/src/navigator/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css, keyframes } from '@emotion/react';\n\nexport const navigatorWrapper = css`\n\tposition: relative;\n\t/* Prevents horizontal overflow while animating screen transitions */\n\toverflow-x: clip;\n\t/*\n\t * Mark this DOM subtree as isolated when it comes to layout calculations,\n\t * providing performance benefits.\n\t */\n\tcontain: layout;\n\n\tdisplay: grid;\n\tgrid-template-columns: 1fr;\n\tgrid-template-rows: 1fr;\n\talign-items: start;\n`;\n\nconst fadeIn = keyframes( {\n\tfrom: {\n\t\topacity: 0,\n\t},\n} );\n\nconst fadeOut = keyframes( {\n\tto: {\n\t\topacity: 0,\n\t},\n} );\n\nexport const slideFromRight = keyframes( {\n\tfrom: {\n\t\ttransform: 'translateX(100px)',\n\t},\n} );\n\nexport const slideToLeft = keyframes( {\n\tto: {\n\t\ttransform: 'translateX(-80px)',\n\t},\n} );\n\nexport const slideFromLeft = keyframes( {\n\tfrom: {\n\t\ttransform: 'translateX(-100px)',\n\t},\n} );\n\nexport const slideToRight = keyframes( {\n\tto: {\n\t\ttransform: 'translateX(80px)',\n\t},\n} );\n\nconst FADE = {\n\tDURATION: 70,\n\tEASING: 'linear',\n\tDELAY: {\n\t\tIN: 70,\n\t\tOUT: 40,\n\t},\n};\nconst SLIDE = {\n\tDURATION: 300,\n\tEASING: 'cubic-bezier(0.33, 0, 0, 1)',\n};\n\nexport const TOTAL_ANIMATION_DURATION = {\n\tIN: Math.max( FADE.DURATION + FADE.DELAY.IN, SLIDE.DURATION ),\n\tOUT: Math.max( FADE.DURATION + FADE.DELAY.OUT, SLIDE.DURATION ),\n};\n\nexport const ANIMATION_END_NAMES = {\n\tend: {\n\t\tin: slideFromRight.name,\n\t\tout: slideToLeft.name,\n\t},\n\tstart: {\n\t\tin: slideFromLeft.name,\n\t\tout: slideToRight.name,\n\t},\n};\n\nconst ANIMATION = {\n\tend: {\n\t\tin: css`\n\t\t\t${ FADE.DURATION }ms ${ FADE.EASING } ${ FADE.DELAY\n\t\t\t\t.IN }ms both ${ fadeIn }, ${ SLIDE.DURATION }ms ${ SLIDE.EASING } both ${ slideFromRight }\n\t\t`,\n\t\tout: css`\n\t\t\t${ FADE.DURATION }ms ${ FADE.EASING } ${ FADE.DELAY\n\t\t\t\t.OUT }ms both ${ fadeOut }, ${ SLIDE.DURATION }ms ${ SLIDE.EASING } both ${ slideToLeft }\n\t\t`,\n\t},\n\tstart: {\n\t\tin: css`\n\t\t\t${ FADE.DURATION }ms ${ FADE.EASING } ${ FADE.DELAY\n\t\t\t\t.IN }ms both ${ fadeIn }, ${ SLIDE.DURATION }ms ${ SLIDE.EASING } both ${ slideFromLeft }\n\t\t`,\n\t\tout: css`\n\t\t\t${ FADE.DURATION }ms ${ FADE.EASING } ${ FADE.DELAY\n\t\t\t\t.OUT }ms both ${ fadeOut }, ${ SLIDE.DURATION }ms ${ SLIDE.EASING } both ${ slideToRight }\n\t\t`,\n\t},\n} as const;\nexport const navigatorScreenAnimation = css`\n\tz-index: 1;\n\n\t&[data-animation-type='out'] {\n\t\tz-index: 0;\n\t}\n\n\t@media not ( prefers-reduced-motion ) {\n\t\t&:not( [data-skip-animation] ) {\n\t\t\t${ ( [ 'start', 'end' ] as const ).map( ( direction ) =>\n\t\t\t\t( [ 'in', 'out' ] as const ).map(\n\t\t\t\t\t( type ) => css`\n\t\t\t\t\t\t&[data-animation-direction='${ direction }'][data-animation-type='${ type }'] {\n\t\t\t\t\t\t\tanimation: ${ ANIMATION[ direction ][ type ] };\n\t\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t)\n\t\t\t) }\n\t\t}\n\t}\n`;\n\nexport const navigatorScreen = css`\n\t/* Ensures horizontal overflow is visually accessible */\n\toverflow-x: auto;\n\t/* In case the root has a height, it should not be exceeded */\n\tmax-height: 100%;\n\tbox-sizing: border-box;\n\n\tposition: relative;\n\n\tgrid-column: 1 / -1;\n\tgrid-row: 1 / -1;\n`;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;AAE/C,OAAO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,CAc5B;AAED,MAAMC,MAAM,GAAGV,SAAS,CAAE;EACzBW,IAAI,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AWH,YAAY,SAAAjB,OAAA,CAAAC,GAAA,CAAAC,QAAA,yCAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAE3F;AACD,CAAU;AACV,OAAO,MAAMgC,wBAAwB,gBAAGrC,GAAG,4HASnC,CAAE,OAAO,EAAE,KAAK,CAAE,CAAYQ,GAAG,CAAI8B,SAAS,IAChD,CAAE,IAAI,EAAE,KAAK,CAAE,CAAY9B,GAAG,CAC7B+B,IAAI,iBAAMvC,GAAG,iCACiBsC,SAAS,8BAA6BC,IAAI,mBAC1DH,SAAS,CAAEE,SAAS,CAAE,CAAEC,IAAI,CAAE,UAAApC,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,umJAG/C,CACD,CAAC,WAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,umJAGH;AAED,OAAO,MAAMmC,eAAe,GAAArC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,CAW3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\t/**\n\t * Specify the CSS selector used to restore focus on an given element when\n\t * navigating back. When not provided, the component will attempt to restore\n\t * focus on the element that originated the forward navigation.\n\t */\n\tfocusTargetSelector?: string;\n\t/**\n\t * Whether the navigation is a backwards navigation. This enables focus\n\t * restoration (when possible), and causes the animation to be backwards.\n\t */\n\tisBack?: boolean;\n\t/**\n\t * Opt out of focus management. Useful when the consumer of the component\n\t * wants to manage focus themselves.\n\t */\n\tskipFocus?: boolean;\n\t/**\n\t * Note: this option is deprecated and currently doesn't have any effect.\n\t * @deprecated\n\t * @ignore\n\t */\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\t/**\n\t * Whether the current location is the initial one (ie. first in the stack).\n\t */\n\tisInitial?: boolean;\n\t/**\n\t * The path associated to the location.\n\t */\n\tpath?: string;\n\t/**\n\t * Whether focus was already restored for this location (in case of\n\t * backwards navigation).\n\t */\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\t/**\n\t * The current location.\n\t */\n\tlocation: NavigatorLocation;\n\t/**\n\t * Params associated with the current location\n\t */\n\tparams: MatchParams;\n\t/**\n\t * Navigate to a new location.\n\t */\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\t/**\n\t * Go back to the parent location (ie. \"/some/path\" will navigate back\n\t * to \"/some\")\n\t */\n\tgoBack: ( options?: NavigateToParentOptions ) => void;\n\t/**\n\t * _Note: This function is deprecated. Please use `goBack` instead._\n\t * @deprecated\n\t * @ignore\n\t */\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\t/**\n\t * Specify the CSS selector used to restore focus on an given element when\n\t * navigating back. When not provided, the component will attempt to restore\n\t * focus on the element that originated the forward navigation.\n\t */\n\tfocusTargetSelector?: string;\n\t/**\n\t * Whether the navigation is a backwards navigation. This enables focus\n\t * restoration (when possible), and causes the animation to be backwards.\n\t */\n\tisBack?: boolean;\n\t/**\n\t * Opt out of focus management. Useful when the consumer of the component\n\t * wants to manage focus themselves.\n\t */\n\tskipFocus?: boolean;\n\t/**\n\t * Note: this option is deprecated and currently doesn't have any effect.\n\t * @deprecated\n\t * @ignore\n\t */\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\t/**\n\t * Whether the current location is the initial one (ie. first in the stack).\n\t */\n\tisInitial?: boolean;\n\t/**\n\t * The path associated to the location.\n\t */\n\tpath?: string;\n\t/**\n\t * Whether focus was already restored for this location (in case of\n\t * backwards navigation).\n\t */\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\t/**\n\t * The current location.\n\t */\n\tlocation: NavigatorLocation;\n\t/**\n\t * Params associated with the current location\n\t */\n\tparams: MatchParams;\n\t/**\n\t * Navigate to a new location.\n\t */\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\t/**\n\t * Go back to the parent location (ie. \"/some/path\" will navigate back\n\t * to \"/some\")\n\t */\n\tgoBack: ( options?: NavigateToParentOptions ) => void;\n\t/**\n\t * _Note: This function is deprecated. Please use `goBack` instead._\n\t * @deprecated\n\t * @ignore\n\t */\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type NavigatorProps = {\n\t/**\n\t * The initial active path.\n\t */\n\tinitialPath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorScreenProps = {\n\t/**\n\t * The screen's path, matched against the current path stored in the navigator.\n\t *\n\t * `Navigator` assumes that screens are organized hierarchically according\n\t * to their `path`, which should follow a URL-like scheme where each path\n\t * segment starts with and is separated by the `/` character.\n\t *\n\t * `Navigator` will treat \"back\" navigations as going to the parent screen —\n\t * it is, therefore, the responsibility of the consumer of the component to\n\t * create the correct screen hierarchy.\n\t *\n\t * For example:\n\t * - `/` is the root of all paths. There should always be a screen with\n\t * `path=\"/\"`;\n\t * - `/parent/child` is a child of `/parent`;\n\t * - `/parent/child/grand-child` is a child of `/parent/child`;\n\t * - `/parent/:param` is a child of `/parent` as well;\n\t * - if the current screen has a `path=\"/parent/child/grand-child\"`, when\n\t * going \"back\" `Navigator` will try to recursively navigate the path\n\t * hierarchy until a matching screen (or the root `/`) is found.\n\t */\n\tpath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorBackButtonProps = ButtonAsButtonProps;\n\nexport type NavigatorToParentButtonProps = NavigatorBackButtonProps;\n\nexport type NavigatorButtonProps = NavigatorBackButtonProps & {\n\t/**\n\t * The path of the screen to navigate to. The value of this prop needs to be\n\t * a valid value for an HTML attribute.\n\t */\n\tpath: string;\n\t/**\n\t * The HTML attribute used to identify the `NavigatorButton`, which is used\n\t * by `Navigator` to restore focus.\n\t *\n\t * @default 'id'\n\t */\n\tattributeName?: string;\n};\n\nexport type Screen = {\n\tid: string;\n\tpath: string;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -8,7 +8,10 @@ import { useContext } from '@wordpress/element';
|
|
|
8
8
|
*/
|
|
9
9
|
import { NavigatorContext } from './context';
|
|
10
10
|
/**
|
|
11
|
-
* Retrieves a `navigator` instance.
|
|
11
|
+
* Retrieves a `navigator` instance. This hook provides advanced functionality,
|
|
12
|
+
* such as imperatively navigating to a new location (with options like
|
|
13
|
+
* navigating back or skipping focus restoration) and accessing the current
|
|
14
|
+
* location and path parameters.
|
|
12
15
|
*/
|
|
13
16
|
export function useNavigator() {
|
|
14
17
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","NavigatorContext","useNavigator","location","params","goTo","goBack","goToParent"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance.\n */\nexport function useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,WAAW;AAG5C;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAc;EACzC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnDP,UAAU,CAAEC,gBAAiB,CAAC;EAE/B,OAAO;IACNE,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useContext","NavigatorContext","useNavigator","location","params","goTo","goBack","goToParent"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance. This hook provides advanced functionality,\n * such as imperatively navigating to a new location (with options like\n * navigating back or skipping focus restoration) and accessing the current\n * location and path parameters.\n */\nexport function useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,WAAW;AAG5C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAc;EACzC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnDP,UAAU,CAAEC,gBAAiB,CAAC;EAE/B,OAAO;IACNE,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -54,7 +54,10 @@ function UnforwardedSearchControl({
|
|
|
54
54
|
}, forwardedRef) {
|
|
55
55
|
// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.
|
|
56
56
|
// Work with the design team (@WordPress/gutenberg-design) if you need this feature.
|
|
57
|
-
|
|
57
|
+
const {
|
|
58
|
+
disabled,
|
|
59
|
+
...filteredRestProps
|
|
60
|
+
} = restProps;
|
|
58
61
|
const searchRef = useRef(null);
|
|
59
62
|
const instanceId = useInstanceId(SearchControl, 'components-search-control');
|
|
60
63
|
const contextValue = useMemo(() => ({
|
|
@@ -96,7 +99,7 @@ function UnforwardedSearchControl({
|
|
|
96
99
|
onClose: onClose
|
|
97
100
|
})
|
|
98
101
|
}),
|
|
99
|
-
...
|
|
102
|
+
...filteredRestProps
|
|
100
103
|
})
|
|
101
104
|
});
|
|
102
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\
|
|
1
|
+
{"version":3,"names":["clsx","useInstanceId","useMergeRefs","__","Icon","search","closeSmall","forwardRef","useMemo","useRef","Button","ContextSystemProvider","StyledInputControl","SuffixItemWrapper","jsx","_jsx","SuffixItem","searchRef","value","onChange","onClose","icon","onReset","current","focus","size","label","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","instanceId","SearchControl","contextValue","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","children","__next40pxDefaultSize","id","ref","type","nextValue","autoComplete","suffix"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatibile margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,EAAEC,UAAU,QAAQ,kBAAkB;AAC3D,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAI9B,SAASC,qBAAqB,QAAQ,YAAY;AAClD,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,SAASC,UAAUA,CAAE;EACpBC,SAAS;EACTC,KAAK;EACLC,QAAQ;EACRC;AACgB,CAAC,EAAG;E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ACjC,CAAC,CAAE,EACH,CAAEf,uBAAuB,CAC1B,CAAC;EAED,oBACCd,IAAA,CAACJ,qBAAqB;IAACO,KAAK,EAAGqB,YAAc;IAAAM,QAAA,eAC5C9B,IAAA,CAACH,kBAAkB;MAClBkC,qBAAqB;MACrBC,EAAE,EAAGV,UAAY;MACjBL,mBAAmB,EAAGA,mBAAqB;MAC3CN,KAAK,EAAGA,KAAO;MACfsB,GAAG,EAAG9C,YAAY,CAAE,CAAEe,SAAS,EAAEiB,YAAY,CAAG,CAAG;MACnDe,IAAI,EAAC,QAAQ;MACbxB,IAAI,EAAGA,IAAM;MACbK,SAAS,EAAG9B,IAAI,CAAE,2BAA2B,EAAE8B,SAAU,CAAG;MAC5DX,QAAQ,EAAK+B,SAAkB,IAC9B/B,QAAQ,CAAE+B,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAG,CAC1B;MACDC,YAAY,EAAC,KAAK;MAClBpB,WAAW,EAAGA,WAAa;MAC3Bb,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAI;MACrBkC,MAAM,eACLrC,IAAA,CAACF,iBAAiB;QAACY,IAAI,EAAGA,IAAM;QAAAoB,QAAA,eAC/B9B,IAAA,CAACC,UAAU;UACVC,SAAS,EAAGA,SAAW;UACvBC,KAAK,EAAGA,KAAO;UACfC,QAAQ,EAAGA,QAAU;UACrBC,OAAO,EAAGA;QAAS,CACnB;MAAC,CACgB,CACnB;MAAA,GACIgB;IAAiB,CACtB;EAAC,CACoB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,GAAG/B,UAAU,CAAEqB,wBAAyB,CAAC;AAEnE,eAAeU,aAAa","ignoreList":[]}
|
|
@@ -15,17 +15,17 @@ export const TabListWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV =
|
|
|
15
15
|
} : {
|
|
16
16
|
target: "enfox0g2",
|
|
17
17
|
label: "TabListWrapper"
|
|
18
|
-
})("position:relative;display:flex;align-items:stretch;flex-direction:row;text-align:center;&[aria-orientation='vertical']{flex-direction:column;text-align:start;}
|
|
18
|
+
})("position:relative;display:flex;align-items:stretch;flex-direction:row;text-align:center;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;text-align:start;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--indicator-start:var( --indicator-left );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--indicator-start:var( --indicator-right );}@media not ( prefers-reduced-motion ){&.is-animation-enabled::before{transition-property:transform;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&:not( [aria-orientation='vertical'] ){--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-width ) / var( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";}}&[aria-orientation='vertical']::before{top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --indicator-top ) * 1px ) ) scaleY(\n\t\t\t\tcalc( var( --indicator-height ) / var( --antialiasing-factor ) )\n\t\t\t);background-color:", COLORS.theme.gray[100], ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWXdDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgKiBhcyBBcmlha2l0IGZyb20gJ0Bhcmlha2l0L3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ09MT1JTLCBDT05GSUcgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy4uL3V0aWxzL3NwYWNlJztcblxuZXhwb3J0IGNvbnN0IFRhYkxpc3RXcmFwcGVyID0gc3R5bGVkLmRpdmBcblx0cG9zaXRpb246IHJlbGF0aXZlO1xuXHRkaXNwbGF5OiBmbGV4O1xuXHRhbGlnbi1pdGVtczogc3RyZXRjaDtcblx0ZmxleC1kaXJlY3Rpb246IHJvdztcblx0dGV4dC1hbGlnbjogY2VudGVyO1xuXHRvdmVyZmxvdy14OiBhdXRvO1xuXG5cdCZbYXJpYS1vcm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gfTtcblx0XHQvLyBXaW5kb3dzIGhpZ2ggY29udHJhc3QgbW9kZS5cblx0XHRvdXRsaW5lOiAycHggc29saWQgdHJhbnNwYXJlbnQ7XG5cdFx0b3V0bGluZS1vZmZzZXQ6IDA7XG5cdH1cbmA7XG4iXX0= */"));
|
|
19
19
|
export const Tab = /*#__PURE__*/_styled(Ariakit.Tab, process.env.NODE_ENV === "production" ? {
|
|
20
20
|
target: "enfox0g1"
|
|
21
21
|
} : {
|
|
22
22
|
target: "enfox0g1",
|
|
23
23
|
label: "Tab"
|
|
24
|
-
})("&{display:inline-flex;align-items:center;position:relative;border-radius:0;
|
|
24
|
+
})("&{scroll-margin:24px;flex-grow:1;flex-shrink:0;display:inline-flex;align-items:center;position:relative;border-radius:0;height:", space(12), ";background:transparent;border:none;box-shadow:none;cursor:pointer;line-height:1.2;padding:", space(4), ";margin-left:0;font-weight:500;text-align:inherit;color:", COLORS.theme.foreground, ";&[aria-disabled='true']{cursor:default;color:", COLORS.ui.textDisabled, ";}&:not( [aria-disabled='true'] ):hover{color:", COLORS.theme.accent, ";}&:focus:not( :disabled ){position:relative;box-shadow:none;outline:none;}&::after{content:'';position:absolute;top:", space(3), ";right:", space(3), ";bottom:", space(3), ";left:", space(3), ";pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ", COLORS.theme.accent, ";border-radius:", CONFIG.radiusSmall, ";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&:focus-visible::after{opacity:1;}}[aria-orientation='vertical'] &{min-height:", space(10), ";}[aria-orientation='horizontal'] &{justify-content:center;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0h3QyIsImZpbGUiOiJAd29yZHByZXNzL2NvbX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llbnRhdGlvbj0ndmVydGljYWwnXSAmIHtcblx0XHRtaW4taGVpZ2h0OiAkeyBzcGFjZShcblx0XHRcdDEwXG5cdFx0KSB9OyAvLyBBdm9pZCBmaXhlZCBoZWlnaHQgdG8gYWxsb3cgZm9yIGxvbmcgc3RyaW5ncyB0aGF0IGdvIGluIG11bHRpcGxlIGxpbmVzLlxuXHR9XG5cblx0W2FyaWEtb3JpZW50YXRpb249J2hvcml6b250YWwnXSAmIHtcblx0XHRqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IFRhYlBhbmVsID0gc3R5bGVkKCBBcmlha2l0LlRhYlBhbmVsIClgXG5cdCY6Zm9jdXMge1xuXHRcdGJveC1zaGFkb3c6IG5vbmU7XG5cdFx0b3V0bGluZTogbm9uZTtcblx0fVxuXG5cdCY6Zm9jdXMtdmlzaWJsZSB7XG5cdFx0Ym94LXNoYWRvdzogMCAwIDAgdmFyKCAtLXdwLWFkbWluLWJvcmRlci13aWR0aC1mb2N1cyApXG5cdFx0XHQkeyBDT0xPUlMudGhlbWUuYWNjZW50IH07XG5cdFx0Ly8gV2luZG93cyBoaWdoIGNvbnRyYXN0IG1vZGUuXG5cdFx0b3V0bGluZTogMnB4IHNvbGlkIHRyYW5zcGFyZW50O1xuXHRcdG91dGxpbmUtb2Zmc2V0OiAwO1xuXHR9XG5gO1xuIl19 */"));
|
|
25
25
|
export const TabPanel = /*#__PURE__*/_styled(Ariakit.TabPanel, process.env.NODE_ENV === "production" ? {
|
|
26
26
|
target: "enfox0g0"
|
|
27
27
|
} : {
|
|
28
28
|
target: "enfox0g0",
|
|
29
29
|
label: "TabPanel"
|
|
30
|
-
})("&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
30
|
+
})("&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;outline-offset:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa01rRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RhYnMvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0ICogYXMgQXJpYWtpdCBmcm9tICdAYXJpYWtpdC9yZWFjdCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IENPTE9SUywgQ09ORklHIH0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IHsgc3BhY2UgfSBmcm9tICcuLi91dGlscy9zcGFjZSc7XG5cbmV4cG9ydCBjb25zdCBUYWJMaXN0V3JhcHBlciA9IHN0eWxlZC5kaXZgXG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcblx0ZGlzcGxheTogZmxleDtcblx0YWxpZ24taXRlbXM6IHN0cmV0Y2g7XG5cdGZsZXgtZGlyZWN0aW9uOiByb3c7XG5cdHRleHQtYWxpZ246IGNlbnRlcjtcblx0b3ZlcmZsb3cteDogYXV0bztcblxuXHQmW2FyaWEtb3JpZW50YXRpb249J3ZlcnRpY2FsJ10ge1xuXHRcdGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG5cdFx0dGV4dC1hbGlnbjogc3Rhcn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0OiAwO1xuXHR9XG5gO1xuIl19 */"));
|
|
31
31
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","COLORS","CONFIG","space","TabListWrapper","_styled","process","env","NODE_ENV","target","label","theme","accent","gray","Tab","foreground","ui","textDisabled","radiusSmall","TabPanel"],"sources":["@wordpress/components/src/tabs/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\n\nexport const TabListWrapper = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tflex-direction: row;\n\ttext-align: center;\n\n\t&[aria-orientation='vertical'] {\n\t\tflex-direction: column;\n\t\ttext-align: start;\n\t}\n\n\t
|
|
1
|
+
{"version":3,"names":["Ariakit","COLORS","CONFIG","space","TabListWrapper","_styled","process","env","NODE_ENV","target","label","theme","accent","gray","Tab","foreground","ui","textDisabled","radiusSmall","TabPanel"],"sources":["@wordpress/components/src/tabs/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\n\nexport const TabListWrapper = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: stretch;\n\tflex-direction: row;\n\ttext-align: center;\n\toverflow-x: auto;\n\n\t&[aria-orientation='vertical'] {\n\t\tflex-direction: column;\n\t\ttext-align: start;\n\t}\n\n\t:where( [aria-orientation='horizontal'] ) {\n\t\twidth: fit-content;\n\t}\n\n\t--direction-factor: 1;\n\t--direction-start: left;\n\t--direction-end: right;\n\t--indicator-start: var( --indicator-left );\n\t&:dir( rtl ) {\n\t\t--direction-factor: -1;\n\t\t--direction-start: right;\n\t\t--direction-end: left;\n\t\t--indicator-start: var( --indicator-right );\n\t}\n\n\t@media not ( prefers-reduced-motion ) {\n\t\t&.is-animation-enabled::before {\n\t\t\ttransition-property: transform;\n\t\t\ttransition-duration: 0.2s;\n\t\t\ttransition-timing-function: ease-out;\n\t\t}\n\t}\n\t&::before {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tpointer-events: none;\n\t\ttransform-origin: var( --direction-start ) top;\n\n\t\t// Windows high contrast mode.\n\t\toutline: 2px solid transparent;\n\t\toutline-offset: -1px;\n\t}\n\n\t/* Using a large value to avoid antialiasing rounding issues\n\t\t\twhen scaling in the transform, see: https://stackoverflow.com/a/52159123 */\n\t--antialiasing-factor: 100;\n\t&:not( [aria-orientation='vertical'] ) {\n\t\t--fade-width: 4rem;\n\t\t--fade-gradient-base: transparent 0%, black var( --fade-width );\n\t\t--fade-gradient-composed: var( --fade-gradient-base ), black 60%,\n\t\t\ttransparent 50%;\n\t\t&.is-overflowing-first {\n\t\t\tmask-image: linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);\n\t\t}\n\t\t&.is-overflowing-last {\n\t\t\tmask-image: linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);\n\t\t}\n\t\t&.is-overflowing-first.is-overflowing-last {\n\t\t\tmask-image: linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),\n\t\t\t\tlinear-gradient( to left, var( --fade-gradient-composed ) );\n\t\t}\n\n\t\t&::before {\n\t\t\tbottom: 0;\n\t\t\theight: 0;\n\t\t\twidth: calc( var( --antialiasing-factor ) * 1px );\n\t\t\ttransform: translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\tscaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --indicator-width ) / var( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tborder-bottom: var( --wp-admin-border-width-focus ) solid\n\t\t\t\t${ COLORS.theme.accent };\n\t\t}\n\t}\n\t&[aria-orientation='vertical']::before {\n\t\ttop: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: calc( var( --antialiasing-factor ) * 1px );\n\t\ttransform: translateY( calc( var( --indicator-top ) * 1px ) )\n\t\t\tscaleY(\n\t\t\t\tcalc( var( --indicator-height ) / var( --antialiasing-factor ) )\n\t\t\t);\n\t\tbackground-color: ${ COLORS.theme.gray[ 100 ] };\n\t}\n`;\n\nexport const Tab = styled( Ariakit.Tab )`\n\t& {\n\t\tscroll-margin: 24px;\n\t\tflex-grow: 1;\n\t\tflex-shrink: 0;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tposition: relative;\n\t\tborder-radius: 0;\n\t\theight: ${ space( 12 ) };\n\t\tbackground: transparent;\n\t\tborder: none;\n\t\tbox-shadow: none;\n\t\tcursor: pointer;\n\t\tline-height: 1.2; // Some languages characters e.g. Japanese may have a native higher line-height.\n\t\tpadding: ${ space( 4 ) };\n\t\tmargin-left: 0;\n\t\tfont-weight: 500;\n\t\ttext-align: inherit;\n\t\tcolor: ${ COLORS.theme.foreground };\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: default;\n\t\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\t}\n\n\t\t&:not( [aria-disabled='true'] ):hover {\n\t\t\tcolor: ${ COLORS.theme.accent };\n\t\t}\n\n\t\t&:focus:not( :disabled ) {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: none;\n\t\t\toutline: none;\n\t\t}\n\n\t\t// Focus.\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: ${ space( 3 ) };\n\t\t\tright: ${ space( 3 ) };\n\t\t\tbottom: ${ space( 3 ) };\n\t\t\tleft: ${ space( 3 ) };\n\t\t\tpointer-events: none;\n\n\t\t\t// Draw the indicator.\n\t\t\t// Outline works for Windows high contrast mode as well.\n\t\t\toutline: var( --wp-admin-border-width-focus ) solid\n\t\t\t\t${ COLORS.theme.accent };\n\t\t\tborder-radius: ${ CONFIG.radiusSmall };\n\n\t\t\t// Animation\n\t\t\topacity: 0;\n\n\t\t\t@media not ( prefers-reduced-motion ) {\n\t\t\t\ttransition: opacity 0.1s linear;\n\t\t\t}\n\t\t}\n\n\t\t&:focus-visible::after {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t[aria-orientation='vertical'] & {\n\t\tmin-height: ${ space(\n\t\t\t10\n\t\t) }; // Avoid fixed height to allow for long strings that go in multiple lines.\n\t}\n\n\t[aria-orientation='horizontal'] & {\n\t\tjustify-content: center;\n\t}\n`;\n\nexport const TabPanel = styled( Ariakit.TabPanel )`\n\t&:focus {\n\t\tbox-shadow: none;\n\t\toutline: none;\n\t}\n\n\t&:focus-visible {\n\t\tbox-shadow: 0 0 0 var( --wp-admin-border-width-focus )\n\t\t\t${ COLORS.theme.accent };\n\t\t// Windows high contrast mode.\n\t\toutline: 2px solid transparent;\n\t\toutline-offset: 0;\n\t}\n`;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,QAAQ,UAAU;AACzC,SAASC,KAAK,QAAQ,gBAAgB;AAEtC,OAAO,MAAMC,cAAc,gBAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,u2DA0FpBT,MAAM,CAACU,KAAK,CAACC,MAAM,mSAYHX,MAAM,CAACU,KAAK,CAACE,IAAI,CAAE,GAAG,CAAE,UAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA,wzOAE9C;AAED,OAAO,MAAMM,GAAG,gBAAGT,OAAA,CAAQL,OAAO,CAACc,GAAG,EAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,oIAS3BP,KAAK,CAAE,EAAG,CAAC,iGAMVA,KAAK,CAAE,CAAE,CAAC,8DAIZF,MAAM,CAACU,KAAK,CAACI,UAAU,oDAItBd,MAAM,CAACe,EAAE,CAACC,YAAY,oDAItBhB,MAAM,CAACU,KAAK,CAACC,MAAM,2HAarBT,KAAK,CAAE,CAAE,CAAC,aACRA,KAAK,CAAE,CAAE,CAAC,cACTA,KAAK,CAAE,CAAE,CAAC,YACZA,KAAK,CAAE,CAAE,CAAC,8EAMfF,MAAM,CAACU,KAAK,CAACC,MAAM,qBACLV,MAAM,CAACgB,WAAW,sKAgBtBf,KAAK,CACnB,EACD,CAAC,oEAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,wzOAMF;AAED,OAAO,MAAMW,QAAQ,gBAAGd,OAAA,CAAQL,OAAO,CAACmB,QAAQ,EAAAb,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,iHAQ5CT,MAAM,CAACU,KAAK,CAACC,MAAM,yDAAAN,OAAA,CAAAC,GAAA,CAAAC,QAAA,wzOAKxB","ignoreList":[]}
|
|
@@ -8,7 +8,8 @@ import { useStoreState } from '@ariakit/react';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import warning from '@wordpress/warning';
|
|
11
|
-
import { forwardRef, useState } from '@wordpress/element';
|
|
11
|
+
import { forwardRef, useLayoutEffect, useState } from '@wordpress/element';
|
|
12
|
+
import { useMergeRefs } from '@wordpress/compose';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -19,33 +20,60 @@ import { TabListWrapper } from './styles';
|
|
|
19
20
|
import clsx from 'clsx';
|
|
20
21
|
import { useTrackElementOffsetRect } from '../utils/element-rect';
|
|
21
22
|
import { useOnValueUpdate } from '../utils/hooks/use-on-value-update';
|
|
23
|
+
import { useTrackOverflow } from './use-track-overflow';
|
|
22
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const SCROLL_MARGIN = 24;
|
|
23
26
|
export const TabList = forwardRef(function TabList({
|
|
24
27
|
children,
|
|
25
28
|
...otherProps
|
|
26
29
|
}, ref) {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var _useTabsContext;
|
|
31
|
+
const {
|
|
32
|
+
store
|
|
33
|
+
} = (_useTabsContext = useTabsContext()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
|
|
34
|
+
const selectedId = useStoreState(store, 'selectedId');
|
|
35
|
+
const activeId = useStoreState(store, 'activeId');
|
|
36
|
+
const selectOnMove = useStoreState(store, 'selectOnMove');
|
|
37
|
+
const items = useStoreState(store, 'items');
|
|
38
|
+
const [parent, setParent] = useState();
|
|
39
|
+
const refs = useMergeRefs([ref, setParent]);
|
|
40
|
+
const overflow = useTrackOverflow(parent, {
|
|
41
|
+
first: items?.at(0)?.element,
|
|
42
|
+
last: items?.at(-1)?.element
|
|
43
|
+
});
|
|
44
|
+
const selectedTabPosition = useTrackElementOffsetRect(store?.item(selectedId)?.element);
|
|
31
45
|
const [animationEnabled, setAnimationEnabled] = useState(false);
|
|
32
46
|
useOnValueUpdate(selectedId, ({
|
|
33
47
|
previousValue
|
|
34
|
-
}) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
}) => {
|
|
49
|
+
if (previousValue) {
|
|
50
|
+
setAnimationEnabled(true);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Make sure selected tab is scrolled into view.
|
|
55
|
+
useLayoutEffect(() => {
|
|
56
|
+
if (!parent || !selectedTabPosition) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const {
|
|
60
|
+
scrollLeft: parentScroll
|
|
61
|
+
} = parent;
|
|
62
|
+
const parentWidth = parent.getBoundingClientRect().width;
|
|
63
|
+
const {
|
|
64
|
+
left: childLeft,
|
|
65
|
+
width: childWidth
|
|
66
|
+
} = selectedTabPosition;
|
|
67
|
+
const parentRightEdge = parentScroll + parentWidth;
|
|
68
|
+
const childRightEdge = childLeft + childWidth;
|
|
69
|
+
const rightOverflow = childRightEdge + SCROLL_MARGIN - parentRightEdge;
|
|
70
|
+
const leftOverflow = parentScroll - (childLeft - SCROLL_MARGIN);
|
|
71
|
+
if (leftOverflow > 0) {
|
|
72
|
+
parent.scrollLeft = parentScroll - leftOverflow;
|
|
73
|
+
} else if (rightOverflow > 0) {
|
|
74
|
+
parent.scrollLeft = parentScroll + rightOverflow;
|
|
75
|
+
}
|
|
76
|
+
}, [parent, selectedTabPosition]);
|
|
49
77
|
const onBlur = () => {
|
|
50
78
|
if (!selectOnMove) {
|
|
51
79
|
return;
|
|
@@ -56,30 +84,35 @@ export const TabList = forwardRef(function TabList({
|
|
|
56
84
|
// that the selected tab will receive keyboard focus when tabbing back into
|
|
57
85
|
// the tablist.
|
|
58
86
|
if (selectedId !== activeId) {
|
|
59
|
-
setActiveId(selectedId);
|
|
87
|
+
store?.setActiveId(selectedId);
|
|
60
88
|
}
|
|
61
89
|
};
|
|
90
|
+
if (!store) {
|
|
91
|
+
globalThis.SCRIPT_DEBUG === true ? warning('`Tabs.TabList` must be wrapped in a `Tabs` component.') : void 0;
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
62
94
|
return /*#__PURE__*/_jsx(Ariakit.TabList, {
|
|
63
|
-
ref:
|
|
95
|
+
ref: refs,
|
|
64
96
|
store: store,
|
|
65
97
|
render: /*#__PURE__*/_jsx(TabListWrapper, {
|
|
66
98
|
onTransitionEnd: event => {
|
|
67
|
-
if (event.pseudoElement === '::
|
|
99
|
+
if (event.pseudoElement === '::before') {
|
|
68
100
|
setAnimationEnabled(false);
|
|
69
101
|
}
|
|
70
102
|
}
|
|
71
103
|
}),
|
|
72
104
|
onBlur: onBlur,
|
|
105
|
+
tabIndex: -1,
|
|
73
106
|
...otherProps,
|
|
74
107
|
style: {
|
|
75
|
-
'--indicator-top':
|
|
76
|
-
'--indicator-right':
|
|
77
|
-
'--indicator-left':
|
|
78
|
-
'--indicator-width':
|
|
79
|
-
'--indicator-height':
|
|
108
|
+
'--indicator-top': selectedTabPosition.top,
|
|
109
|
+
'--indicator-right': selectedTabPosition.right,
|
|
110
|
+
'--indicator-left': selectedTabPosition.left,
|
|
111
|
+
'--indicator-width': selectedTabPosition.width,
|
|
112
|
+
'--indicator-height': selectedTabPosition.height,
|
|
80
113
|
...otherProps.style
|
|
81
114
|
},
|
|
82
|
-
className: clsx(
|
|
115
|
+
className: clsx(overflow.first && 'is-overflowing-first', overflow.last && 'is-overflowing-last', animationEnabled && 'is-animation-enabled', otherProps.className),
|
|
83
116
|
children: children
|
|
84
117
|
});
|
|
85
118
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","useStoreState","warning","forwardRef","useState","useTabsContext","TabListWrapper","clsx","useTrackElementOffsetRect","useOnValueUpdate","jsx","_jsx","TabList","children","otherProps","ref","
|
|
1
|
+
{"version":3,"names":["Ariakit","useStoreState","warning","forwardRef","useLayoutEffect","useState","useMergeRefs","useTabsContext","TabListWrapper","clsx","useTrackElementOffsetRect","useOnValueUpdate","useTrackOverflow","jsx","_jsx","SCROLL_MARGIN","TabList","children","otherProps","ref","_useTabsContext","store","selectedId","activeId","selectOnMove","items","parent","setParent","refs","overflow","first","at","element","last","selectedTabPosition","item","animationEnabled","setAnimationEnabled","previousValue","scrollLeft","parentScroll","parentWidth","getBoundingClientRect","width","left","childLeft","childWidth","parentRightEdge","childRightEdge","rightOverflow","leftOverflow","onBlur","setActiveId","globalThis","SCRIPT_DEBUG","render","onTransitionEnd","event","pseudoElement","tabIndex","style","top","right","height","className"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef, useLayoutEffect, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport { useTabsContext } from './context';\nimport { TabListWrapper } from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport clsx from 'clsx';\nimport { useTrackElementOffsetRect } from '../utils/element-rect';\nimport { useOnValueUpdate } from '../utils/hooks/use-on-value-update';\nimport { useTrackOverflow } from './use-track-overflow';\n\nconst SCROLL_MARGIN = 24;\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst { store } = useTabsContext() ?? {};\n\n\tconst selectedId = useStoreState( store, 'selectedId' );\n\tconst activeId = useStoreState( store, 'activeId' );\n\tconst selectOnMove = useStoreState( store, 'selectOnMove' );\n\tconst items = useStoreState( store, 'items' );\n\tconst [ parent, setParent ] = useState< HTMLElement | null >();\n\tconst refs = useMergeRefs( [ ref, setParent ] );\n\tconst overflow = useTrackOverflow( parent, {\n\t\tfirst: items?.at( 0 )?.element,\n\t\tlast: items?.at( -1 )?.element,\n\t} );\n\n\tconst selectedTabPosition = useTrackElementOffsetRect(\n\t\tstore?.item( selectedId )?.element\n\t);\n\n\tconst [ animationEnabled, setAnimationEnabled ] = useState( false );\n\tuseOnValueUpdate( selectedId, ( { previousValue } ) => {\n\t\tif ( previousValue ) {\n\t\t\tsetAnimationEnabled( true );\n\t\t}\n\t} );\n\n\t// Make sure selected tab is scrolled into view.\n\tuseLayoutEffect( () => {\n\t\tif ( ! parent || ! selectedTabPosition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scrollLeft: parentScroll } = parent;\n\t\tconst parentWidth = parent.getBoundingClientRect().width;\n\t\tconst { left: childLeft, width: childWidth } = selectedTabPosition;\n\n\t\tconst parentRightEdge = parentScroll + parentWidth;\n\t\tconst childRightEdge = childLeft + childWidth;\n\t\tconst rightOverflow = childRightEdge + SCROLL_MARGIN - parentRightEdge;\n\t\tconst leftOverflow = parentScroll - ( childLeft - SCROLL_MARGIN );\n\t\tif ( leftOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll - leftOverflow;\n\t\t} else if ( rightOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll + rightOverflow;\n\t\t}\n\t}, [ parent, selectedTabPosition ] );\n\n\tconst onBlur = () => {\n\t\tif ( ! selectOnMove ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When automatic tab selection is on, make sure that the active tab is up\n\t\t// to date with the selected tab when leaving the tablist. This makes sure\n\t\t// that the selected tab will receive keyboard focus when tabbing back into\n\t\t// the tablist.\n\t\tif ( selectedId !== activeId ) {\n\t\t\tstore?.setActiveId( selectedId );\n\t\t}\n\t};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Ariakit.TabList\n\t\t\tref={ refs }\n\t\t\tstore={ store }\n\t\t\trender={\n\t\t\t\t<TabListWrapper\n\t\t\t\t\tonTransitionEnd={ ( event ) => {\n\t\t\t\t\t\tif ( event.pseudoElement === '::before' ) {\n\t\t\t\t\t\t\tsetAnimationEnabled( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonBlur={ onBlur }\n\t\t\ttabIndex={ -1 }\n\t\t\t{ ...otherProps }\n\t\t\tstyle={ {\n\t\t\t\t'--indicator-top': selectedTabPosition.top,\n\t\t\t\t'--indicator-right': selectedTabPosition.right,\n\t\t\t\t'--indicator-left': selectedTabPosition.left,\n\t\t\t\t'--indicator-width': selectedTabPosition.width,\n\t\t\t\t'--indicator-height': selectedTabPosition.height,\n\t\t\t\t...otherProps.style,\n\t\t\t} }\n\t\t\tclassName={ clsx(\n\t\t\t\toverflow.first && 'is-overflowing-first',\n\t\t\t\toverflow.last && 'is-overflowing-last',\n\t\t\t\tanimationEnabled && 'is-animation-enabled',\n\t\t\t\totherProps.className\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.TabList>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,oBAAoB;AAC1E,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;;AAEA,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,cAAc,QAAQ,UAAU;AAEzC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,gBAAgB,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExD,MAAMC,aAAa,GAAG,EAAE;AAExB,OAAO,MAAMC,OAAO,GAAGb,UAAU,CAG9B,SAASa,OAAOA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EAAA,IAAAC,eAAA;EACvD,MAAM;IAAEC;EAAM,CAAC,IAAAD,eAAA,GAAGb,cAAc,CAAC,CAAC,cAAAa,eAAA,cAAAA,eAAA,GAAI,CAAC,CAAC;EAExC,MAAME,UAAU,GAAGrB,aAAa,CAAEoB,KAAK,EAAE,YA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;MAC1C,mBAAmB,EAAE3B,mBAAmB,CAAC4B,KAAK;MAC9C,kBAAkB,EAAE5B,mBAAmB,CAACU,IAAI;MAC5C,mBAAmB,EAAEV,mBAAmB,CAACS,KAAK;MAC9C,oBAAoB,EAAET,mBAAmB,CAAC6B,MAAM;MAChD,GAAG7C,UAAU,CAAC0C;IACf,CAAG;IACHI,SAAS,EAAGvD,IAAI,CACfoB,QAAQ,CAACC,KAAK,IAAI,sBAAsB,EACxCD,QAAQ,CAACI,IAAI,IAAI,qBAAqB,EACtCG,gBAAgB,IAAI,sBAAsB,EAC1ClB,UAAU,CAAC8C,SACZ,CAAG;IAAA/C,QAAA,EAEDA;EAAQ,CACM,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* eslint-disable jsdoc/require-param */
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { useState, useEffect } from '@wordpress/element';
|
|
6
|
+
import { useEvent } from '@wordpress/compose';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tracks if an element contains overflow and on which end by tracking the
|
|
10
|
+
* first and last child elements with an `IntersectionObserver` in relation
|
|
11
|
+
* to the parent element.
|
|
12
|
+
*
|
|
13
|
+
* Note that the returned value will only indicate whether the first or last
|
|
14
|
+
* element is currently "going out of bounds" but not whether it happens on
|
|
15
|
+
* the X or Y axis.
|
|
16
|
+
*/
|
|
17
|
+
export function useTrackOverflow(parent, children) {
|
|
18
|
+
const [first, setFirst] = useState(false);
|
|
19
|
+
const [last, setLast] = useState(false);
|
|
20
|
+
const [observer, setObserver] = useState();
|
|
21
|
+
const callback = useEvent(entries => {
|
|
22
|
+
for (const entry of entries) {
|
|
23
|
+
if (entry.target === children.first) {
|
|
24
|
+
setFirst(!entry.isIntersecting);
|
|
25
|
+
}
|
|
26
|
+
if (entry.target === children.last) {
|
|
27
|
+
setLast(!entry.isIntersecting);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!parent || !window.IntersectionObserver) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const newObserver = new IntersectionObserver(callback, {
|
|
36
|
+
root: parent,
|
|
37
|
+
threshold: 0.9
|
|
38
|
+
});
|
|
39
|
+
setObserver(newObserver);
|
|
40
|
+
return () => newObserver.disconnect();
|
|
41
|
+
}, [callback, parent]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!observer) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (children.first) {
|
|
47
|
+
observer.observe(children.first);
|
|
48
|
+
}
|
|
49
|
+
if (children.last) {
|
|
50
|
+
observer.observe(children.last);
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
if (children.first) {
|
|
54
|
+
observer.unobserve(children.first);
|
|
55
|
+
}
|
|
56
|
+
if (children.last) {
|
|
57
|
+
observer.unobserve(children.last);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}, [children.first, children.last, observer]);
|
|
61
|
+
return {
|
|
62
|
+
first,
|
|
63
|
+
last
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/* eslint-enable jsdoc/require-param */
|
|
67
|
+
//# sourceMappingURL=use-track-overflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useEvent","useTrackOverflow","parent","children","first","setFirst","last","setLast","observer","setObserver","callback","entries","entry","target","isIntersecting","window","IntersectionObserver","newObserver","root","threshold","disconnect","observe","unobserve"],"sources":["@wordpress/components/src/tabs/use-track-overflow.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-param */\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { useEvent } from '@wordpress/compose';\n\n/**\n * Tracks if an element contains overflow and on which end by tracking the\n * first and last child elements with an `IntersectionObserver` in relation\n * to the parent element.\n *\n * Note that the returned value will only indicate whether the first or last\n * element is currently \"going out of bounds\" but not whether it happens on\n * the X or Y axis.\n */\nexport function useTrackOverflow(\n\tparent: HTMLElement | undefined | null,\n\tchildren: {\n\t\tfirst: HTMLElement | undefined | null;\n\t\tlast: HTMLElement | undefined | null;\n\t}\n) {\n\tconst [ first, setFirst ] = useState( false );\n\tconst [ last, setLast ] = useState( false );\n\tconst [ observer, setObserver ] = useState< IntersectionObserver >();\n\n\tconst callback: IntersectionObserverCallback = useEvent( ( entries ) => {\n\t\tfor ( const entry of entries ) {\n\t\t\tif ( entry.target === children.first ) {\n\t\t\t\tsetFirst( ! entry.isIntersecting );\n\t\t\t}\n\t\t\tif ( entry.target === children.last ) {\n\t\t\t\tsetLast( ! entry.isIntersecting );\n\t\t\t}\n\t\t}\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! parent || ! window.IntersectionObserver ) {\n\t\t\treturn;\n\t\t}\n\t\tconst newObserver = new IntersectionObserver( callback, {\n\t\t\troot: parent,\n\t\t\tthreshold: 0.9,\n\t\t} );\n\t\tsetObserver( newObserver );\n\n\t\treturn () => newObserver.disconnect();\n\t}, [ callback, parent ] );\n\n\tuseEffect( () => {\n\t\tif ( ! observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( children.first ) {\n\t\t\tobserver.observe( children.first );\n\t\t}\n\t\tif ( children.last ) {\n\t\t\tobserver.observe( children.last );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( children.first ) {\n\t\t\t\tobserver.unobserve( children.first );\n\t\t\t}\n\t\t\tif ( children.last ) {\n\t\t\t\tobserver.unobserve( children.last );\n\t\t\t}\n\t\t};\n\t}, [ children.first, children.last, observer ] );\n\n\treturn { first, last };\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA;AACA;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ACG,IAAI,EAAG;MACpBE,QAAQ,CAACa,OAAO,CAAElB,QAAQ,CAACG,IAAK,CAAC;IAClC;IAEA,OAAO,MAAM;MACZ,IAAKH,QAAQ,CAACC,KAAK,EAAG;QACrBI,QAAQ,CAACc,SAAS,CAAEnB,QAAQ,CAACC,KAAM,CAAC;MACrC;MACA,IAAKD,QAAQ,CAACG,IAAI,EAAG;QACpBE,QAAQ,CAACc,SAAS,CAAEnB,QAAQ,CAACG,IAAK,CAAC;MACpC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAACC,KAAK,EAAED,QAAQ,CAACG,IAAI,EAAEE,QAAQ,CAAG,CAAC;EAEhD,OAAO;IAAEJ,KAAK;IAAEE;EAAK,CAAC;AACvB;AACA","ignoreList":[]}
|
|
@@ -20,6 +20,7 @@ function UnforwardedToggleGroupControlAsButtonGroup({
|
|
|
20
20
|
size,
|
|
21
21
|
value: valueProp,
|
|
22
22
|
id: idProp,
|
|
23
|
+
setSelectedElement,
|
|
23
24
|
...otherProps
|
|
24
25
|
}, forwardedRef) {
|
|
25
26
|
const generatedId = useInstanceId(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group');
|
|
@@ -44,8 +45,9 @@ function UnforwardedToggleGroupControlAsButtonGroup({
|
|
|
44
45
|
setValue: setSelectedValue,
|
|
45
46
|
isBlock: !isAdaptiveWidth,
|
|
46
47
|
isDeselectable: true,
|
|
47
|
-
size
|
|
48
|
-
|
|
48
|
+
size,
|
|
49
|
+
setSelectedElement
|
|
50
|
+
}), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size, setSelectedElement]);
|
|
49
51
|
return /*#__PURE__*/_jsx(ToggleGroupControlContext.Provider, {
|
|
50
52
|
value: groupContextValue,
|
|
51
53
|
children: /*#__PURE__*/_jsx(View, {
|