@wordpress/components 25.11.1-next.f8d8eceb.0 → 25.13.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 +58 -1
- package/build/angle-picker-control/index.js +0 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/custom-select-control-v2/index.js +87 -0
- package/build/custom-select-control-v2/index.js.map +1 -0
- package/build/custom-select-control-v2/styles.js +85 -0
- package/build/custom-select-control-v2/styles.js.map +1 -0
- package/build/custom-select-control-v2/types.js +6 -0
- package/build/custom-select-control-v2/types.js.map +1 -0
- package/build/disclosure/index.js +37 -7
- package/build/disclosure/index.js.map +1 -1
- package/build/disclosure/types.js +6 -0
- package/build/disclosure/types.js.map +1 -0
- package/build/divider/component.js +5 -3
- package/build/divider/component.js.map +1 -1
- package/build/divider/types.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/index.js +74 -35
- package/build/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/styles.js +82 -59
- package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build/form-token-field/index.js +6 -2
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/token-input.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/gradient-picker/index.js +1 -1
- package/build/gradient-picker/index.js.map +1 -1
- package/build/heading/hook.js +6 -3
- package/build/heading/hook.js.map +1 -1
- package/build/heading/types.js.map +1 -1
- package/build/index.native.js +8 -1
- package/build/index.native.js.map +1 -1
- package/build/mobile/audio-player/index.native.js +8 -9
- package/build/mobile/audio-player/index.native.js.map +1 -1
- package/build/mobile/global-styles-context/utils.native.js +44 -3
- package/build/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build/mobile/utils/alignments.native.js +1 -1
- package/build/mobile/utils/alignments.native.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/radio-group/context.js +22 -0
- package/build/radio-group/context.js.map +1 -0
- package/build/radio-group/index.js +27 -23
- package/build/radio-group/index.js.map +1 -1
- package/build/radio-group/radio.js +58 -0
- package/build/radio-group/radio.js.map +1 -0
- package/build/radio-group/types.js +6 -0
- package/build/radio-group/types.js.map +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/tabs/index.js +6 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +14 -7
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +5 -7
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +3 -5
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/tabpanel.js +7 -10
- package/build/tabs/tabpanel.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/text/types.js.map +1 -1
- package/build/text-control/index.js +5 -1
- package/build/text-control/index.js.map +1 -1
- package/build/text-control/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +4 -2
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +13 -9
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/types.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +5 -1
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/angle-picker-control/index.js +0 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +74 -0
- package/build-module/custom-select-control-v2/index.js.map +1 -0
- package/build-module/custom-select-control-v2/styles.js +71 -0
- package/build-module/custom-select-control-v2/styles.js.map +1 -0
- package/build-module/custom-select-control-v2/types.js +2 -0
- package/build-module/custom-select-control-v2/types.js.map +1 -0
- package/build-module/disclosure/index.js +33 -8
- package/build-module/disclosure/index.js.map +1 -1
- package/build-module/disclosure/types.js +2 -0
- package/build-module/disclosure/types.js.map +1 -0
- package/build-module/divider/component.js +3 -3
- package/build-module/divider/component.js.map +1 -1
- package/build-module/divider/types.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/index.js +72 -34
- package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/styles.js +69 -40
- package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -1
- package/build-module/form-token-field/index.js +6 -2
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/token-input.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -1
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/heading/hook.js +6 -3
- package/build-module/heading/hook.js.map +1 -1
- package/build-module/heading/types.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/mobile/audio-player/index.native.js +9 -10
- package/build-module/mobile/audio-player/index.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/utils.native.js +43 -4
- package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
- package/build-module/mobile/utils/alignments.native.js +1 -1
- package/build-module/mobile/utils/alignments.native.js.map +1 -1
- package/build-module/private-apis.js +4 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/radio-group/context.js +14 -0
- package/build-module/radio-group/context.js.map +1 -0
- package/build-module/radio-group/index.js +24 -23
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/radio-group/radio.js +46 -0
- package/build-module/radio-group/radio.js.map +1 -0
- package/build-module/radio-group/types.js +2 -0
- package/build-module/radio-group/types.js.map +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/tabs/index.js +7 -5
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +11 -5
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +7 -9
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +3 -5
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/tabpanel.js +9 -10
- package/build-module/tabs/tabpanel.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/text/types.js.map +1 -1
- package/build-module/text-control/index.js +6 -1
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/text-control/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +4 -2
- 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 +13 -9
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/types.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +6 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-style/style-rtl.css +52 -8
- package/build-style/style.css +52 -8
- package/build-types/angle-picker-control/index.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts +1944 -0
- package/build-types/box-control/stories/index.story.d.ts.map +1 -0
- package/build-types/card/card-divider/component.d.ts +1 -1
- package/build-types/card/card-divider/hook.d.ts +162 -162
- package/build-types/color-palette/styles.d.ts +4 -1
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +6 -0
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +19 -0
- package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/styles.d.ts +47 -0
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/types.d.ts +57 -0
- package/build-types/custom-select-control-v2/types.d.ts.map +1 -0
- package/build-types/date-time/date/styles.d.ts +4 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/disclosure/index.d.ts +7 -1
- package/build-types/disclosure/index.d.ts.map +1 -1
- package/build-types/disclosure/types.d.ts +12 -0
- package/build-types/disclosure/types.d.ts.map +1 -0
- package/build-types/divider/component.d.ts +5 -1
- package/build-types/divider/component.d.ts.map +1 -1
- package/build-types/divider/stories/index.story.d.ts.map +1 -1
- package/build-types/divider/styles.d.ts +1 -1
- package/build-types/divider/types.d.ts +2 -2
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -2
- package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +26 -18
- package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts +1 -7
- package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/token-input.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/heading/component.d.ts +4 -1
- package/build-types/heading/component.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/heading/types.d.ts +20 -1
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +4 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +4 -1
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/radio-group/context.d.ts +10 -0
- package/build-types/radio-group/context.d.ts.map +1 -0
- package/build-types/radio-group/index.d.ts +7 -9
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts +8 -0
- package/build-types/radio-group/radio.d.ts.map +1 -0
- package/build-types/radio-group/stories/index.story.d.ts +14 -0
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -0
- package/build-types/radio-group/types.d.ts +40 -0
- package/build-types/radio-group/types.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/types.d.ts +16 -6
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +4 -3
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +10 -0
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +1 -1
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/tabpanel.d.ts +4 -1
- package/build-types/tabs/tabpanel.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +7 -31
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/text/types.d.ts +15 -2
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +2 -1
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +6 -0
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +1 -0
- 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 +2 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +6 -0
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/angle-picker-control/index.tsx +0 -1
- package/src/box-control/stories/index.story.tsx +82 -0
- package/src/button/style.scss +10 -2
- package/src/combobox-control/README.md +1 -3
- package/src/custom-select-control-v2/README.md +73 -0
- package/src/custom-select-control-v2/index.tsx +99 -0
- package/src/custom-select-control-v2/stories/index.story.tsx +149 -0
- package/src/custom-select-control-v2/styles.ts +76 -0
- package/src/custom-select-control-v2/types.ts +63 -0
- package/src/disclosure/index.tsx +44 -0
- package/src/disclosure/types.tsx +10 -0
- package/src/divider/component.tsx +3 -3
- package/src/divider/stories/index.story.tsx +8 -0
- package/src/divider/types.ts +2 -2
- package/src/dropdown-menu/style.scss +4 -0
- package/src/dropdown-menu-v2-ariakit/README.md +19 -12
- package/src/dropdown-menu-v2-ariakit/index.tsx +116 -51
- package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +205 -94
- package/src/dropdown-menu-v2-ariakit/styles.ts +153 -117
- package/src/dropdown-menu-v2-ariakit/test/index.tsx +5 -36
- package/src/dropdown-menu-v2-ariakit/types.ts +1 -8
- package/src/form-toggle/style.scss +37 -7
- package/src/form-token-field/index.tsx +11 -3
- package/src/form-token-field/token-input.tsx +1 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/gradient-picker/index.tsx +1 -1
- package/src/heading/README.md +6 -1
- package/src/heading/hook.ts +6 -3
- package/src/heading/types.ts +23 -1
- package/src/index.native.js +1 -0
- package/src/mobile/audio-player/index.native.js +9 -13
- package/src/mobile/global-styles-context/utils.native.js +52 -3
- package/src/mobile/utils/alignments.native.js +1 -0
- package/src/navigable-container/README.md +1 -1
- package/src/private-apis.ts +4 -2
- package/src/radio-group/context.tsx +18 -0
- package/src/radio-group/index.tsx +65 -0
- package/src/radio-group/radio.tsx +55 -0
- package/src/radio-group/stories/index.story.tsx +90 -0
- package/src/radio-group/types.ts +39 -0
- package/src/slot-fill/README.md +1 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
- package/src/slot-fill/types.ts +18 -6
- package/src/tabs/README.md +3 -33
- package/src/tabs/index.tsx +12 -2
- package/src/tabs/stories/index.story.tsx +17 -1
- package/src/tabs/styles.ts +16 -0
- package/src/tabs/tab.tsx +10 -10
- package/src/tabs/tablist.tsx +21 -20
- package/src/tabs/tabpanel.tsx +26 -25
- package/src/tabs/test/index.tsx +90 -16
- package/src/tabs/types.ts +7 -32
- package/src/text/README.md +5 -1
- package/src/text/types.ts +15 -2
- package/src/text-control/index.tsx +5 -1
- package/src/text-control/style.scss +5 -0
- package/src/text-control/types.ts +6 -0
- package/src/toggle-control/README.md +2 -2
- package/src/toggle-group-control/toggle-group-control/component.tsx +8 -2
- package/src/toggle-group-control/toggle-group-control/styles.ts +13 -4
- package/src/toggle-group-control/types.ts +6 -0
- package/src/toolbar/toolbar-button/style.scss +0 -5
- package/src/tools-panel/tools-panel-item/hook.ts +11 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/radio-group/radio/index.js +0 -49
- package/build/radio-group/radio/index.js.map +0 -1
- package/build/radio-group/radio-context/index.js +0 -18
- package/build/radio-group/radio-context/index.js.map +0 -1
- package/build-module/radio-group/radio/index.js +0 -40
- package/build-module/radio-group/radio/index.js.map +0 -1
- package/build-module/radio-group/radio-context/index.js +0 -10
- package/build-module/radio-group/radio-context/index.js.map +0 -1
- package/build-types/radio-group/radio/index.d.ts +0 -7
- package/build-types/radio-group/radio/index.d.ts.map +0 -1
- package/build-types/radio-group/radio-context/index.d.ts +0 -6
- package/build-types/radio-group/radio-context/index.d.ts.map +0 -1
- package/src/box-control/stories/index.story.js +0 -75
- package/src/disclosure/index.js +0 -11
- package/src/radio-group/index.js +0 -51
- package/src/radio-group/radio/index.js +0 -40
- package/src/radio-group/radio-context/index.js +0 -11
- package/src/radio-group/stories/index.story.js +0 -83
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Ariakit","useMemo","forwardRef","ButtonGroup","RadioGroupContext","UnforwardedRadioGroup","label","checked","defaultChecked","disabled","onChange","children","props","ref","radioStore","useRadioStore","value","defaultValue","setValue","newValue","undefined","contextValue","store","createElement","Provider","RadioGroup","render"],"sources":["@wordpress/components/src/radio-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ButtonGroup from '../button-group';\nimport type { WordPressComponentProps } from '../context';\nimport { RadioGroupContext } from './context';\nimport type { RadioGroupProps } from './types';\n\nfunction UnforwardedRadioGroup(\n\t{\n\t\tlabel,\n\t\tchecked,\n\t\tdefaultChecked,\n\t\tdisabled,\n\t\tonChange,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< RadioGroupProps, 'div', false >,\n\tref: React.ForwardedRef< any >\n) {\n\tconst radioStore = Ariakit.useRadioStore( {\n\t\tvalue: checked,\n\t\tdefaultValue: defaultChecked,\n\t\tsetValue: ( newValue ) => {\n\t\t\tonChange?.( newValue ?? undefined );\n\t\t},\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tstore: radioStore,\n\t\t\tdisabled,\n\t\t} ),\n\t\t[ radioStore, disabled ]\n\t);\n\n\treturn (\n\t\t<RadioGroupContext.Provider value={ contextValue }>\n\t\t\t<Ariakit.RadioGroup\n\t\t\t\tstore={ radioStore }\n\t\t\t\trender={ <ButtonGroup>{ children }</ButtonGroup> }\n\t\t\t\taria-label={ label }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</RadioGroupContext.Provider>\n\t);\n}\n\n/**\n * @deprecated Use `RadioControl` or `ToggleGroupControl` instead.\n */\nexport const RadioGroup = forwardRef( UnforwardedRadioGroup );\nexport default RadioGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AAEzC,SAASC,iBAAiB,QAAQ,WAAW;AAG7C,SAASC,qBAAqBA,CAC7B;EACCC,KAAK;EACLC,OAAO;EACPC,cAAc;EACdC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR,GAAGC;AACsD,CAAC,EAC3DC,GAA8B,EAC7B;EACD,MAAMC,UAAU,GAAGd,OAAO,CAACe,aAAa,CAAE;IACzCC,KAAK,EAAET,OAAO;IACdU,YAAY,EAAET,cAAc;IAC5BU,QAAQ,EAAIC,QAAQ,IAAM;MACzBT,QAAQ,GAAIS,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIC,SAAU,CAAC;IACpC;EACD,CAAE,CAAC;EAEH,MAAMC,YAAY,GAAGpB,OAAO,CAC3B,OAAQ;IACPqB,KAAK,EAAER,UAAU;IACjBL;EACD,CAAC,CAAE,EACH,CAAEK,UAAU,EAAEL,QAAQ,CACvB,CAAC;EAED,OACCc,aAAA,CAACnB,iBAAiB,CAACoB,QAAQ;IAACR,KAAK,EAAGK;EAAc,GACjDE,aAAA,CAACvB,OAAO,CAACyB,UAAU;IAClBH,KAAK,EAAGR,UAAY;IACpBY,MAAM,EAAGH,aAAA,CAACpB,WAAW,QAAGQ,QAAuB,CAAG;IAClD,cAAaL,KAAO;IACpBO,GAAG,EAAGA,GAAK;IAAA,GACND;EAAK,CACV,CAC0B,CAAC;AAE/B;;AAEA;AACA;AACA;AACA,OAAO,MAAMa,UAAU,GAAGvB,UAAU,CAAEG,qBAAsB,CAAC;AAC7D,eAAeoB,UAAU"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { forwardRef, useContext } from '@wordpress/element';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* External dependencies
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line no-restricted-imports
|
|
11
|
+
import * as Ariakit from '@ariakit/react';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import Button from '../button';
|
|
17
|
+
import { RadioGroupContext } from './context';
|
|
18
|
+
function UnforwardedRadio({
|
|
19
|
+
value,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}, ref) {
|
|
23
|
+
const {
|
|
24
|
+
store,
|
|
25
|
+
disabled
|
|
26
|
+
} = useContext(RadioGroupContext);
|
|
27
|
+
const selectedValue = store?.useState('value');
|
|
28
|
+
const isChecked = selectedValue !== undefined && selectedValue === value;
|
|
29
|
+
return createElement(Ariakit.Radio, {
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
store: store,
|
|
32
|
+
ref: ref,
|
|
33
|
+
value: value,
|
|
34
|
+
render: createElement(Button, {
|
|
35
|
+
variant: isChecked ? 'primary' : 'secondary',
|
|
36
|
+
...props
|
|
37
|
+
})
|
|
38
|
+
}, children || value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use `RadioControl` or `ToggleGroupControl` instead.
|
|
43
|
+
*/
|
|
44
|
+
export const Radio = forwardRef(UnforwardedRadio);
|
|
45
|
+
export default Radio;
|
|
46
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","Ariakit","Button","RadioGroupContext","UnforwardedRadio","value","children","props","ref","store","disabled","selectedValue","useState","isChecked","undefined","createElement","Radio","render","variant"],"sources":["@wordpress/components/src/radio-group/radio.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { RadioGroupContext } from './context';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioProps } from './types';\n\nfunction UnforwardedRadio(\n\t{\n\t\tvalue,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< RadioProps, 'button', false >,\n\tref: React.ForwardedRef< any >\n) {\n\tconst { store, disabled } = useContext( RadioGroupContext );\n\n\tconst selectedValue = store?.useState( 'value' );\n\tconst isChecked = selectedValue !== undefined && selectedValue === value;\n\n\treturn (\n\t\t<Ariakit.Radio\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ store }\n\t\t\tref={ ref }\n\t\t\tvalue={ value }\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ isChecked ? 'primary' : 'secondary' }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ children || value }\n\t\t</Ariakit.Radio>\n\t);\n}\n\n/**\n * @deprecated Use `RadioControl` or `ToggleGroupControl` instead.\n */\nexport const Radio = forwardRef( UnforwardedRadio );\nexport default Radio;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA;AACA,OAAO,KAAKC,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,iBAAiB,QAAQ,WAAW;AAI7C,SAASC,gBAAgBA,CACxB;EACCC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACoD,CAAC,EACzDC,GAA8B,EAC7B;EACD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGV,UAAU,CAAEG,iBAAkB,CAAC;EAE3D,MAAMQ,aAAa,GAAGF,KAAK,EAAEG,QAAQ,CAAE,OAAQ,CAAC;EAChD,MAAMC,SAAS,GAAGF,aAAa,KAAKG,SAAS,IAAIH,aAAa,KAAKN,KAAK;EAExE,OACCU,aAAA,CAACd,OAAO,CAACe,KAAK;IACbN,QAAQ,EAAGA,QAAU;IACrBD,KAAK,EAAGA,KAAO;IACfD,GAAG,EAAGA,GAAK;IACXH,KAAK,EAAGA,KAAO;IACfY,MAAM,EACLF,aAAA,CAACb,MAAM;MACNgB,OAAO,EAAGL,SAAS,GAAG,SAAS,GAAG,WAAa;MAAA,GAC1CN;IAAK,CACV;EACD,GAECD,QAAQ,IAAID,KACA,CAAC;AAElB;;AAEA;AACA;AACA;AACA,OAAO,MAAMW,KAAK,GAAGjB,UAAU,CAAEK,gBAAiB,CAAC;AACnD,eAAeY,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/radio-group/types.ts"],"sourcesContent":["export type RadioGroupProps = {\n\t/**\n\t * Accessible label for the radio group\n\t */\n\tlabel: string;\n\t/**\n\t * The `value` of the `Radio` element which should be selected.\n\t * Indicates controlled usage of the component.\n\t */\n\tchecked?: string | number;\n\t/**\n\t * The value of the radio element which is initially selected.\n\t */\n\tdefaultChecked?: string | number;\n\t/**\n\t * Whether the `RadioGroup` should be disabled.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Called when a `Radio` element has been selected.\n\t * Receives the `value` of the selected element as an argument.\n\t */\n\tonChange?: ( value: string | number | undefined ) => void;\n\t/**\n\t * The children elements, which should be a series of `Radio` components.\n\t */\n\tchildren: React.ReactNode;\n};\n\nexport type RadioProps = {\n\t/**\n\t * The actual value of the radio element.\n\t */\n\tvalue: string | number;\n\t/**\n\t * Content displayed on the Radio element. If there aren't any children, `value` is displayed.\n\t */\n\tchildren?: React.ReactNode;\n};\n"],"mappings":""}
|
|
@@ -45,7 +45,7 @@ function createSlotRegistry() {
|
|
|
45
45
|
const slotFills = fills.get(name);
|
|
46
46
|
if (slotFills) {
|
|
47
47
|
// Force update fills.
|
|
48
|
-
slotFills.
|
|
48
|
+
slotFills.forEach(fill => fill.current.rerender());
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
const registerFill = (name, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ref","valRef","proxyMap","useMemo","isShallowEqual","SlotFillContext","createSlotRegistry","slots","fills","registerSlot","name","fillProps","slot","get","set","unregisterSlot","delete","updateSlot","slotFills","
|
|
1
|
+
{"version":3,"names":["ref","valRef","proxyMap","useMemo","isShallowEqual","SlotFillContext","createSlotRegistry","slots","fills","registerSlot","name","fillProps","slot","get","set","unregisterSlot","delete","updateSlot","slotFills","forEach","fill","current","rerender","registerFill","unregisterFill","fillsForName","filter","fillRef","SlotFillProvider","children","registry","createElement","Provider","value"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ref as valRef } from 'valtio';\nimport { proxyMap } from 'valtio/utils';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport type {\n\tSlotFillProviderProps,\n\tSlotFillBubblesVirtuallyContext,\n} from '../types';\n\nfunction createSlotRegistry(): SlotFillBubblesVirtuallyContext {\n\tconst slots: SlotFillBubblesVirtuallyContext[ 'slots' ] = proxyMap();\n\tconst fills: SlotFillBubblesVirtuallyContext[ 'fills' ] = proxyMap();\n\n\tconst registerSlot: SlotFillBubblesVirtuallyContext[ 'registerSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\n\t\tslots.set(\n\t\t\tname,\n\t\t\tvalRef( {\n\t\t\t\t...slot,\n\t\t\t\tref: ref || slot?.ref,\n\t\t\t\tfillProps: fillProps || slot?.fillProps || {},\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst unregisterSlot: SlotFillBubblesVirtuallyContext[ 'unregisterSlot' ] =\n\t\t( name, ref ) => {\n\t\t\t// Make sure we're not unregistering a slot registered by another element\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412\n\t\t\tif ( slots.get( name )?.ref === ref ) {\n\t\t\t\tslots.delete( name );\n\t\t\t}\n\t\t};\n\n\tconst updateSlot: SlotFillBubblesVirtuallyContext[ 'updateSlot' ] = (\n\t\tname,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\t\tif ( ! slot ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isShallowEqual( slot.fillProps, fillProps ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tslot.fillProps = fillProps;\n\t\tconst slotFills = fills.get( name );\n\t\tif ( slotFills ) {\n\t\t\t// Force update fills.\n\t\t\tslotFills.forEach( ( fill ) => fill.current.rerender() );\n\t\t}\n\t};\n\n\tconst registerFill: SlotFillBubblesVirtuallyContext[ 'registerFill' ] = (\n\t\tname,\n\t\tref\n\t) => {\n\t\tfills.set( name, valRef( [ ...( fills.get( name ) || [] ), ref ] ) );\n\t};\n\n\tconst unregisterFill: SlotFillBubblesVirtuallyContext[ 'registerFill' ] = (\n\t\tname,\n\t\tref\n\t) => {\n\t\tconst fillsForName = fills.get( name );\n\t\tif ( ! fillsForName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfills.set(\n\t\t\tname,\n\t\t\tvalRef( fillsForName.filter( ( fillRef ) => fillRef !== ref ) )\n\t\t);\n\t};\n\n\treturn {\n\t\tslots,\n\t\tfills,\n\t\tregisterSlot,\n\t\tupdateSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t};\n}\n\nexport default function SlotFillProvider( {\n\tchildren,\n}: SlotFillProviderProps ) {\n\tconst registry = useMemo( createSlotRegistry, [] );\n\treturn (\n\t\t<SlotFillContext.Provider value={ registry }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,GAAG,IAAIC,MAAM,QAAQ,QAAQ;AACtC,SAASC,QAAQ,QAAQ,cAAc;;AAEvC;AACA;AACA;AACA,SAASC,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IAAMA,IAAI,CAACC,OAAO,CAACC,QAAQ,CAAC,CAAE,CAAC;IACzD;EACD,CAAC;EAED,MAAMC,YAA+D,GAAGA,CACvEb,IAAI,EACJV,GAAG,KACC;IACJQ,KAAK,CAACM,GAAG,CAAEJ,IAAI,EAAET,MAAM,CAAE,CAAE,IAAKO,KAAK,CAACK,GAAG,CAAEH,IAAK,CAAC,IAAI,EAAE,CAAE,EAAEV,GAAG,CAAG,CAAE,CAAC;EACrE,CAAC;EAED,MAAMwB,cAAiE,GAAGA,CACzEd,IAAI,EACJV,GAAG,KACC;IACJ,MAAMyB,YAAY,GAAGjB,KAAK,CAACK,GAAG,CAAEH,IAAK,CAAC;IACtC,IAAK,CAAEe,YAAY,EAAG;MACrB;IACD;IAEAjB,KAAK,CAACM,GAAG,CACRJ,IAAI,EACJT,MAAM,CAAEwB,YAAY,CAACC,MAAM,CAAIC,OAAO,IAAMA,OAAO,KAAK3B,GAAI,CAAE,CAC/D,CAAC;EACF,CAAC;EAED,OAAO;IACNO,KAAK;IACLC,KAAK;IACLC,YAAY;IACZQ,UAAU;IACVF,cAAc;IACdQ,YAAY;IACZC;EACD,CAAC;AACF;AAEA,eAAe,SAASI,gBAAgBA,CAAE;EACzCC;AACsB,CAAC,EAAG;EAC1B,MAAMC,QAAQ,GAAG3B,OAAO,CAAEG,kBAAkB,EAAE,EAAG,CAAC;EAClD,OACCyB,aAAA,CAAC1B,eAAe,CAAC2B,QAAQ;IAACC,KAAK,EAAGH;EAAU,GACzCD,QACuB,CAAC;AAE7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Component, MutableRefObject, ReactNode, RefObject } from 'react';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t *
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Component, MutableRefObject, ReactNode, RefObject } from 'react';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: never;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: string;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: React.CSSProperties;\n\t } )\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually?: false;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: never;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: never;\n\t } );\n\nexport type FillComponentProps = {\n\t/**\n\t * The name of the slot to fill into.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * Children elements or render function.\n\t */\n\tchildren?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );\n};\n\nexport type SlotFillProviderProps = {\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type SlotFillBubblesVirtuallySlotRef = RefObject< HTMLElement >;\nexport type SlotFillBubblesVirtuallyFillRef = MutableRefObject< {\n\trerender: () => void;\n} >;\n\nexport type SlotFillBubblesVirtuallyContext = {\n\tslots: Map<\n\t\tSlotKey,\n\t\t{\n\t\t\tref: SlotFillBubblesVirtuallySlotRef;\n\t\t\tfillProps: FillProps;\n\t\t}\n\t>;\n\tfills: Map< SlotKey, SlotFillBubblesVirtuallyFillRef[] >;\n\tregisterSlot: (\n\t\tname: SlotKey,\n\t\tref: SlotFillBubblesVirtuallySlotRef,\n\t\tfillProps: FillProps\n\t) => void;\n\tunregisterSlot: (\n\t\tname: SlotKey,\n\t\tref: SlotFillBubblesVirtuallySlotRef\n\t) => void;\n\tupdateSlot: ( name: SlotKey, fillProps: FillProps ) => void;\n\tregisterFill: (\n\t\tname: SlotKey,\n\t\tref: SlotFillBubblesVirtuallyFillRef\n\t) => void;\n\tunregisterFill: (\n\t\tname: SlotKey,\n\t\tref: SlotFillBubblesVirtuallyFillRef\n\t) => void;\n\n\t/**\n\t * This helps the provider know if it's using the default context value or not.\n\t */\n\tisDefault?: boolean;\n};\n\nexport type BaseSlotFillContext = {\n\tregisterSlot: (\n\t\tname: SlotKey,\n\t\tslot: Component< BaseSlotComponentProps >\n\t) => void;\n\tunregisterSlot: (\n\t\tname: SlotKey,\n\t\tslot: Component< BaseSlotComponentProps >\n\t) => void;\n\tregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tgetSlot: (\n\t\tname: SlotKey\n\t) => Component< BaseSlotComponentProps > | undefined;\n\tgetFills: (\n\t\tname: SlotKey,\n\t\tslotInstance: Component< BaseSlotComponentProps >\n\t) => FillComponentProps[];\n\tsubscribe: ( listener: () => void ) => () => void;\n};\n\nexport type BaseSlotComponentProps = Pick<\n\tBaseSlotFillContext,\n\t'registerSlot' | 'unregisterSlot' | 'getFills'\n> &\n\tOmit< SlotComponentProps, 'bubblesVirtually' > & {\n\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\t};\n"],"mappings":""}
|
|
@@ -9,7 +9,7 @@ import * as Ariakit from '@ariakit/react';
|
|
|
9
9
|
* WordPress dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { useInstanceId } from '@wordpress/compose';
|
|
12
|
-
import { useLayoutEffect, useRef } from '@wordpress/element';
|
|
12
|
+
import { useLayoutEffect, useMemo, useRef } from '@wordpress/element';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
@@ -128,15 +128,17 @@ function Tabs({
|
|
|
128
128
|
setSelectedId(null);
|
|
129
129
|
}
|
|
130
130
|
}, [isControlled, selectedId, selectedTab, selectedTabId, setSelectedId]);
|
|
131
|
+
const contextValue = useMemo(() => ({
|
|
132
|
+
store,
|
|
133
|
+
instanceId
|
|
134
|
+
}), [store, instanceId]);
|
|
131
135
|
return createElement(TabsContext.Provider, {
|
|
132
|
-
value:
|
|
133
|
-
store,
|
|
134
|
-
instanceId
|
|
135
|
-
}
|
|
136
|
+
value: contextValue
|
|
136
137
|
}, children);
|
|
137
138
|
}
|
|
138
139
|
Tabs.TabList = TabList;
|
|
139
140
|
Tabs.Tab = Tab;
|
|
140
141
|
Tabs.TabPanel = TabPanel;
|
|
142
|
+
Tabs.Context = TabsContext;
|
|
141
143
|
export default Tabs;
|
|
142
144
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","useInstanceId","useLayoutEffect","useRef","TabsContext","Tab","TabList","TabPanel","Tabs","selectOnMove","initialTabId","orientation","onSelect","children","selectedTabId","instanceId","store","useTabStore","defaultSelectedId","setSelectedId","selectedId","strippedDownId","replace","isControlled","undefined","items","useState","tabsHavePopulated","length","current","selectedTab","find","item","id","firstEnabledTab","dimmed","initialTab","createElement","Provider","value"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction Tabs( {\n\tselectOnMove = true,\n\tinitialTabId,\n\torientation = 'horizontal',\n\tonSelect,\n\tchildren,\n\tselectedTabId,\n}: TabsProps ) {\n\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\tconst store = Ariakit.useTabStore( {\n\t\tselectOnMove,\n\t\torientation,\n\t\tdefaultSelectedId: initialTabId && `${ instanceId }-${ initialTabId }`,\n\t\tsetSelectedId: ( selectedId ) => {\n\t\t\tconst strippedDownId =\n\t\t\t\ttypeof selectedId === 'string'\n\t\t\t\t\t? selectedId.replace( `${ instanceId }-`, '' )\n\t\t\t\t\t: selectedId;\n\t\t\tonSelect?.( strippedDownId );\n\t\t},\n\t\tselectedId: selectedTabId && `${ instanceId }-${ selectedTabId }`,\n\t} );\n\n\tconst isControlled = selectedTabId !== undefined;\n\n\tconst { items, selectedId } = store.useState();\n\tconst { setSelectedId } = store;\n\n\t// Keep track of whether tabs have been populated. This is used to prevent\n\t// certain effects from firing too early while tab data and relevant\n\t// variables are undefined during the initial render.\n\tconst tabsHavePopulated = useRef( false );\n\tif ( items.length > 0 ) {\n\t\ttabsHavePopulated.current = true;\n\t}\n\n\tconst selectedTab = items.find( ( item ) => item.id === selectedId );\n\tconst firstEnabledTab = items.find( ( item ) => {\n\t\t// Ariakit internally refers to disabled tabs as `dimmed`.\n\t\treturn ! item.dimmed;\n\t} );\n\tconst initialTab = items.find(\n\t\t( item ) => item.id === `${ instanceId }-${ initialTabId }`\n\t);\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\tif ( isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection, as well as ensuring no tab is\n\t\t// selected if an invalid `initialTabId` is provided.\n\t\tif ( initialTabId && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab is missing (i.e. removed from the DOM),\n\t\t// fall back to the initial tab or the first enabled tab if there is\n\t\t// one. Otherwise, no tab should be selected.\n\t\tif ( ! items.find( ( item ) => item.id === selectedId ) ) {\n\t\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\t\tsetSelectedId( initialTab?.id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t\t} else if ( tabsHavePopulated.current ) {\n\t\t\t\tsetSelectedId( null );\n\t\t\t}\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tinitialTabId,\n\t\tisControlled,\n\t\titems,\n\t\tselectedId,\n\t\tsetSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedTab?.dimmed ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In controlled mode, we trust that disabling tabs is done\n\t\t// intentionally, and don't select a new tab automatically.\n\t\tif ( isControlled ) {\n\t\t\tsetSelectedId( null );\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab becomes disabled, fall back to the\n\t\t// `initialTabId` if possible. Otherwise select the first\n\t\t// enabled tab (if there is one).\n\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\tsetSelectedId( initialTab.id );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tisControlled,\n\t\tselectedTab?.dimmed,\n\t\tsetSelectedId,\n\t] );\n\n\t// Clear `selectedId` if the active tab is removed from the DOM in controlled mode.\n\tuseLayoutEffect( () => {\n\t\tif ( ! isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once the tabs have populated, if the `selectedTabId` still can't be\n\t\t// found, clear the selection.\n\t\tif ( tabsHavePopulated.current && !! selectedTabId && ! selectedTab ) {\n\t\t\tsetSelectedId( null );\n\t\t}\n\t}, [\n\t\tisControlled,\n\t\tselectedId,\n\t\tselectedTab,\n\t\tselectedTabId,\n\t\tsetSelectedId,\n\t] );\n\n\treturn (\n\t\t<TabsContext.Provider value={
|
|
1
|
+
{"version":3,"names":["Ariakit","useInstanceId","useLayoutEffect","useMemo","useRef","TabsContext","Tab","TabList","TabPanel","Tabs","selectOnMove","initialTabId","orientation","onSelect","children","selectedTabId","instanceId","store","useTabStore","defaultSelectedId","setSelectedId","selectedId","strippedDownId","replace","isControlled","undefined","items","useState","tabsHavePopulated","length","current","selectedTab","find","item","id","firstEnabledTab","dimmed","initialTab","contextValue","createElement","Provider","value","Context"],"sources":["@wordpress/components/src/tabs/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useLayoutEffect, useMemo, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabsProps } from './types';\nimport { TabsContext } from './context';\nimport { Tab } from './tab';\nimport { TabList } from './tablist';\nimport { TabPanel } from './tabpanel';\n\nfunction Tabs( {\n\tselectOnMove = true,\n\tinitialTabId,\n\torientation = 'horizontal',\n\tonSelect,\n\tchildren,\n\tselectedTabId,\n}: TabsProps ) {\n\tconst instanceId = useInstanceId( Tabs, 'tabs' );\n\tconst store = Ariakit.useTabStore( {\n\t\tselectOnMove,\n\t\torientation,\n\t\tdefaultSelectedId: initialTabId && `${ instanceId }-${ initialTabId }`,\n\t\tsetSelectedId: ( selectedId ) => {\n\t\t\tconst strippedDownId =\n\t\t\t\ttypeof selectedId === 'string'\n\t\t\t\t\t? selectedId.replace( `${ instanceId }-`, '' )\n\t\t\t\t\t: selectedId;\n\t\t\tonSelect?.( strippedDownId );\n\t\t},\n\t\tselectedId: selectedTabId && `${ instanceId }-${ selectedTabId }`,\n\t} );\n\n\tconst isControlled = selectedTabId !== undefined;\n\n\tconst { items, selectedId } = store.useState();\n\tconst { setSelectedId } = store;\n\n\t// Keep track of whether tabs have been populated. This is used to prevent\n\t// certain effects from firing too early while tab data and relevant\n\t// variables are undefined during the initial render.\n\tconst tabsHavePopulated = useRef( false );\n\tif ( items.length > 0 ) {\n\t\ttabsHavePopulated.current = true;\n\t}\n\n\tconst selectedTab = items.find( ( item ) => item.id === selectedId );\n\tconst firstEnabledTab = items.find( ( item ) => {\n\t\t// Ariakit internally refers to disabled tabs as `dimmed`.\n\t\treturn ! item.dimmed;\n\t} );\n\tconst initialTab = items.find(\n\t\t( item ) => item.id === `${ instanceId }-${ initialTabId }`\n\t);\n\n\t// Handle selecting the initial tab.\n\tuseLayoutEffect( () => {\n\t\tif ( isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Wait for the denoted initial tab to be declared before making a\n\t\t// selection. This ensures that if a tab is declared lazily it can\n\t\t// still receive initial selection, as well as ensuring no tab is\n\t\t// selected if an invalid `initialTabId` is provided.\n\t\tif ( initialTabId && ! initialTab ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab is missing (i.e. removed from the DOM),\n\t\t// fall back to the initial tab or the first enabled tab if there is\n\t\t// one. Otherwise, no tab should be selected.\n\t\tif ( ! items.find( ( item ) => item.id === selectedId ) ) {\n\t\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\t\tsetSelectedId( initialTab?.id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( firstEnabledTab ) {\n\t\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t\t} else if ( tabsHavePopulated.current ) {\n\t\t\t\tsetSelectedId( null );\n\t\t\t}\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tinitialTabId,\n\t\tisControlled,\n\t\titems,\n\t\tselectedId,\n\t\tsetSelectedId,\n\t] );\n\n\t// Handle the currently selected tab becoming disabled.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedTab?.dimmed ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// In controlled mode, we trust that disabling tabs is done\n\t\t// intentionally, and don't select a new tab automatically.\n\t\tif ( isControlled ) {\n\t\t\tsetSelectedId( null );\n\t\t\treturn;\n\t\t}\n\n\t\t// If the currently selected tab becomes disabled, fall back to the\n\t\t// `initialTabId` if possible. Otherwise select the first\n\t\t// enabled tab (if there is one).\n\t\tif ( initialTab && ! initialTab.dimmed ) {\n\t\t\tsetSelectedId( initialTab.id );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( firstEnabledTab ) {\n\t\t\tsetSelectedId( firstEnabledTab.id );\n\t\t}\n\t}, [\n\t\tfirstEnabledTab,\n\t\tinitialTab,\n\t\tisControlled,\n\t\tselectedTab?.dimmed,\n\t\tsetSelectedId,\n\t] );\n\n\t// Clear `selectedId` if the active tab is removed from the DOM in controlled mode.\n\tuseLayoutEffect( () => {\n\t\tif ( ! isControlled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once the tabs have populated, if the `selectedTabId` still can't be\n\t\t// found, clear the selection.\n\t\tif ( tabsHavePopulated.current && !! selectedTabId && ! selectedTab ) {\n\t\t\tsetSelectedId( null );\n\t\t}\n\t}, [\n\t\tisControlled,\n\t\tselectedId,\n\t\tselectedTab,\n\t\tselectedTabId,\n\t\tsetSelectedId,\n\t] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tstore,\n\t\t\tinstanceId,\n\t\t} ),\n\t\t[ store, instanceId ]\n\t);\n\n\treturn (\n\t\t<TabsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</TabsContext.Provider>\n\t);\n}\n\nTabs.TabList = TabList;\nTabs.Tab = Tab;\nTabs.TabPanel = TabPanel;\nTabs.Context = TabsContext;\n\nexport default Tabs;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,eAAe,EAAEC,OAAO,EAAEC,MAAM,QAAQ,oBAAoB;;AAErE;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,GAAG,QAAQ,OAAO;AAC3B,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AU,EACVb,YAAY,EACZO,WAAW,EAAEK,MAAM,EACnBhB,aAAa,CACZ,CAAC;;EAEH;EACAlB,eAAe,CAAE,MAAM;IACtB,IAAK,CAAEsB,YAAY,EAAG;MACrB;IACD;;IAEA;IACA;IACA,IAAKI,iBAAiB,CAACE,OAAO,IAAI,CAAC,CAAEf,aAAa,IAAI,CAAEgB,WAAW,EAAG;MACrEX,aAAa,CAAE,IAAK,CAAC;IACtB;EACD,CAAC,EAAE,CACFI,YAAY,EACZH,UAAU,EACVU,WAAW,EACXhB,aAAa,EACbK,aAAa,CACZ,CAAC;EAEH,MAAMkB,YAAY,GAAGnC,OAAO,CAC3B,OAAQ;IACPc,KAAK;IACLD;EACD,CAAC,CAAE,EACH,CAAEC,KAAK,EAAED,UAAU,CACpB,CAAC;EAED,OACCuB,aAAA,CAAClC,WAAW,CAACmC,QAAQ;IAACC,KAAK,EAAGH;EAAc,GACzCxB,QACmB,CAAC;AAEzB;AAEAL,IAAI,CAACF,OAAO,GAAGA,OAAO;AACtBE,IAAI,CAACH,GAAG,GAAGA,GAAG;AACdG,IAAI,CAACD,QAAQ,GAAGA,QAAQ;AACxBC,IAAI,CAACiC,OAAO,GAAGrC,WAAW;AAE1B,eAAeI,IAAI"}
|
|
@@ -14,9 +14,9 @@ import { COLORS } from '../utils';
|
|
|
14
14
|
import { space } from '../utils/space';
|
|
15
15
|
import { reduceMotion } from '../utils/reduce-motion';
|
|
16
16
|
export const TabListWrapper = _styled("div", process.env.NODE_ENV === "production" ? {
|
|
17
|
-
target: "
|
|
17
|
+
target: "enfox0g2"
|
|
18
18
|
} : {
|
|
19
|
-
target: "
|
|
19
|
+
target: "enfox0g2",
|
|
20
20
|
label: "TabListWrapper"
|
|
21
21
|
})(process.env.NODE_ENV === "production" ? {
|
|
22
22
|
name: "xbm4q1",
|
|
@@ -24,13 +24,19 @@ export const TabListWrapper = _styled("div", process.env.NODE_ENV === "productio
|
|
|
24
24
|
} : {
|
|
25
25
|
name: "xbm4q1",
|
|
26
26
|
styles: "display:flex;align-items:stretch;flex-direction:row;&[aria-orientation='vertical']{flex-direction:column;}",
|
|
27
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
27
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBY3dDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcmVzdHJpY3RlZC1pbXBvcnRzXG5pbXBvcnQgKiBhcyBBcmlha2l0IGZyb20gJ0Bhcmlha2l0L3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IHsgc3BhY2UgfSBmcm9tICcuLi91dGlscy9zcGFjZSc7XG5pbXBvcnQgeyByZWR1Y2VNb3Rpb24gfSBmcm9tICcuLi91dGlscy9yZWR1Y2UtbW90aW9uJztcblxuZXhwb3J0IGNvbnN0IFRhYkxpc3RXcmFwcGVyID0gc3R5bGVkLmRpdmBcblx0ZGlzcGxheTogZmxleDtcblx0YWxpZ24taXRlbXM6IHN0cmV0Y2g7XG5cdGZsZXgtZGlyZWN0aW9uOiByb3c7XG5cdCZbYXJpYS1vcmllbnRhdGlvbj0ndmVydGljYWwnXSB7XG5cdFx0ZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblx0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LXJhZGl1czogMnB4O1xuXG5cdFx0XHQvLyBBbmltYXRpb25cblx0XHRcdHRyYW5zaXRpb246IGFsbCAwLjFzIGxpbmVhcjtcblx0XHRcdCR7IHJlZHVjZU1vdGlvbiggJ3RyYW5zaXRpb24nICkgfTtcblx0XHR9XG5cblx0XHQmOmZvY3VzLXZpc2libGU6OmJlZm9yZSB7XG5cdFx0XHRib3gtc2hhZG93OiAwIDAgMCB2YXIoIC0td3AtYWRtaW4tYm9yZGVyLXdpZHRoLWZvY3VzIClcblx0XHRcdFx0JHsgQ09MT1JTLnRoZW1lLmFjY2VudCB9O1xuXG5cdFx0XHQvLyBXaW5kb3dzIGhpZ2ggY29udHJhc3QgbW9kZS5cblx0XHRcdG91dGxpbmU6IDJweCBzb2xpZCB0cmFuc3BhcmVudDtcblx0XHR9XG5cdH1cbmA7XG5cbmV4cG9ydCBjb25zdCBUYWJQYW5lbCA9IHN0eWxlZCggQXJpYWtpdC5UYWJQYW5lbCApYFxuXHQmOmZvY3VzIHtcblx0XHRib3gtc2hhZG93OiBub25lO1xuXHRcdG91dGxpbmU6IG5vbmU7XG5cdH1cblxuXHQmOmZvY3VzLXZpc2libGUge1xuXHRcdGJvcmRlci1yYWRpdXM6IDJweDtcblx0XHRib3gtc2hhZG93OiAwIDAgMCB2YXIoIC0td3AtYWRtaW4tYm9yZGVyLXdpZHRoLWZvY3VzIClcblx0XHRcdCR7IENPTE9SUy50aGVtZS5hY2NlbnQgfTtcblx0XHQvLyBXaW5kb3dzIGhpZ2ggY29udHJhc3QgbW9kZS5cblx0XHRvdXRsaW5lOiAycHggc29saWQgdHJhbnNwYXJlbnQ7XG5cdFx0b3V0bGluZS1vZmZzZXQ6IDA7XG5cdH1cbmA7XG4iXX0= */",
|
|
28
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
29
|
});
|
|
30
30
|
export const Tab = /*#__PURE__*/_styled(Ariakit.Tab, process.env.NODE_ENV === "production" ? {
|
|
31
|
+
target: "enfox0g1"
|
|
32
|
+
} : {
|
|
33
|
+
target: "enfox0g1",
|
|
34
|
+
label: "Tab"
|
|
35
|
+
})("&&{position:relative;border-radius:0;height:", space(12), ";background:transparent;border:none;box-shadow:none;cursor:pointer;padding:3px ", space(4), ";margin-left:0;font-weight:500;&[aria-disabled='true']{cursor:default;opacity:0.3;}&:focus:not( :disabled ){position:relative;box-shadow:none;outline:none;}&::after{content:'';position:absolute;right:0;bottom:0;left:0;pointer-events:none;background:", COLORS.theme.accent, ";height:calc( 0 * var( --wp-admin-border-width-focus ) );border-radius:0;transition:all 0.1s linear;", reduceMotion('transition'), ";}&[aria-selected='true']::after{height:calc( 1 * var( --wp-admin-border-width-focus ) );outline:2px solid transparent;outline-offset:-1px;}&::before{content:'';position:absolute;top:", space(3), ";right:", space(3), ";bottom:", space(3), ";left:", space(3), ";pointer-events:none;box-shadow:0 0 0 0 transparent;border-radius:2px;transition:all 0.1s linear;", reduceMotion('transition'), ";}&:focus-visible::before{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ", COLORS.theme.accent, ";outline:2px solid transparent;}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJ3QyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RhYnMvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXJlc3RyaWN0ZWQtaW1wb3J0c1xuaW1wb3J0ICogYXMgQXJpYWtpdCBmcm9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N1cyB7XG5cdFx0Ym94LXNoYWRvdzogbm9uZTtcblx0XHRvdXRsaW5lOiBub25lO1xuXHR9XG5cblx0Jjpmb2N1cy12aXNpYmxlIHtcblx0XHRib3JkZXItcmFkaXVzOiAycHg7XG5cdFx0Ym94LXNoYWRvdzogMCAwIDAgdmFyKCAtLXdwLWFkbWluLWJvcmRlci13aWR0aC1mb2N1cyApXG5cdFx0XHQkeyBDT0xPUlMudGhlbWUuYWNjZW50IH07XG5cdFx0Ly8gV2luZG93cyBoaWdoIGNvbnRyYXN0IG1vZGUuXG5cdFx0b3V0bGluZTogMnB4IHNvbGlkIHRyYW5zcGFyZW50O1xuXHRcdG91dGxpbmUtb2Zmc2V0OiAwO1xuXHR9XG5gO1xuIl19 */"));
|
|
36
|
+
export const TabPanel = /*#__PURE__*/_styled(Ariakit.TabPanel, process.env.NODE_ENV === "production" ? {
|
|
31
37
|
target: "enfox0g0"
|
|
32
38
|
} : {
|
|
33
39
|
target: "enfox0g0",
|
|
34
|
-
label: "
|
|
35
|
-
})("
|
|
40
|
+
label: "TabPanel"
|
|
41
|
+
})("&:focus{box-shadow:none;outline:none;}&:focus-visible{border-radius:2px;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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdGFicy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBd0drRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3RhYnMvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQ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5cdFx0fVxuXHR9XG5gO1xuXG5leHBvcnQgY29uc3QgVGFiUGFuZWwgPSBzdHlsZWQoIEFyaWFraXQuVGFiUGFuZWwgKWBcblx0Jjpmb2N1cyB7XG5cdFx0Ym94LXNoYWRvdzogbm9uZTtcblx0XHRvdXRsaW5lOiBub25lO1xuXHR9XG5cblx0Jjpmb2N1cy12aXNpYmxlIHtcblx0XHRib3JkZXItcmFkaXVzOiAycHg7XG5cdFx0Ym94LXNoYWRvdzogMCAwIDAgdmFyKCAtLXdwLWFkbWluLWJvcmRlci13aWR0aC1mb2N1cyApXG5cdFx0XHQkeyBDT0xPUlMudGhlbWUuYWNjZW50IH07XG5cdFx0Ly8gV2luZG93cyBoaWdoIGNvbnRyYXN0IG1vZGUuXG5cdFx0b3V0bGluZTogMnB4IHNvbGlkIHRyYW5zcGFyZW50O1xuXHRcdG91dGxpbmUtb2Zmc2V0OiAwO1xuXHR9XG5gO1xuIl19 */"));
|
|
36
42
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","COLORS","space","reduceMotion","TabListWrapper","_styled","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","Tab","theme","accent"],"sources":["@wordpress/components/src/tabs/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../utils';\nimport { space } from '../utils/space';\nimport { reduceMotion } from '../utils/reduce-motion';\n\nexport const TabListWrapper = styled.div`\n\tdisplay: flex;\n\talign-items: stretch;\n\tflex-direction: row;\n\t&[aria-orientation='vertical'] {\n\t\tflex-direction: column;\n\t}\n`;\n\nexport const Tab = styled( Ariakit.Tab )`\n\t&& {\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\tpadding: 3px ${ space( 4 ) }; // Use padding to offset the [aria-selected=\"true\"] border, this benefits Windows High Contrast mode\n\t\tmargin-left: 0;\n\t\tfont-weight: 500;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: default;\n\t\t\topacity: 0.3;\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// Tab indicator\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\tpointer-events: none;\n\n\t\t\t// Draw the indicator.\n\t\t\tbackground: ${ COLORS.theme.accent };\n\t\t\theight: calc( 0 * var( --wp-admin-border-width-focus ) );\n\t\t\tborder-radius: 0;\n\n\t\t\t// Animation\n\t\t\ttransition: all 0.1s linear;\n\t\t\t${ reduceMotion( 'transition' ) };\n\t\t}\n\n\t\t// Active.\n\t\t&[aria-selected='true']::after {\n\t\t\theight: calc( 1 * var( --wp-admin-border-width-focus ) );\n\n\t\t\t// Windows high contrast mode.\n\t\t\toutline: 2px solid transparent;\n\t\t\toutline-offset: -1px;\n\t\t}\n\n\t\t// Focus.\n\t\t&::before {\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\tbox-shadow: 0 0 0 0 transparent;\n\t\t\tborder-radius: 2px;\n\n\t\t\t// Animation\n\t\t\ttransition: all 0.1s linear;\n\t\t\t${ reduceMotion( 'transition' ) };\n\t\t}\n\n\t\t&:focus-visible::before {\n\t\t\tbox-shadow: 0 0 0 var( --wp-admin-border-width-focus )\n\t\t\t\t${ COLORS.theme.accent };\n\n\t\t\t// Windows high contrast mode.\n\t\t\toutline: 2px solid transparent;\n\t\t}\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,YAAY,QAAQ,wBAAwB;AAErD,OAAO,MAAMC,cAAc,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAO1B;AAED,OAAO,MAAMC,GAAG,GAAG,aAAAX,OAAA,CAAQL,OAAO,CAACgB,GAAG,EAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,iDAI3BR,KAAK,CAAE,EAAG,CAAC,qFAKNA,KAAK,CAAE,CAAE,CAAC,+PAyBVD,MAAM,CAACgB,KAAK,CAACC,MAAM,0GAM/Bf,YAAY,CAAE,YAAa,CAAC,6LAgBvBD,KAAK,CAAE,CAAE,CAAC,aACRA,KAAK,CAAE,CAAE,CAAC,cACTA,KAAK,CAAE,CAAE,CAAC,YACZA,KAAK,CAAE,CAAE,CAAC,uGAShBC,YAAY,CAAE,YAAa,CAAC,sFAK3BF,MAAM,CAACgB,KAAK,CAACC,MAAM,yCAAAZ,OAAA,CAAAC,GAAA,CAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["Ariakit","COLORS","space","reduceMotion","TabListWrapper","_styled","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","Tab","theme","accent","TabPanel"],"sources":["@wordpress/components/src/tabs/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../utils';\nimport { space } from '../utils/space';\nimport { reduceMotion } from '../utils/reduce-motion';\n\nexport const TabListWrapper = styled.div`\n\tdisplay: flex;\n\talign-items: stretch;\n\tflex-direction: row;\n\t&[aria-orientation='vertical'] {\n\t\tflex-direction: column;\n\t}\n`;\n\nexport const Tab = styled( Ariakit.Tab )`\n\t&& {\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\tpadding: 3px ${ space( 4 ) }; // Use padding to offset the [aria-selected=\"true\"] border, this benefits Windows High Contrast mode\n\t\tmargin-left: 0;\n\t\tfont-weight: 500;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: default;\n\t\t\topacity: 0.3;\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// Tab indicator\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\tpointer-events: none;\n\n\t\t\t// Draw the indicator.\n\t\t\tbackground: ${ COLORS.theme.accent };\n\t\t\theight: calc( 0 * var( --wp-admin-border-width-focus ) );\n\t\t\tborder-radius: 0;\n\n\t\t\t// Animation\n\t\t\ttransition: all 0.1s linear;\n\t\t\t${ reduceMotion( 'transition' ) };\n\t\t}\n\n\t\t// Active.\n\t\t&[aria-selected='true']::after {\n\t\t\theight: calc( 1 * var( --wp-admin-border-width-focus ) );\n\n\t\t\t// Windows high contrast mode.\n\t\t\toutline: 2px solid transparent;\n\t\t\toutline-offset: -1px;\n\t\t}\n\n\t\t// Focus.\n\t\t&::before {\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\tbox-shadow: 0 0 0 0 transparent;\n\t\t\tborder-radius: 2px;\n\n\t\t\t// Animation\n\t\t\ttransition: all 0.1s linear;\n\t\t\t${ reduceMotion( 'transition' ) };\n\t\t}\n\n\t\t&:focus-visible::before {\n\t\t\tbox-shadow: 0 0 0 var( --wp-admin-border-width-focus )\n\t\t\t\t${ COLORS.theme.accent };\n\n\t\t\t// Windows high contrast mode.\n\t\t\toutline: 2px solid transparent;\n\t\t}\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\tborder-radius: 2px;\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;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,YAAY,QAAQ,wBAAwB;AAErD,OAAO,MAAMC,cAAc,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAO1B;AAED,OAAO,MAAMC,GAAG,GAAG,aAAAX,OAAA,CAAQL,OAAO,CAACgB,GAAG,EAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,iDAI3BR,KAAK,CAAE,EAAG,CAAC,qFAKNA,KAAK,CAAE,CAAE,CAAC,+PAyBVD,MAAM,CAACgB,KAAK,CAACC,MAAM,0GAM/Bf,YAAY,CAAE,YAAa,CAAC,6LAgBvBD,KAAK,CAAE,CAAE,CAAC,aACRA,KAAK,CAAE,CAAE,CAAC,cACTA,KAAK,CAAE,CAAE,CAAC,YACZA,KAAK,CAAE,CAAE,CAAC,uGAShBC,YAAY,CAAE,YAAa,CAAC,sFAK3BF,MAAM,CAACgB,KAAK,CAACC,MAAM,yCAAAZ,OAAA,CAAAC,GAAA,CAAAC,QAAA,4gIAMzB;AAED,OAAO,MAAMW,QAAQ,GAAG,aAAAd,OAAA,CAAQL,OAAO,CAACmB,QAAQ,EAAAb,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,mIAS5CT,MAAM,CAACgB,KAAK,CAACC,MAAM,yDAAAZ,OAAA,CAAAC,GAAA,CAAAC,QAAA,4gIAKxB"}
|
package/build-module/tabs/tab.js
CHANGED
|
@@ -3,26 +3,25 @@ import { createElement } from "react";
|
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { forwardRef } from '@wordpress/element';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import warning from '@wordpress/warning';
|
|
13
|
-
import {
|
|
13
|
+
import { useTabsContext } from './context';
|
|
14
14
|
import { Tab as StyledTab } from './styles';
|
|
15
15
|
export const Tab = forwardRef(function Tab({
|
|
16
16
|
children,
|
|
17
17
|
id,
|
|
18
|
-
className,
|
|
19
18
|
disabled,
|
|
20
19
|
render,
|
|
21
|
-
|
|
20
|
+
...otherProps
|
|
22
21
|
}, ref) {
|
|
23
|
-
const context =
|
|
22
|
+
const context = useTabsContext();
|
|
24
23
|
if (!context) {
|
|
25
|
-
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning('`Tabs.
|
|
24
|
+
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning('`Tabs.Tab` must be wrapped in a `Tabs` component.') : void 0;
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
28
27
|
const {
|
|
@@ -34,10 +33,9 @@ export const Tab = forwardRef(function Tab({
|
|
|
34
33
|
ref: ref,
|
|
35
34
|
store: store,
|
|
36
35
|
id: instancedTabId,
|
|
37
|
-
className: className,
|
|
38
|
-
style: style,
|
|
39
36
|
disabled: disabled,
|
|
40
|
-
render: render
|
|
37
|
+
render: render,
|
|
38
|
+
...otherProps
|
|
41
39
|
}, children);
|
|
42
40
|
});
|
|
43
41
|
//# sourceMappingURL=tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["forwardRef","warning","useTabsContext","Tab","StyledTab","children","id","disabled","render","otherProps","ref","context","SCRIPT_DEBUG","store","instanceId","instancedTabId","createElement"],"sources":["@wordpress/components/src/tabs/tab.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabProps } from './types';\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport { Tab as StyledTab } from './styles';\nimport type { WordPressComponentProps } from '../context';\n\nexport const Tab = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< TabProps, 'button', false >\n>( function Tab( { children, id, disabled, render, ...otherProps }, ref ) {\n\tconst context = useTabsContext();\n\tif ( ! context ) {\n\t\twarning( '`Tabs.Tab` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\tconst { store, instanceId } = context;\n\tconst instancedTabId = `${ instanceId }-${ id }`;\n\treturn (\n\t\t<StyledTab\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\tid={ instancedTabId }\n\t\t\tdisabled={ disabled }\n\t\t\trender={ render }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledTab>\n\t);\n} );\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,GAAG,IAAIC,SAAS,QAAQ,UAAU;AAG3C,OAAO,MAAMD,GAAG,GAAGH,UAAU,CAG1B,SAASG,GAAGA,CAAE;EAAEE,QAAQ;EAAEC,EAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EACzE,MAAMC,OAAO,GAAGT,cAAc,CAAC,CAAC;EAChC,IAAK,CAAES,OAAO,EAAG;IAChB,OAAAC,YAAA,oBAAAA,YAAA,YAAAX,OAAO,CAAE,mDAAoD,CAAC;IAC9D,OAAO,IAAI;EACZ;EACA,MAAM;IAAEY,KAAK;IAAEC;EAAW,CAAC,GAAGH,OAAO;EACrC,MAAMI,cAAc,GAAI,GAAGD,UAAY,IAAIR,EAAI,EAAC;EAChD,OACCU,aAAA,CAACZ,SAAS;IACTM,GAAG,EAAGA,GAAK;IACXG,KAAK,EAAGA,KAAO;IACfP,EAAE,EAAGS,cAAgB;IACrBR,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IAAA,GACZC;EAAU,GAEbJ,QACQ,CAAC;AAEd,CAAE,CAAC"}
|
|
@@ -19,8 +19,7 @@ import { useTabsContext } from './context';
|
|
|
19
19
|
import { TabListWrapper } from './styles';
|
|
20
20
|
export const TabList = forwardRef(function TabList({
|
|
21
21
|
children,
|
|
22
|
-
|
|
23
|
-
style
|
|
22
|
+
...otherProps
|
|
24
23
|
}, ref) {
|
|
25
24
|
const context = useTabsContext();
|
|
26
25
|
if (!context) {
|
|
@@ -32,10 +31,9 @@ export const TabList = forwardRef(function TabList({
|
|
|
32
31
|
} = context;
|
|
33
32
|
return createElement(Ariakit.TabList, {
|
|
34
33
|
ref: ref,
|
|
35
|
-
style: style,
|
|
36
34
|
store: store,
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
render: createElement(TabListWrapper, null),
|
|
36
|
+
...otherProps
|
|
39
37
|
}, children);
|
|
40
38
|
});
|
|
41
39
|
//# sourceMappingURL=tablist.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","warning","forwardRef","useTabsContext","TabListWrapper","TabList","children","
|
|
1
|
+
{"version":3,"names":["Ariakit","warning","forwardRef","useTabsContext","TabListWrapper","TabList","children","otherProps","ref","context","SCRIPT_DEBUG","store","createElement","render"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport { useTabsContext } from './context';\nimport { TabListWrapper } from './styles';\nimport type { WordPressComponentProps } from '../context';\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst context = useTabsContext();\n\tif ( ! context ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\tconst { store } = context;\n\treturn (\n\t\t<Ariakit.TabList\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\trender={ <TabListWrapper /> }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Ariakit.TabList>\n\t);\n} );\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,cAAc,QAAQ,UAAU;AAGzC,OAAO,MAAMC,OAAO,GAAGH,UAAU,CAG9B,SAASG,OAAOA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EACvD,MAAMC,OAAO,GAAGN,cAAc,CAAC,CAAC;EAChC,IAAK,CAAEM,OAAO,EAAG;IAChB,OAAAC,YAAA,oBAAAA,YAAA,YAAAT,OAAO,CAAE,uDAAwD,CAAC;IAClE,OAAO,IAAI;EACZ;EACA,MAAM;IAAEU;EAAM,CAAC,GAAGF,OAAO;EACzB,OACCG,aAAA,CAACZ,OAAO,CAACK,OAAO;IACfG,GAAG,EAAGA,GAAK;IACXG,KAAK,EAAGA,KAAO;IACfE,MAAM,EAAGD,aAAA,CAACR,cAAc,MAAE,CAAG;IAAA,GACxBG;EAAU,GAEbD,QACc,CAAC;AAEpB,CAAE,CAAC"}
|
|
@@ -2,28 +2,27 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
|
-
// eslint-disable-next-line no-restricted-imports
|
|
6
|
-
import * as Ariakit from '@ariakit/react';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* WordPress dependencies
|
|
10
8
|
*/
|
|
11
9
|
|
|
12
|
-
import { forwardRef
|
|
10
|
+
import { forwardRef } from '@wordpress/element';
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* Internal dependencies
|
|
16
14
|
*/
|
|
17
15
|
|
|
16
|
+
import { TabPanel as StyledTabPanel } from './styles';
|
|
18
17
|
import warning from '@wordpress/warning';
|
|
19
|
-
import {
|
|
18
|
+
import { useTabsContext } from './context';
|
|
20
19
|
export const TabPanel = forwardRef(function TabPanel({
|
|
21
20
|
children,
|
|
22
21
|
id,
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
focusable = true,
|
|
23
|
+
...otherProps
|
|
25
24
|
}, ref) {
|
|
26
|
-
const context =
|
|
25
|
+
const context = useTabsContext();
|
|
27
26
|
if (!context) {
|
|
28
27
|
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning('`Tabs.TabPanel` must be wrapped in a `Tabs` component.') : void 0;
|
|
29
28
|
return null;
|
|
@@ -32,12 +31,12 @@ export const TabPanel = forwardRef(function TabPanel({
|
|
|
32
31
|
store,
|
|
33
32
|
instanceId
|
|
34
33
|
} = context;
|
|
35
|
-
return createElement(
|
|
34
|
+
return createElement(StyledTabPanel, {
|
|
36
35
|
ref: ref,
|
|
37
|
-
style: style,
|
|
38
36
|
store: store,
|
|
39
37
|
id: `${instanceId}-${id}-view`,
|
|
40
|
-
|
|
38
|
+
focusable: focusable,
|
|
39
|
+
...otherProps
|
|
41
40
|
}, children);
|
|
42
41
|
});
|
|
43
42
|
//# sourceMappingURL=tabpanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["forwardRef","TabPanel","StyledTabPanel","warning","useTabsContext","children","id","focusable","otherProps","ref","context","SCRIPT_DEBUG","store","instanceId","createElement"],"sources":["@wordpress/components/src/tabs/tabpanel.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\n\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabPanelProps } from './types';\nimport { TabPanel as StyledTabPanel } from './styles';\n\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport type { WordPressComponentProps } from '../context';\n\nexport const TabPanel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabPanelProps, 'div', false >\n>( function TabPanel( { children, id, focusable = true, ...otherProps }, ref ) {\n\tconst context = useTabsContext();\n\tif ( ! context ) {\n\t\twarning( '`Tabs.TabPanel` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\tconst { store, instanceId } = context;\n\n\treturn (\n\t\t<StyledTabPanel\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\tid={ `${ instanceId }-${ id }-view` }\n\t\t\tfocusable={ focusable }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledTabPanel>\n\t);\n} );\n"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,QAAQ,IAAIC,cAAc,QAAQ,UAAU;AAErD,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,cAAc,QAAQ,WAAW;AAG1C,OAAO,MAAMH,QAAQ,GAAGD,UAAU,CAG/B,SAASC,QAAQA,CAAE;EAAEI,QAAQ;EAAEC,EAAE;EAAEC,SAAS,GAAG,IAAI;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EAC9E,MAAMC,OAAO,GAAGN,cAAc,CAAC,CAAC;EAChC,IAAK,CAAEM,OAAO,EAAG;IAChB,OAAAC,YAAA,oBAAAA,YAAA,YAAAR,OAAO,CAAE,wDAAyD,CAAC;IACnE,OAAO,IAAI;EACZ;EACA,MAAM;IAAES,KAAK;IAAEC;EAAW,CAAC,GAAGH,OAAO;EAErC,OACCI,aAAA,CAACZ,cAAc;IACdO,GAAG,EAAGA,GAAK;IACXG,KAAK,EAAGA,KAAO;IACfN,EAAE,EAAI,GAAGO,UAAY,IAAIP,EAAI,OAAQ;IACrCC,SAAS,EAAGA,SAAW;IAAA,GAClBC;EAAU,GAEbH,QACa,CAAC;AAEnB,CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/tabs/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\n\
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/tabs/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\n\nexport type TabsContextProps =\n\t| {\n\t\t\t/**\n\t\t\t * The tabStore object returned by Ariakit's `useTabStore` hook.\n\t\t\t */\n\t\t\tstore: Ariakit.TabStore;\n\t\t\t/**\n\t\t\t * The unique id string for this instance of the Tabs component.\n\t\t\t */\n\t\t\tinstanceId: string;\n\t }\n\t| undefined;\n\nexport type TabsProps = {\n\t/**\n\t * The children elements, which should be at least a\n\t * `Tabs.Tablist` component and a series of `Tabs.TabPanel`\n\t * components.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * When `true`, the tab will be selected when receiving focus (automatic tab\n\t * activation). When `false`, the tab will be selected only when clicked\n\t * (manual tab activation). See the official W3C docs for more info.\n\t *\n\t * @default true\n\t *\n\t * @see https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/\n\t */\n\tselectOnMove?: boolean;\n\t/**\n\t * The id of the tab to be selected upon mounting of component.\n\t * If this prop is not set, the first tab will be selected by default.\n\t * The id provided will be internally prefixed with the\n\t * `TabsContextProps.instanceId`.\n\t *\n\t * Note: this prop will be overridden by the `selectedTabId` prop if it is\n\t * provided. (Controlled Mode)\n\t */\n\tinitialTabId?: string;\n\t/**\n\t * The function called when a tab has been selected.\n\t * It is passed the id of the newly selected tab as an argument.\n\t */\n\tonSelect?: ( selectedId: string | null | undefined ) => void;\n\n\t/**\n\t * The orientation of the tablist.\n\t *\n\t * @default `horizontal`\n\t */\n\torientation?: 'horizontal' | 'vertical';\n\t/**\n\t * The Id of the tab to display. This id is prepended with the `Tabs`\n\t * instanceId internally.\n\t *\n\t * If left `undefined`, the component assumes it is being used in\n\t * uncontrolled mode. Consequently, any value different than `undefined`\n\t * will set the component in `controlled` mode.\n\t * When in controlled mode, the `null` value will result in no tab being selected.\n\t */\n\tselectedTabId?: string | null;\n};\n\nexport type TabListProps = {\n\t/**\n\t * The children elements, which should be a series of `Tabs.TabPanel` components.\n\t */\n\tchildren?: React.ReactNode;\n};\n\nexport type TabProps = {\n\t/**\n\t * The id of the tab, which is prepended with the `Tabs` instanceId.\n\t */\n\tid: string;\n\t/**\n\t * The children elements, generally the text to display on the tab.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * Determines if the tab button should be disabled.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * The type of component to render the tab button as. If this prop is not\n\t * provided, the tab button will be rendered as a `button` element.\n\t */\n\trender?: React.ReactElement;\n};\n\nexport type TabPanelProps = {\n\t/**\n\t * The children elements, generally the content to display on the tabpanel.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * A unique identifier for the tabpanel, which is used to generate a unique `id` for the underlying element.\n\t */\n\tid: string;\n\t/**\n\t * Determines whether or not the tabpanel element should be focusable.\n\t * If `false`, pressing the tab key will skip over the tabpanel, and instead\n\t * focus on the first focusable element in the panel (if there is one).\n\t *\n\t * @default true\n\t */\n\tfocusable?: boolean;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/components/src/text/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { TruncateProps } from '../truncate/types';\n\n/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\nimport type { FindAllArgs } from 'highlight-words-core';\n\nexport type TextSize =\n\t| 'body'\n\t| 'caption'\n\t| 'footnote'\n\t| 'largeTitle'\n\t| 'subheadline'\n\t| 'title';\n\ntype TextVariant = 'muted';\n\ntype TextWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface Props extends TruncateProps {\n\t/**\n\t * Adjusts the text alignment.\n\t */\n\talign?: CSSProperties[ 'textAlign' ];\n\t/**\n\t * Automatically calculate the appropriate line-height value for contents that render text and Control elements (e.g. `TextInput`).\n\t */\n\tadjustLineHeightForInnerControls?: 'large' | 'medium' | 'small' | 'xSmall';\n\t/**\n\t * Adjusts the text color.\n\t */\n\tcolor?: CSSProperties[ 'color' ];\n\t/**\n\t * Adjusts the CSS display.\n\t */\n\tdisplay?: CSSProperties[ 'display' ];\n\t/**\n\t * Renders a destructive color.\n\t *\n\t * @default false\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Escape characters in `highlightWords` which are meaningful in regular expressions.\n\t */\n\thighlightEscape?: boolean;\n\t/**\n\t * Determines if `highlightWords` should be case sensitive.\n\t */\n\thighlightCaseSensitive?: boolean;\n\t/**\n\t * Array of search words. String search terms are automatically cast to RegExps unless `highlightEscape` is true.\n\t */\n\thighlightSanitize?: FindAllArgs[ 'sanitize' ];\n\t/**\n\t * Sets `Text` to have `display: block`.\n\t */\n\tisBlock?: boolean;\n\t/**\n\t * Adjusts all text line-height based on the typography system.\n\t */\n\tlineHeight?: CSSProperties[ 'lineHeight' ];\n\t/**\n\t * The `Text` color can be adapted to a background color for optimal readability. `optimizeReadabilityFor` can accept CSS variables, in addition to standard CSS color values (e.g. Hex, RGB, HSL, etc...).\n\t */\n\toptimizeReadabilityFor?: CSSProperties[ 'color' ];\n\t/**\n\t * Adjusts text size based on the typography system. `Text` can render a wide range of font sizes, which are automatically calculated and adapted to the typography system. The `size` value can be a system preset, a `number`, or a custom unit value (`string`) such as `30em`.\n\t */\n\tsize?: CSSProperties[ 'fontSize' ] | TextSize;\n\t/**\n\t * Enables text truncation. When `truncate` is set,we are able to truncate the long text in a variety of ways
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/components/src/text/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { TruncateProps } from '../truncate/types';\n\n/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\nimport type { FindAllArgs } from 'highlight-words-core';\n\nexport type TextSize =\n\t| 'body'\n\t| 'caption'\n\t| 'footnote'\n\t| 'largeTitle'\n\t| 'subheadline'\n\t| 'title';\n\ntype TextVariant = 'muted';\n\ntype TextWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface Props extends TruncateProps {\n\t/**\n\t * Adjusts the text alignment.\n\t */\n\talign?: CSSProperties[ 'textAlign' ];\n\t/**\n\t * Automatically calculate the appropriate line-height value for contents that render text and Control elements (e.g. `TextInput`).\n\t */\n\tadjustLineHeightForInnerControls?: 'large' | 'medium' | 'small' | 'xSmall';\n\t/**\n\t * Adjusts the text color.\n\t */\n\tcolor?: CSSProperties[ 'color' ];\n\t/**\n\t * Adjusts the CSS display.\n\t */\n\tdisplay?: CSSProperties[ 'display' ];\n\t/**\n\t * Renders a destructive color.\n\t *\n\t * @default false\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Escape characters in `highlightWords` which are meaningful in regular expressions.\n\t *\n\t * @default false\n\t */\n\thighlightEscape?: boolean;\n\t/**\n\t * Determines if `highlightWords` should be case sensitive.\n\t *\n\t * @default false\n\t */\n\thighlightCaseSensitive?: boolean;\n\t/**\n\t * Array of search words. String search terms are automatically cast to RegExps unless `highlightEscape` is true.\n\t */\n\thighlightSanitize?: FindAllArgs[ 'sanitize' ];\n\t/**\n\t * Sets `Text` to have `display: block`. Note: text truncation only works\n\t * when `isBlock` is `false`.\n\t *\n\t * @default false\n\t */\n\tisBlock?: boolean;\n\t/**\n\t * Adjusts all text line-height based on the typography system.\n\t */\n\tlineHeight?: CSSProperties[ 'lineHeight' ];\n\t/**\n\t * The `Text` color can be adapted to a background color for optimal readability. `optimizeReadabilityFor` can accept CSS variables, in addition to standard CSS color values (e.g. Hex, RGB, HSL, etc...).\n\t */\n\toptimizeReadabilityFor?: CSSProperties[ 'color' ];\n\t/**\n\t * Adjusts text size based on the typography system. `Text` can render a wide range of font sizes, which are automatically calculated and adapted to the typography system. The `size` value can be a system preset, a `number`, or a custom unit value (`string`) such as `30em`.\n\t */\n\tsize?: CSSProperties[ 'fontSize' ] | TextSize;\n\t/**\n\t * Enables text truncation. When `truncate` is set, we are able to truncate the long text in a variety of ways. Note: text truncation won't work if the `isBlock` property is set to `true`\n\t *\n\t * @default false\n\t */\n\ttruncate?: boolean;\n\t/**\n\t * Uppercases the text content.\n\t *\n\t * @default false\n\t */\n\tupperCase?: boolean;\n\t/**\n\t * Adjusts style variation of the text.\n\t */\n\tvariant?: TextVariant;\n\t/**\n\t * Adjusts font-weight of the text.\n\t *\n\t * @default 'normal'\n\t */\n\tweight?: CSSProperties[ 'fontWeight' ] | TextWeight;\n\t/**\n\t * Adjusts letter-spacing of the text.\n\t */\n\tletterSpacing?: CSSProperties[ 'letterSpacing' ];\n\t/**\n\t * Letters or words within `Text` can be highlighted using `highlightWords`.\n\t */\n\thighlightWords?: string[];\n}\n"],"mappings":""}
|
|
@@ -3,6 +3,8 @@ import { createElement } from "react";
|
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import classnames from 'classnames';
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* WordPress dependencies
|
|
8
10
|
*/
|
|
@@ -16,6 +18,7 @@ import BaseControl from '../base-control';
|
|
|
16
18
|
function UnforwardedTextControl(props, ref) {
|
|
17
19
|
const {
|
|
18
20
|
__nextHasNoMarginBottom,
|
|
21
|
+
__next40pxDefaultSize = false,
|
|
19
22
|
label,
|
|
20
23
|
hideLabelFromVision,
|
|
21
24
|
value,
|
|
@@ -36,7 +39,9 @@ function UnforwardedTextControl(props, ref) {
|
|
|
36
39
|
help: help,
|
|
37
40
|
className: className
|
|
38
41
|
}, createElement("input", {
|
|
39
|
-
className:
|
|
42
|
+
className: classnames('components-text-control__input', {
|
|
43
|
+
'is-next-40px-default-size': __next40pxDefaultSize
|
|
44
|
+
}),
|
|
40
45
|
type: type,
|
|
41
46
|
id: id,
|
|
42
47
|
value: value,
|