@wordpress/components 27.2.0 → 27.3.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 +24 -0
- package/README.md +13 -0
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/color-picker/component.js +2 -12
- package/build/color-picker/component.js.map +1 -1
- package/build/color-picker/picker.js +18 -77
- package/build/color-picker/picker.js.map +1 -1
- package/build/color-picker/types.js.map +1 -1
- package/build/custom-select-control-v2/default-component/index.js +4 -2
- package/build/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build/custom-select-control-v2/index.js +1 -8
- package/build/custom-select-control-v2/index.js.map +1 -1
- package/build/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
- package/build/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +5 -5
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build/input-control/input-field.js +2 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/mobile/color-settings/palette.screen.native.js +1 -0
- package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build/navigable-container/container.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +162 -120
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +2 -2
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/popover/index.js +7 -34
- package/build/popover/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/color-picker/component.js +3 -13
- package/build-module/color-picker/component.js.map +1 -1
- package/build-module/color-picker/picker.js +19 -78
- package/build-module/color-picker/picker.js.map +1 -1
- package/build-module/color-picker/types.js.map +1 -1
- package/build-module/custom-select-control-v2/default-component/index.js +4 -2
- package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
- package/build-module/custom-select-control-v2/index.js +1 -2
- package/build-module/custom-select-control-v2/index.js.map +1 -1
- package/build-module/custom-select-control-v2/{custom-select-item.js → item.js} +2 -1
- package/build-module/custom-select-control-v2/{custom-select-item.js.map → item.js.map} +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +4 -4
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build-module/input-control/input-field.js +2 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
- package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
- package/build-module/navigable-container/container.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +163 -121
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +2 -2
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/popover/index.js +9 -36
- package/build-module/popover/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +29 -29
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +2 -2
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-style/style-rtl.css +2 -8
- package/build-style/style.css +2 -8
- package/build-types/color-picker/component.d.ts.map +1 -1
- package/build-types/color-picker/picker.d.ts +1 -1
- package/build-types/color-picker/picker.d.ts.map +1 -1
- package/build-types/color-picker/types.d.ts +0 -3
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +35 -0
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/default-component/index.d.ts +5 -2
- package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/index.d.ts +1 -2
- package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/{custom-select-item.d.ts → item.d.ts} +4 -1
- package/build-types/custom-select-control-v2/item.d.ts.map +1 -0
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts +2 -2
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/default.story.d.ts +2 -2
- package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +4 -2
- package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +1 -1
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/button/index.tsx +1 -1
- package/src/color-picker/component.tsx +3 -25
- package/src/color-picker/picker.tsx +12 -96
- package/src/color-picker/types.ts +0 -3
- package/src/custom-select-control/stories/{index.story.js → index.story.tsx} +8 -3
- package/src/custom-select-control/test/index.js +24 -0
- package/src/custom-select-control-v2/README.md +27 -27
- package/src/custom-select-control-v2/default-component/index.tsx +5 -2
- package/src/custom-select-control-v2/index.tsx +1 -2
- package/src/custom-select-control-v2/{custom-select-item.tsx → item.tsx} +2 -0
- package/src/custom-select-control-v2/legacy-component/index.tsx +4 -6
- package/src/custom-select-control-v2/legacy-component/test/index.tsx +13 -10
- package/src/custom-select-control-v2/stories/default.story.tsx +16 -17
- package/src/custom-select-control-v2/stories/legacy.story.tsx +20 -35
- package/src/custom-select-control-v2/test/index.tsx +26 -16
- package/src/dropdown/style.scss +3 -3
- package/src/input-control/input-field.tsx +2 -1
- package/src/mobile/color-settings/palette.screen.native.js +5 -1
- package/src/navigable-container/container.tsx +1 -1
- package/src/navigator/navigator-provider/component.tsx +187 -188
- package/src/navigator/navigator-screen/component.tsx +2 -4
- package/src/popover/index.tsx +59 -99
- package/src/popover/style.scss +0 -9
- package/src/range-control/styles/range-control-styles.ts +1 -1
- package/src/text-control/style.scss +2 -0
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +2 -2
- package/src/toolbar/toolbar/style.scss +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build-types/custom-select-control-v2/custom-select-item.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","_styled","target","label","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","thumbColor","theme","accent","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","InputNumber","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo: Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,gBAAgB;AAGpC;AACA;AACA;AACA,OAAOC,aAAa,MAAM,sBAAsB;AAChD,SAASC,MAAM,EAAEC,YAAY,EAAEC,GAAG,QAAQ,aAAa;AACvD,SAASC,KAAK,QAAQ,mBAAmB;AAYzC,MAAMC,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,W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,CAAQjB,aAAa,EAAAU,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAM,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,4EAM7CZ,WAAW,QAGZJ,GAAG,CAAE;EAAE8B,UAAU,EAAG,GAAG7B,KAAK,CAAE,CAAE,CAAG;AAAa,CAAE,CAAC,SAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,ohUACtD;AAED,OAAO,MAAM+D,kBAAkB,GAAA1D,OAAA,SAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAM,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,uEAO1BZ,WAAW,QAGZJ,GAAG,CAAE;EAAE8B,UAAU,EAAE;AAAE,CAAE,CAAC,SAAAvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ohUAC3B"}
|
|
1
|
+
{"version":3,"names":["css","NumberControl","COLORS","reduceMotion","rtl","space","rangeHeightValue","railHeight","rangeHeight","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","_styled","target","label","wrapperColor","color","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","thumbColor","theme","accent","ThumbWrapper","transform","thumbFocus","isFocused","Thumb","InputRange","tooltipShow","show","opacity","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","InputNumber","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, reduceMotion, rtl } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ railHeight }px;\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ railHeight }px;\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: -4px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 12px;\n\ttransform: translateX( -50% );\n\twhite-space: nowrap;\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: 50%;\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: 50%;\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\ttransition: opacity 120ms ease;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ reduceMotion( 'transition' ) };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 }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AAA,MAAA;EAAAC,KAAA;AAAA,yQAgBhB8C,WAAW,OACXK,eAAe,OACfpE,YAAY,CAAE,YAAa,CAAC,OAC5BC,GAAG,CACL;EAAEyD,SAAS,EAAE;AAAmB,CAAC,EACjC;EAAEA,SAAS,EAAE;AAAkB,CAChC,CAAC,SAAAlD,OAAA,CAAAC,GAAA,CAAAC,QAAA,ohUACD;;AAED;AACA;AACA,OAAO,MAAM8D,WAAW,GAAG,aAAAzD,OAAA,CAAQjB,aAAa,EAAAU,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAM,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,4EAM7CZ,WAAW,QAGZJ,GAAG,CAAE;EAAE8B,UAAU,EAAG,GAAG7B,KAAK,CAAE,CAAE,CAAG;AAAa,CAAE,CAAC,SAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,ohUACtD;AAED,OAAO,MAAM+D,kBAAkB,GAAA1D,OAAA,SAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAM,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,uEAO1BZ,WAAW,QAGZJ,GAAG,CAAE;EAAE8B,UAAU,EAAE;AAAE,CAAE,CAAC,SAAAvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,ohUAC3B"}
|
|
@@ -6,12 +6,12 @@ import { createElement, Fragment } from "react";
|
|
|
6
6
|
// eslint-disable-next-line no-restricted-imports
|
|
7
7
|
import * as Ariakit from '@ariakit/react';
|
|
8
8
|
// eslint-disable-next-line no-restricted-imports
|
|
9
|
-
import { motion
|
|
9
|
+
import { motion } from 'framer-motion';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
14
|
+
import { useReducedMotion, useInstanceId } from '@wordpress/compose';
|
|
15
15
|
import { useMemo } from '@wordpress/element';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Ariakit","motion","useReducedMotion","useInstanceId","useMemo","contextConnect","useContextSystem","useToggleGroupControlContext","styles","useCx","Tooltip","ButtonContentView","LabelView","REDUCED_MOTION_TRANSITION_CONFIG","duration","LAYOUT_ID","WithToolTip","showTooltip","text","children","createElement","placement","Fragment","ToggleGroupControlOptionBase","props","forwardedRef","shouldReduceMotion","toggleGroupControlContext","id","baseId","buttonProps","isBlock","isDeselectable","size","className","isIcon","value","onFocus","onFocusProp","otherButtonProps","isPressed","cx","labelViewClasses","labelBlock","itemClasses","buttonView","backdropClasses","backdropView","buttonOnClick","setValue","undefined","commonProps","ref","type","onClick","Radio","render","event","defaultPrevented","div","layout","layoutRoot","transition","role","layoutId","ConnectedToggleGroupControlOptionBase"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option-base/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion
|
|
1
|
+
{"version":3,"names":["Ariakit","motion","useReducedMotion","useInstanceId","useMemo","contextConnect","useContextSystem","useToggleGroupControlContext","styles","useCx","Tooltip","ButtonContentView","LabelView","REDUCED_MOTION_TRANSITION_CONFIG","duration","LAYOUT_ID","WithToolTip","showTooltip","text","children","createElement","placement","Fragment","ToggleGroupControlOptionBase","props","forwardedRef","shouldReduceMotion","toggleGroupControlContext","id","baseId","buttonProps","isBlock","isDeselectable","size","className","isIcon","value","onFocus","onFocusProp","otherButtonProps","isPressed","cx","labelViewClasses","labelBlock","itemClasses","buttonView","backdropClasses","backdropView","buttonOnClick","setValue","undefined","commonProps","ref","type","onClick","Radio","render","event","defaultPrevented","div","layout","layoutRoot","transition","role","layoutId","ConnectedToggleGroupControlOptionBase"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option-base/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useInstanceId } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport type {\n\tToggleGroupControlOptionBaseProps,\n\tWithToolTipProps,\n} from '../types';\nimport { useToggleGroupControlContext } from '../context';\nimport * as styles from './styles';\nimport { useCx } from '../../utils/hooks';\nimport Tooltip from '../../tooltip';\n\nconst { ButtonContentView, LabelView } = styles;\n\nconst REDUCED_MOTION_TRANSITION_CONFIG = {\n\tduration: 0,\n};\n\nconst LAYOUT_ID = 'toggle-group-backdrop-shared-layout-id';\n\nconst WithToolTip = ( { showTooltip, text, children }: WithToolTipProps ) => {\n\tif ( showTooltip && text ) {\n\t\treturn (\n\t\t\t<Tooltip text={ text } placement=\"top\">\n\t\t\t\t{ children }\n\t\t\t</Tooltip>\n\t\t);\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction ToggleGroupControlOptionBase(\n\tprops: Omit<\n\t\tWordPressComponentProps<\n\t\t\tToggleGroupControlOptionBaseProps,\n\t\t\t'button',\n\t\t\tfalse\n\t\t>,\n\t\t// the element's id is generated internally\n\t\t'id'\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst toggleGroupControlContext = useToggleGroupControlContext();\n\n\tconst id = useInstanceId(\n\t\tToggleGroupControlOptionBase,\n\t\ttoggleGroupControlContext.baseId || 'toggle-group-control-option-base'\n\t);\n\n\tconst buttonProps = useContextSystem(\n\t\t{ ...props, id },\n\t\t'ToggleGroupControlOptionBase'\n\t);\n\n\tconst {\n\t\tisBlock = false,\n\t\tisDeselectable = false,\n\t\tsize = 'default',\n\t} = toggleGroupControlContext;\n\n\tconst {\n\t\tclassName,\n\t\tisIcon = false,\n\t\tvalue,\n\t\tchildren,\n\t\tshowTooltip = false,\n\t\tonFocus: onFocusProp,\n\t\t...otherButtonProps\n\t} = buttonProps;\n\n\tconst isPressed = toggleGroupControlContext.value === value;\n\tconst cx = useCx();\n\tconst labelViewClasses = useMemo(\n\t\t() => cx( isBlock && styles.labelBlock ),\n\t\t[ cx, isBlock ]\n\t);\n\tconst itemClasses = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tstyles.buttonView( {\n\t\t\t\t\tisDeselectable,\n\t\t\t\t\tisIcon,\n\t\t\t\t\tisPressed,\n\t\t\t\t\tsize,\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ cx, isDeselectable, isIcon, isPressed, size, className ]\n\t);\n\tconst backdropClasses = useMemo( () => cx( styles.backdropView ), [ cx ] );\n\n\tconst buttonOnClick = () => {\n\t\tif ( isDeselectable && isPressed ) {\n\t\t\ttoggleGroupControlContext.setValue( undefined );\n\t\t} else {\n\t\t\ttoggleGroupControlContext.setValue( value );\n\t\t}\n\t};\n\n\tconst commonProps = {\n\t\t...otherButtonProps,\n\t\tclassName: itemClasses,\n\t\t'data-value': value,\n\t\tref: forwardedRef,\n\t};\n\n\treturn (\n\t\t<LabelView className={ labelViewClasses }>\n\t\t\t<WithToolTip\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\ttext={ otherButtonProps[ 'aria-label' ] }\n\t\t\t>\n\t\t\t\t{ isDeselectable ? (\n\t\t\t\t\t<button\n\t\t\t\t\t\t{ ...commonProps }\n\t\t\t\t\t\tonFocus={ onFocusProp }\n\t\t\t\t\t\taria-pressed={ isPressed }\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={ buttonOnClick }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ButtonContentView>{ children }</ButtonContentView>\n\t\t\t\t\t</button>\n\t\t\t\t) : (\n\t\t\t\t\t<Ariakit.Radio\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t{ ...commonProps }\n\t\t\t\t\t\t\t\tonFocus={ ( event ) => {\n\t\t\t\t\t\t\t\t\tonFocusProp?.( event );\n\t\t\t\t\t\t\t\t\tif ( event.defaultPrevented ) return;\n\t\t\t\t\t\t\t\t\ttoggleGroupControlContext.setValue( value );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ButtonContentView>{ children }</ButtonContentView>\n\t\t\t\t\t</Ariakit.Radio>\n\t\t\t\t) }\n\t\t\t</WithToolTip>\n\t\t\t{ /* Animated backdrop using framer motion's shared layout animation */ }\n\t\t\t{ isPressed ? (\n\t\t\t\t<motion.div layout layoutRoot>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName={ backdropClasses }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tshouldReduceMotion\n\t\t\t\t\t\t\t\t? REDUCED_MOTION_TRANSITION_CONFIG\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\tlayoutId={ LAYOUT_ID }\n\t\t\t\t\t/>\n\t\t\t\t</motion.div>\n\t\t\t) : null }\n\t\t</LabelView>\n\t);\n}\n\n/**\n * `ToggleGroupControlOptionBase` is a form component and is meant to be used as an internal,\n * generic component for any children of `ToggleGroupControl`.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOptionBase as ToggleGroupControlOptionBase,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl label=\"my label\" value=\"vertical\" isBlock>\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nconst ConnectedToggleGroupControlOptionBase = contextConnect(\n\tToggleGroupControlOptionBase,\n\t'ToggleGroupControlOptionBase'\n);\n\nexport default ConnectedToggleGroupControlOptionBase;\n"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC;AACA,SAASC,MAAM,QAAQ,eAAe;;AAEtC;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,oBAAoB;AACpE,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;;AAEA,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,eAAe;AAKhE,SAASC,4BAA4B,QAAQ,YAAY;AACzD,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,OAAOC,OAAO,MAAM,eAAe;AAEnC,MAAM;EAAEC,iBAAiB;EAAEC;AAAU,CAAC,GAAGJ,MAAM;AAE/C,MAAMK,gCAAgC,GAAG;EACxCC,QAAQ,EAAE;AACX,CAAC;AAED,MAAMC,SAAS,GAAG,wCAAwC;AAE1D,MAAMC,WAAW,GAAGA,CAAE;EAAEC,WAAW;EAAEC,IAAI;EAAEC;AAA2B,CAAC,KAAM;EAC5E,IAAKF,WAAW,IAAIC,IAAI,EAAG;IAC1B,OACCE,aAAA,CAACV,OAAO;MAACQ,IAAI,EAAGA,IAAM;MAACG,SAAS,EAAC;IAAK,GACnCF,QACM,CAAC;EAEZ;EACA,OAAOC,aAAA,CAAAE,QAAA,QAAIH,QAAY,CAAC;AACzB,CAAC;AAED,SAASI,4BAA4BA,CACpCC,KAQC,EACDC,YAAiC,EAChC;EACD,MAAMC,kBAAkB,GAAGxB,gBAAgB,CAAC,CAAC;EAC7C,MAAMyB,yBAAyB,GAAGpB,4BAA4B,CAAC,CAAC;EAEhE,MAAM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AAC,GACV,IACM,CAAC;AAEd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMkD,qCAAqC,GAAG5D,cAAc,CAC3DkB,4BAA4B,EAC5B,8BACD,CAAC;AAED,eAAe0C,qCAAqC"}
|
|
@@ -1218,7 +1218,7 @@ body.is-dragging-components-draggable {
|
|
|
1218
1218
|
border-top: 1px solid #ccc;
|
|
1219
1219
|
padding: 8px;
|
|
1220
1220
|
}
|
|
1221
|
-
.is-alternate .components-
|
|
1221
|
+
.components-dropdown__content.is-alternate .components-menu-group + .components-menu-group {
|
|
1222
1222
|
border-color: #1e1e1e;
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
@@ -2599,13 +2599,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2599
2599
|
stroke: #1e1e1e;
|
|
2600
2600
|
}
|
|
2601
2601
|
|
|
2602
|
-
.components-popover-pointer-events-trap {
|
|
2603
|
-
z-index: 1000000;
|
|
2604
|
-
position: fixed;
|
|
2605
|
-
inset: 0;
|
|
2606
|
-
background-color: transparent;
|
|
2607
|
-
}
|
|
2608
|
-
|
|
2609
2602
|
.components-radio-control__option {
|
|
2610
2603
|
display: flex;
|
|
2611
2604
|
align-items: center;
|
|
@@ -3083,6 +3076,7 @@ body.lockscroll {
|
|
|
3083
3076
|
.components-text-control__input[type=number] {
|
|
3084
3077
|
width: 100%;
|
|
3085
3078
|
height: 32px;
|
|
3079
|
+
margin: 0;
|
|
3086
3080
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3087
3081
|
padding: 6px 8px;
|
|
3088
3082
|
box-shadow: 0 0 0 transparent;
|
package/build-style/style.css
CHANGED
|
@@ -1223,7 +1223,7 @@ body.is-dragging-components-draggable {
|
|
|
1223
1223
|
border-top: 1px solid #ccc;
|
|
1224
1224
|
padding: 8px;
|
|
1225
1225
|
}
|
|
1226
|
-
.is-alternate .components-
|
|
1226
|
+
.components-dropdown__content.is-alternate .components-menu-group + .components-menu-group {
|
|
1227
1227
|
border-color: #1e1e1e;
|
|
1228
1228
|
}
|
|
1229
1229
|
|
|
@@ -2608,13 +2608,6 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
|
|
|
2608
2608
|
stroke: #1e1e1e;
|
|
2609
2609
|
}
|
|
2610
2610
|
|
|
2611
|
-
.components-popover-pointer-events-trap {
|
|
2612
|
-
z-index: 1000000;
|
|
2613
|
-
position: fixed;
|
|
2614
|
-
inset: 0;
|
|
2615
|
-
background-color: transparent;
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
2611
|
.components-radio-control__option {
|
|
2619
2612
|
display: flex;
|
|
2620
2613
|
align-items: center;
|
|
@@ -3095,6 +3088,7 @@ body.lockscroll {
|
|
|
3095
3088
|
.components-text-control__input[type=number] {
|
|
3096
3089
|
width: 100%;
|
|
3097
3090
|
height: 32px;
|
|
3091
|
+
margin: 0;
|
|
3098
3092
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
3099
3093
|
padding: 6px 8px;
|
|
3100
3094
|
box-shadow: 0 0 0 transparent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/color-picker/component.tsx"],"names":[],"mappings":";AAmCA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/color-picker/component.tsx"],"names":[],"mappings":";AAmCA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAC;AA2F3D,eAAO,MAAM,WAAW;;;;;;wTAGvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Internal dependencies
|
|
4
4
|
*/
|
|
5
5
|
import type { PickerProps } from './types';
|
|
6
|
-
export declare const Picker: ({ color, enableAlpha, onChange
|
|
6
|
+
export declare const Picker: ({ color, enableAlpha, onChange }: PickerProps) => JSX.Element;
|
|
7
7
|
//# sourceMappingURL=picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../src/color-picker/picker.tsx"],"names":[],"mappings":";AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../src/color-picker/picker.tsx"],"names":[],"mappings":";AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,MAAM,qCAAuC,WAAW,gBAwBpE,CAAC"}
|
|
@@ -44,9 +44,6 @@ export interface PickerProps {
|
|
|
44
44
|
color: Colord;
|
|
45
45
|
enableAlpha: boolean;
|
|
46
46
|
onChange: (nextColor: Colord) => void;
|
|
47
|
-
containerEl: HTMLElement | null;
|
|
48
|
-
onDragStart?: (event: MouseEvent) => void;
|
|
49
|
-
onDragEnd?: (event: MouseEvent) => void;
|
|
50
47
|
}
|
|
51
48
|
export interface ColorInputProps {
|
|
52
49
|
colorType: 'hsl' | 'hex' | 'rgb';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/color-picker/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD;;GAEG;AACH,OAAO,KAAK,EAAE,u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*/
|
|
8
|
+
import CustomSelectControl from '..';
|
|
9
|
+
declare const _default: {
|
|
10
|
+
title: string;
|
|
11
|
+
component: typeof CustomSelectControl;
|
|
12
|
+
argTypes: {
|
|
13
|
+
__next40pxDefaultSize: {
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
__experimentalShowSelectedHint: {
|
|
19
|
+
control: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
size: {
|
|
24
|
+
options: string[];
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
32
|
+
export declare const Default: StoryFn;
|
|
33
|
+
export declare const WithLongLabels: StoryFn;
|
|
34
|
+
export declare const WithHints: StoryFn;
|
|
35
|
+
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,mBAAmB,MAAM,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAaE;AAEF,eAAO,MAAM,OAAO,EAAE,OAAwC,CAAC;AA4B/D,eAAO,MAAM,cAAc,EAAE,OAAwC,CAAC;AAmBtE,eAAO,MAAM,SAAS,EAAE,OAAwC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CustomSelectProps } from '../types';
|
|
3
3
|
import type { WordPressComponentProps } from '../../context';
|
|
4
|
-
declare function
|
|
5
|
-
|
|
4
|
+
declare function CustomSelectControlV2(props: WordPressComponentProps<CustomSelectProps, 'button', false>): JSX.Element;
|
|
5
|
+
declare namespace CustomSelectControlV2 {
|
|
6
|
+
var Item: typeof import("../item").CustomSelectItem;
|
|
7
|
+
}
|
|
8
|
+
export default CustomSelectControlV2;
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/default-component/index.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/default-component/index.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,iBAAS,qBAAqB,CAC7B,KAAK,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,CAAE,eAWpE;kBAZQ,qBAAqB;;;AAgB9B,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
import type { CustomSelectItemProps } from './types';
|
|
6
6
|
import type { WordPressComponentProps } from '../context';
|
|
7
7
|
export declare function CustomSelectItem({ children, ...props }: WordPressComponentProps<CustomSelectItemProps, 'div', false>): JSX.Element;
|
|
8
|
+
export declare namespace CustomSelectItem {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
8
11
|
export default CustomSelectItem;
|
|
9
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/item.tsx"],"names":[],"mappings":";AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAI1D,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,CAAE,eAUhE;yBAbe,gBAAgB;;;AAiBhC,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { LegacyCustomSelectProps } from '../types';
|
|
3
|
-
declare function
|
|
4
|
-
export default
|
|
3
|
+
declare function CustomSelectControl(props: LegacyCustomSelectProps): JSX.Element;
|
|
4
|
+
export default CustomSelectControl;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/legacy-component/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/legacy-component/index.tsx"],"names":[],"mappings":";AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAIxD,iBAAS,mBAAmB,CAAE,KAAK,EAAE,uBAAuB,eA8G3D;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import type { Meta } from '@storybook/react';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
10
|
-
declare const meta: Meta<typeof
|
|
9
|
+
import CustomSelectControlV2 from '..';
|
|
10
|
+
declare const meta: Meta<typeof CustomSelectControlV2>;
|
|
11
11
|
export default meta;
|
|
12
12
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../types")._CustomSelectProps & Omit<import("../types").CustomSelectButtonProps, "size"> & {
|
|
13
13
|
size?: "default" | "compact" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/default.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"default.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/default.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,qBAAqB,MAAM,IAAI,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,qBAAqB,CA+B7C,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO;;kUAAsB,CAAC;AAmB3C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;kUAAsB,CAAC;AAoCrD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;kUAAsB,CAAC"}
|
|
@@ -5,8 +5,10 @@ import type { Meta } from '@storybook/react';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
declare const meta: Meta<typeof
|
|
8
|
+
import CustomSelectControl from '../legacy-component';
|
|
9
|
+
declare const meta: Meta<typeof CustomSelectControl>;
|
|
10
10
|
export default meta;
|
|
11
11
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../types").LegacyCustomSelectProps>;
|
|
12
|
+
export declare const WithLongLabels: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../types").LegacyCustomSelectProps>;
|
|
13
|
+
export declare const WithHints: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("../types").LegacyCustomSelectProps>;
|
|
12
14
|
//# sourceMappingURL=legacy.story.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/legacy.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"legacy.story.d.ts","sourceRoot":"","sources":["../../../src/custom-select-control-v2/stories/legacy.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,mBAAmB,MAAM,qBAAqB,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,mBAAmB,CA0B3C,CAAC;AACF,eAAe,IAAI,CAAC;AAqBpB,eAAO,MAAM,OAAO,2IAAsB,CAAC;AAG3C,eAAO,MAAM,cAAc,2IAAsB,CAAC;AAGlD,eAAO,MAAM,SAAS,2IAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../src/input-control/input-field.tsx"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../src/input-control/input-field.tsx"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAoN/C,QAAA,MAAM,kBAAkB,uVAA2B,CAAC;AAEpD,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/component.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-provider/component.tsx"],"names":[],"mappings":";AAqBA,OAAO,KAAK,EACX,sBAAsB,EAMtB,MAAM,UAAU,CAAC;AA0OlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,iBAAiB,sHAG7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/component.tsx"],"names":[],"mappings":";AA6BA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/navigator/navigator-screen/component.tsx"],"names":[],"mappings":";AA6BA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AA+GrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,eAAe,qHAG3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":";AAyDA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACX,YAAY,EAGZ,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAY,CAAC;AAiZnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO,knCAAkD,CAAC;AAqBvE,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.3.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -42,27 +42,27 @@
|
|
|
42
42
|
"@types/gradient-parser": "0.1.3",
|
|
43
43
|
"@types/highlight-words-core": "1.2.1",
|
|
44
44
|
"@use-gesture/react": "^10.2.24",
|
|
45
|
-
"@wordpress/a11y": "^3.
|
|
46
|
-
"@wordpress/compose": "^6.
|
|
47
|
-
"@wordpress/date": "^4.
|
|
48
|
-
"@wordpress/deprecated": "^3.
|
|
49
|
-
"@wordpress/dom": "^3.
|
|
50
|
-
"@wordpress/element": "^5.
|
|
51
|
-
"@wordpress/escape-html": "^2.
|
|
52
|
-
"@wordpress/hooks": "^3.
|
|
53
|
-
"@wordpress/html-entities": "^3.
|
|
54
|
-
"@wordpress/i18n": "^4.
|
|
55
|
-
"@wordpress/icons": "^9.
|
|
56
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
57
|
-
"@wordpress/keycodes": "^3.
|
|
58
|
-
"@wordpress/primitives": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/rich-text": "^6.
|
|
61
|
-
"@wordpress/warning": "^2.
|
|
45
|
+
"@wordpress/a11y": "^3.55.0",
|
|
46
|
+
"@wordpress/compose": "^6.32.0",
|
|
47
|
+
"@wordpress/date": "^4.55.0",
|
|
48
|
+
"@wordpress/deprecated": "^3.55.0",
|
|
49
|
+
"@wordpress/dom": "^3.55.0",
|
|
50
|
+
"@wordpress/element": "^5.32.0",
|
|
51
|
+
"@wordpress/escape-html": "^2.55.0",
|
|
52
|
+
"@wordpress/hooks": "^3.55.0",
|
|
53
|
+
"@wordpress/html-entities": "^3.55.0",
|
|
54
|
+
"@wordpress/i18n": "^4.55.0",
|
|
55
|
+
"@wordpress/icons": "^9.46.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^4.55.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.55.0",
|
|
58
|
+
"@wordpress/primitives": "^3.53.0",
|
|
59
|
+
"@wordpress/private-apis": "^0.37.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.32.0",
|
|
61
|
+
"@wordpress/warning": "^2.55.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
65
|
-
"date-fns": "^
|
|
65
|
+
"date-fns": "^3.6.0",
|
|
66
66
|
"deepmerge": "^4.3.0",
|
|
67
67
|
"downshift": "^6.0.15",
|
|
68
68
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"re-resizable": "^6.4.0",
|
|
76
76
|
"react-colorful": "^5.3.1",
|
|
77
77
|
"remove-accents": "^0.5.0",
|
|
78
|
-
"use-lilius": "^2.0.
|
|
78
|
+
"use-lilius": "^2.0.5",
|
|
79
79
|
"uuid": "^9.0.1",
|
|
80
80
|
"valtio": "1.7.0"
|
|
81
81
|
},
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
|
|
90
90
|
}
|
package/src/button/index.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import namesPlugin from 'colord/plugins/names';
|
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { useCallback, useState, useMemo } from '@wordpress/element';
|
|
13
|
-
import { useDebounce
|
|
13
|
+
import { useDebounce } from '@wordpress/compose';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -56,24 +56,8 @@ const UnconnectedColorPicker = (
|
|
|
56
56
|
onChange,
|
|
57
57
|
defaultValue = '#fff',
|
|
58
58
|
copyFormat,
|
|
59
|
-
|
|
60
|
-
// Context
|
|
61
|
-
onPickerDragStart,
|
|
62
|
-
onPickerDragEnd,
|
|
63
59
|
...divProps
|
|
64
|
-
} = useContextSystem
|
|
65
|
-
ColorPickerProps & {
|
|
66
|
-
onPickerDragStart?: ( event: MouseEvent ) => void;
|
|
67
|
-
onPickerDragEnd?: ( event: MouseEvent ) => void;
|
|
68
|
-
}
|
|
69
|
-
>( props, 'ColorPicker' );
|
|
70
|
-
|
|
71
|
-
const [ containerEl, setContainerEl ] = useState< HTMLElement | null >(
|
|
72
|
-
null
|
|
73
|
-
);
|
|
74
|
-
const containerRef = ( node: HTMLElement | null ) => {
|
|
75
|
-
setContainerEl( node );
|
|
76
|
-
};
|
|
60
|
+
} = useContextSystem( props, 'ColorPicker' );
|
|
77
61
|
|
|
78
62
|
// Use a safe default value for the color and remove the possibility of `undefined`.
|
|
79
63
|
const [ color, setColor ] = useControlledValue( {
|
|
@@ -100,17 +84,11 @@ const UnconnectedColorPicker = (
|
|
|
100
84
|
);
|
|
101
85
|
|
|
102
86
|
return (
|
|
103
|
-
<ColorfulWrapper
|
|
104
|
-
ref={ useMergeRefs( [ containerRef, forwardedRef ] ) }
|
|
105
|
-
{ ...divProps }
|
|
106
|
-
>
|
|
87
|
+
<ColorfulWrapper ref={ forwardedRef } { ...divProps }>
|
|
107
88
|
<Picker
|
|
108
|
-
containerEl={ containerEl }
|
|
109
89
|
onChange={ handleChange }
|
|
110
90
|
color={ safeColordColor }
|
|
111
91
|
enableAlpha={ enableAlpha }
|
|
112
|
-
onDragStart={ onPickerDragStart }
|
|
113
|
-
onDragEnd={ onPickerDragEnd }
|
|
114
92
|
/>
|
|
115
93
|
<AuxiliaryColorArtefactWrapper>
|
|
116
94
|
<AuxiliaryColorArtefactHStackHeader justify="space-between">
|