@wordpress/components 30.2.1-next.f34ab90e9.0 → 30.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 +18 -1
- package/build/card/context.js +1 -0
- package/build/card/context.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-context.js +1 -0
- package/build/circular-option-picker/circular-option-picker-context.js.map +1 -1
- package/build/composite/context.js +1 -0
- package/build/composite/context.js.map +1 -1
- package/build/context/context-connect.js.map +1 -1
- package/build/context/context-system-provider.js +1 -0
- package/build/context/context-system-provider.js.map +1 -1
- package/build/custom-select-control-v2/custom-select.js +1 -0
- package/build/custom-select-control-v2/custom-select.js.map +1 -1
- package/build/disabled/index.js +1 -0
- package/build/disabled/index.js.map +1 -1
- package/build/item-group/context.js +1 -0
- package/build/item-group/context.js.map +1 -1
- package/build/menu/context.js +1 -0
- package/build/menu/context.js.map +1 -1
- package/build/modal/index.js +1 -0
- package/build/modal/index.js.map +1 -1
- package/build/navigation/context.js +1 -0
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/context.js +1 -0
- package/build/navigation/group/context.js.map +1 -1
- package/build/navigation/menu/context.js +1 -0
- package/build/navigation/menu/context.js.map +1 -1
- package/build/navigator/context.js +1 -0
- package/build/navigator/context.js.map +1 -1
- package/build/popover/index.js +1 -0
- package/build/popover/index.js.map +1 -1
- package/build/radio-group/context.js +1 -0
- package/build/radio-group/context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/context.js +1 -0
- package/build/slot-fill/context.js.map +1 -1
- package/build/tabs/context.js +1 -0
- package/build/tabs/context.js.map +1 -1
- package/build/tabs/styles.js +5 -5
- package/build/tabs/styles.js.map +1 -1
- package/build/toggle-group-control/context.js +1 -0
- package/build/toggle-group-control/context.js.map +1 -1
- package/build/toolbar/toolbar-context/index.js +1 -0
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/tools-panel/context.js +1 -0
- package/build/tools-panel/context.js.map +1 -1
- package/build/tooltip/index.js +1 -0
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-grid/roving-tab-index-context.js +1 -0
- package/build/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build/utils/font-size.js.map +1 -1
- package/build/utils/get-valid-children.js.map +1 -1
- package/build/validated-form-controls/control-with-error.js +16 -16
- package/build/validated-form-controls/control-with-error.js.map +1 -1
- package/build-module/card/context.js +1 -0
- package/build-module/card/context.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-context.js +1 -0
- package/build-module/circular-option-picker/circular-option-picker-context.js.map +1 -1
- package/build-module/composite/context.js +1 -0
- package/build-module/composite/context.js.map +1 -1
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/context/context-system-provider.js +1 -0
- package/build-module/context/context-system-provider.js.map +1 -1
- package/build-module/custom-select-control-v2/custom-select.js +1 -0
- package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
- package/build-module/disabled/index.js +1 -0
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/item-group/context.js +1 -0
- package/build-module/item-group/context.js.map +1 -1
- package/build-module/menu/context.js +1 -0
- package/build-module/menu/context.js.map +1 -1
- package/build-module/modal/index.js +1 -0
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/context.js +1 -0
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/context.js +1 -0
- package/build-module/navigation/group/context.js.map +1 -1
- package/build-module/navigation/menu/context.js +1 -0
- package/build-module/navigation/menu/context.js.map +1 -1
- package/build-module/navigator/context.js +1 -0
- package/build-module/navigator/context.js.map +1 -1
- package/build-module/popover/index.js +1 -0
- package/build-module/popover/index.js.map +1 -1
- package/build-module/radio-group/context.js +1 -0
- package/build-module/radio-group/context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +1 -0
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/context.js +1 -0
- package/build-module/slot-fill/context.js.map +1 -1
- package/build-module/tabs/context.js +1 -0
- package/build-module/tabs/context.js.map +1 -1
- package/build-module/tabs/styles.js +6 -6
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/toggle-group-control/context.js +1 -0
- package/build-module/toggle-group-control/context.js.map +1 -1
- package/build-module/toolbar/toolbar-context/index.js +1 -0
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/tools-panel/context.js +1 -0
- package/build-module/tools-panel/context.js.map +1 -1
- package/build-module/tooltip/index.js +1 -0
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-context.js +1 -0
- package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
- package/build-module/utils/font-size.js.map +1 -1
- package/build-module/utils/get-valid-children.js.map +1 -1
- package/build-module/validated-form-controls/control-with-error.js +16 -16
- package/build-module/validated-form-controls/control-with-error.js.map +1 -1
- package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
- package/build-types/card/context.d.ts.map +1 -1
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/context/context-connect.d.ts +2 -2
- package/build-types/context/context-connect.d.ts.map +1 -1
- package/build-types/context/context-system-provider.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/item-group/context.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/context.d.ts.map +1 -1
- package/build-types/navigation/group/context.d.ts.map +1 -1
- package/build-types/navigation/menu/context.d.ts.map +1 -1
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/context.d.ts.map +1 -1
- package/build-types/tabs/context.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/context.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/tools-panel/context.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -1
- package/build-types/utils/font-size.d.ts +2 -2
- package/build-types/utils/font-size.d.ts.map +1 -1
- package/build-types/utils/get-valid-children.d.ts +2 -2
- package/build-types/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/validated-form-controls/test/control-with-error.d.ts +2 -0
- package/build-types/validated-form-controls/test/control-with-error.d.ts.map +1 -0
- package/package.json +20 -20
- package/src/calendar/stories/date-calendar.story.tsx +1 -0
- package/src/calendar/stories/date-range-calendar.story.tsx +1 -0
- package/src/card/context.ts +2 -0
- package/src/circular-option-picker/circular-option-picker-context.tsx +1 -0
- package/src/composite/context.tsx +1 -0
- package/src/context/context-connect.ts +2 -2
- package/src/context/context-system-provider.js +2 -0
- package/src/custom-select-control-v2/custom-select.tsx +1 -0
- package/src/disabled/index.tsx +2 -0
- package/src/item-group/context.ts +1 -0
- package/src/menu/context.tsx +1 -0
- package/src/modal/index.tsx +1 -0
- package/src/navigation/context.tsx +3 -0
- package/src/navigation/group/context.tsx +1 -0
- package/src/navigation/menu/context.tsx +2 -0
- package/src/navigator/context.ts +1 -0
- package/src/popover/index.tsx +1 -0
- package/src/radio-group/context.tsx +1 -0
- package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +1 -0
- package/src/slot-fill/context.ts +1 -0
- package/src/tabs/context.ts +1 -0
- package/src/tabs/styles.ts +2 -1
- package/src/toggle-group-control/context.ts +2 -0
- package/src/toolbar/toolbar-context/index.ts +1 -0
- package/src/tools-panel/context.ts +1 -0
- package/src/tools-panel/stories/index.story.tsx +3 -3
- package/src/tooltip/index.tsx +1 -0
- package/src/tree-grid/roving-tab-index-context.ts +2 -0
- package/src/utils/font-size.ts +2 -2
- package/src/utils/get-valid-children.ts +4 -2
- package/src/validated-form-controls/components/stories/overview.story.tsx +109 -27
- package/src/validated-form-controls/control-with-error.tsx +19 -18
- package/src/validated-form-controls/test/control-with-error.tsx +224 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","cloneElement","forwardRef","useEffect","useState","withIgnoreIMEEvents","ValidityIndicator","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","appendRequiredIndicator","label","required","markWhenOptional","children","UnforwardedControlWithError","onValidate","customValidity","getValidityTarget","forwardedRef","errorMessage","setErrorMessage","statusMessage","setStatusMessage","isTouched","setIsTouched","validityTarget","showValidationMessage","validationMessage","addEventListener","removeEventListener","type","setCustomValidity","undefined","timer","setTimeout","message","clearTimeout","_customValidity$messa","onBlur","event","relatedTarget","currentTarget","contains","validity","valid","onChange","args","props","onKeyDown","key","className","ref","ControlWithError"],"sources":["@wordpress/components/src/validated-form-controls/control-with-error.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport {\n\tcloneElement,\n\tforwardRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type { ValidatedControlProps } from './components/types';\nimport { ValidityIndicator } from './validity-indicator';\n\nfunction appendRequiredIndicator(\n\tlabel: React.ReactNode,\n\trequired: boolean | undefined,\n\tmarkWhenOptional: boolean | undefined\n) {\n\tif ( required && ! markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Required' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\tif ( ! required && markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Optional' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\treturn label;\n}\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\ntype ValidityTarget =\n\t| HTMLFieldSetElement\n\t| HTMLInputElement\n\t| HTMLSelectElement\n\t| HTMLTextAreaElement;\n\nfunction UnforwardedControlWithError< C extends React.ReactElement >(\n\t{\n\t\trequired,\n\t\tmarkWhenOptional,\n\t\tonValidate,\n\t\tcustomValidity,\n\t\tgetValidityTarget,\n\t\tchildren,\n\t}: {\n\t\t/**\n\t\t * Whether the control is required.\n\t\t */\n\t\trequired?: boolean;\n\t\t/**\n\t\t * Label the control as \"optional\" when _not_ `required`, instead of the inverse.\n\t\t */\n\t\tmarkWhenOptional?: boolean;\n\t\t/**\n\t\t * The callback to run when the input should be validated.\n\t\t */\n\t\tonValidate?: () => void;\n\t\tcustomValidity?: ValidatedControlProps< unknown >[ 'customValidity' ];\n\t\t/**\n\t\t * A function that returns the actual element on which the validity data should be applied.\n\t\t */\n\t\tgetValidityTarget: () => ValidityTarget | null | undefined;\n\t\t/**\n\t\t * The control component to apply validation to.\n\t\t */\n\t\tchildren: C;\n\t},\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst [ errorMessage, setErrorMessage ] = useState< string | undefined >();\n\tconst [ statusMessage, setStatusMessage ] = useState<\n\t\t| {\n\t\t\t\ttype: 'validating' | 'valid';\n\t\t\t\tmessage?: string;\n\t\t }\n\t\t| undefined\n\t>();\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\n\t// Ensure that error messages are visible after user attemps to submit a form\n\t// with multiple invalid fields.\n\tuseEffect( () => {\n\t\tconst validityTarget = getValidityTarget();\n\t\tconst showValidationMessage = () =>\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\tvalidityTarget?.addEventListener( 'invalid', showValidationMessage );\n\n\t\treturn () => {\n\t\t\tvalidityTarget?.removeEventListener(\n\t\t\t\t'invalid',\n\t\t\t\tshowValidationMessage\n\t\t\t);\n\t\t};\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( ! isTouched ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst validityTarget = getValidityTarget();\n\n\t\tif ( ! customValidity?.type ) {\n\t\t\tvalidityTarget?.setCustomValidity( '' );\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t\t\tsetStatusMessage( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( customValidity.type ) {\n\t\t\tcase 'validating': {\n\t\t\t\t// Wait before showing a validating state.\n\t\t\t\tconst timer = setTimeout( () => {\n\t\t\t\t\tsetStatusMessage( {\n\t\t\t\t\t\ttype: 'validating',\n\t\t\t\t\t\tmessage: customValidity.message,\n\t\t\t\t\t} );\n\t\t\t\t}, 1000 );\n\n\t\t\t\treturn () => clearTimeout( timer );\n\t\t\t}\n\t\t\tcase 'valid': {\n\t\t\t\tvalidityTarget?.setCustomValidity( '' );\n\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\t\t\tsetStatusMessage( {\n\t\t\t\t\ttype: 'valid',\n\t\t\t\t\tmessage: customValidity.message,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'invalid': {\n\t\t\t\tvalidityTarget?.setCustomValidity(\n\t\t\t\t\tcustomValidity.message ?? ''\n\t\t\t\t);\n\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\t\t\tsetStatusMessage( undefined );\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t}, [\n\t\tisTouched,\n\t\tcustomValidity?.type,\n\t\tcustomValidity?.message,\n\t\tgetValidityTarget,\n\t] );\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\n\t\t\tconst validityTarget = getValidityTarget();\n\n\t\t\t// Prevents a double flash of the native error tooltip when the control is already showing one.\n\t\t\tif ( ! validityTarget?.validity.valid ) {\n\t\t\t\tif ( ! errorMessage ) {\n\t\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\tconst onChange = ( ...args: unknown[] ) => {\n\t\tchildren.props.onChange?.( ...args );\n\n\t\t// Only validate incrementally if the field has blurred at least once,\n\t\t// or currently has an error message.\n\t\tif ( isTouched || errorMessage ) {\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\tconst onKeyDown = ( event: React.KeyboardEvent< HTMLDivElement > ) => {\n\t\t// Ensures that custom validators are triggered when the user submits by pressing Enter,\n\t\t// without ever blurring the control.\n\t\tif ( event.key === 'Enter' ) {\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t// Disable reason: Just listening to a bubbled event, not for interaction.\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"components-validated-control\"\n\t\t\tref={ forwardedRef }\n\t\t\tonBlur={ onBlur }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( onKeyDown ) }\n\t\t>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tlabel: appendRequiredIndicator(\n\t\t\t\t\tchildren.props.label,\n\t\t\t\t\trequired,\n\t\t\t\t\tmarkWhenOptional\n\t\t\t\t),\n\t\t\t\tonChange,\n\t\t\t\trequired,\n\t\t\t} ) }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ errorMessage && (\n\t\t\t\t\t<ValidityIndicator\n\t\t\t\t\t\ttype=\"invalid\"\n\t\t\t\t\t\tmessage={ errorMessage }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! errorMessage && statusMessage && (\n\t\t\t\t\t<ValidityIndicator\n\t\t\t\t\t\ttype={ statusMessage.type }\n\t\t\t\t\t\tmessage={ statusMessage.message }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const ControlWithError = forwardRef( UnforwardedControlWithError );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SACCC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACF,oBAAoB;;AAE3B;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,SAASC,iBAAiB,QAAQ,sBAAsB;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAEzD,SAASC,uBAAuBA,CAC/BC,KAAsB,EACtBC,QAA6B,EAC7BC,gBAAqC,EACpC;EACD,IAAKD,QAAQ,IAAI,CAAEC,gBAAgB,EAAG;IACrC,oBACCN,KAAA,CAAAF,SAAA;MAAAS,QAAA,GACGH,KAAK,EAAE,GAAC,EAAE,IAAKd,EAAE,CAAE,UAAW,CAAC,GAAI;IAAA,CACpC,CAAC;EAEL;EACA,IAAK,CAAEe,QAAQ,IAAIC,gBAAgB,EAAG;IACrC,oBACCN,KAAA,CAAAF,SAAA;MAAAS,QAAA,GACGH,KAAK,EAAE,GAAC,EAAE,IAAKd,EAAE,CAAE,UAAW,CAAC,GAAI;IAAA,CACpC,CAAC;EAEL;EACA,OAAOc,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAO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AGC,IAAK,CAAC;;IAEpC;IACA;IACA,IAAKvB,SAAS,IAAIJ,YAAY,EAAG;MAChCJ,UAAU,GAAG,CAAC;IACf;EACD,CAAC;EAED,MAAMiC,SAAS,GAAKT,KAA4C,IAAM;IACrE;IACA;IACA,IAAKA,KAAK,CAACU,GAAG,KAAK,OAAO,EAAG;MAC5BlC,UAAU,GAAG,CAAC;IACf;EACD,CAAC;EAED;IAAA;IACC;IACA;IACAT,KAAA;MACC4C,SAAS,EAAC,8BAA8B;MACxCC,GAAG,EAAGjC,YAAc;MACpBoB,MAAM,EAAGA,MAAQ;MACjBU,SAAS,EAAG/C,mBAAmB,CAAE+C,SAAU,CAAG;MAAAnC,QAAA,GAE5ChB,YAAY,CAAEgB,QAAQ,EAAE;QACzBH,KAAK,EAAED,uBAAuB,CAC7BI,QAAQ,CAACkC,KAAK,CAACrC,KAAK,EACpBC,QAAQ,EACRC,gBACD,CAAC;QACDiC,QAAQ;QACRlC;MACD,CAAE,CAAC,eACHL,KAAA;QAAK,aAAU,QAAQ;QAAAO,QAAA,GACpBM,YAAY,iBACbX,IAAA,CAACN,iBAAiB;UACjB4B,IAAI,EAAC,SAAS;UACdK,OAAO,EAAGhB;QAAc,CACxB,CACD,EACC,CAAEA,YAAY,IAAIE,aAAa,iBAChCb,IAAA,CAACN,iBAAiB;UACjB4B,IAAI,EAAGT,aAAa,CAACS,IAAM;UAC3BK,OAAO,EAAGd,aAAa,CAACc;QAAS,CACjC,CACD;MAAA,CACG,CAAC;IAAA,CACF;EAAC;AAER;AAEA,OAAO,MAAMiB,gBAAgB,GAAGtD,UAAU,CAAEgB,2BAA4B,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["usePrevious","__","cloneElement","forwardRef","useEffect","useState","withIgnoreIMEEvents","ValidityIndicator","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","appendRequiredIndicator","label","required","markWhenOptional","children","UnforwardedControlWithError","onValidate","customValidity","getValidityTarget","forwardedRef","errorMessage","setErrorMessage","statusMessage","setStatusMessage","isTouched","setIsTouched","previousCustomValidityType","type","validityTarget","showValidationMessage","validationMessage","addEventListener","removeEventListener","setCustomValidity","undefined","timer","setTimeout","message","clearTimeout","_customValidity$messa","onBlur","event","relatedTarget","currentTarget","contains","onChange","args","props","onKeyDown","key","className","ref","ControlWithError"],"sources":["@wordpress/components/src/validated-form-controls/control-with-error.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { usePrevious } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tcloneElement,\n\tforwardRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type { ValidatedControlProps } from './components/types';\nimport { ValidityIndicator } from './validity-indicator';\n\nfunction appendRequiredIndicator(\n\tlabel: React.ReactNode,\n\trequired: boolean | undefined,\n\tmarkWhenOptional: boolean | undefined\n) {\n\tif ( required && ! markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Required' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\tif ( ! required && markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Optional' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\treturn label;\n}\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\ntype ValidityTarget =\n\t| HTMLFieldSetElement\n\t| HTMLInputElement\n\t| HTMLSelectElement\n\t| HTMLTextAreaElement;\n\nfunction UnforwardedControlWithError< C extends React.ReactElement >(\n\t{\n\t\trequired,\n\t\tmarkWhenOptional,\n\t\tonValidate,\n\t\tcustomValidity,\n\t\tgetValidityTarget,\n\t\tchildren,\n\t}: {\n\t\t/**\n\t\t * Whether the control is required.\n\t\t */\n\t\trequired?: boolean;\n\t\t/**\n\t\t * Label the control as \"optional\" when _not_ `required`, instead of the inverse.\n\t\t */\n\t\tmarkWhenOptional?: boolean;\n\t\t/**\n\t\t * The callback to run when the input should be validated.\n\t\t */\n\t\tonValidate?: () => void;\n\t\tcustomValidity?: ValidatedControlProps< unknown >[ 'customValidity' ];\n\t\t/**\n\t\t * A function that returns the actual element on which the validity data should be applied.\n\t\t */\n\t\tgetValidityTarget: () => ValidityTarget | null | undefined;\n\t\t/**\n\t\t * The control component to apply validation to.\n\t\t */\n\t\tchildren: C;\n\t},\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst [ errorMessage, setErrorMessage ] = useState< string | undefined >();\n\tconst [ statusMessage, setStatusMessage ] = useState<\n\t\t| {\n\t\t\t\ttype: 'validating' | 'valid';\n\t\t\t\tmessage?: string;\n\t\t }\n\t\t| undefined\n\t>();\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\tconst previousCustomValidityType = usePrevious( customValidity?.type );\n\n\t// Ensure that error messages are visible after user attemps to submit a form\n\t// with multiple invalid fields.\n\tuseEffect( () => {\n\t\tconst validityTarget = getValidityTarget();\n\t\tconst showValidationMessage = () =>\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\tvalidityTarget?.addEventListener( 'invalid', showValidationMessage );\n\n\t\treturn () => {\n\t\t\tvalidityTarget?.removeEventListener(\n\t\t\t\t'invalid',\n\t\t\t\tshowValidationMessage\n\t\t\t);\n\t\t};\n\t} );\n\n\tuseEffect( (): ReturnType< React.EffectCallback > => {\n\t\tif ( ! isTouched ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst validityTarget = getValidityTarget();\n\n\t\tif ( ! customValidity?.type ) {\n\t\t\tvalidityTarget?.setCustomValidity( '' );\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t\t\tsetStatusMessage( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( customValidity.type ) {\n\t\t\tcase 'validating': {\n\t\t\t\t// Wait before showing a validating state.\n\t\t\t\tconst timer = setTimeout( () => {\n\t\t\t\t\tvalidityTarget?.setCustomValidity( '' );\n\t\t\t\t\tsetErrorMessage( undefined );\n\n\t\t\t\t\tsetStatusMessage( {\n\t\t\t\t\t\ttype: 'validating',\n\t\t\t\t\t\tmessage: customValidity.message,\n\t\t\t\t\t} );\n\t\t\t\t}, 1000 );\n\n\t\t\t\treturn () => clearTimeout( timer );\n\t\t\t}\n\t\t\tcase 'valid': {\n\t\t\t\t// Ensures that we wait for any async responses before showing\n\t\t\t\t// a synchronously valid state.\n\t\t\t\tif ( previousCustomValidityType === 'valid' ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvalidityTarget?.setCustomValidity( '' );\n\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\t\t\tsetStatusMessage( {\n\t\t\t\t\ttype: 'valid',\n\t\t\t\t\tmessage: customValidity.message,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'invalid': {\n\t\t\t\tvalidityTarget?.setCustomValidity(\n\t\t\t\t\tcustomValidity.message ?? ''\n\t\t\t\t);\n\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\t\t\tsetStatusMessage( undefined );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}, [\n\t\tisTouched,\n\t\tcustomValidity?.type,\n\t\tcustomValidity?.message,\n\t\tgetValidityTarget,\n\t\tpreviousCustomValidityType,\n\t] );\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\tif ( isTouched ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\tconst onChange = ( ...args: unknown[] ) => {\n\t\tchildren.props.onChange?.( ...args );\n\n\t\t// Only validate incrementally if the field has blurred at least once,\n\t\t// or currently has an error message.\n\t\tif ( isTouched || errorMessage ) {\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\tconst onKeyDown = ( event: React.KeyboardEvent< HTMLDivElement > ) => {\n\t\t// Ensures that custom validators are triggered when the user submits by pressing Enter,\n\t\t// without ever blurring the control.\n\t\tif ( event.key === 'Enter' ) {\n\t\t\tonValidate?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t// Disable reason: Just listening to a bubbled event, not for interaction.\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"components-validated-control\"\n\t\t\tref={ forwardedRef }\n\t\t\tonBlur={ onBlur }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( onKeyDown ) }\n\t\t>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tlabel: appendRequiredIndicator(\n\t\t\t\t\tchildren.props.label,\n\t\t\t\t\trequired,\n\t\t\t\t\tmarkWhenOptional\n\t\t\t\t),\n\t\t\t\tonChange,\n\t\t\t\trequired,\n\t\t\t} ) }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ errorMessage && (\n\t\t\t\t\t<ValidityIndicator\n\t\t\t\t\t\ttype=\"invalid\"\n\t\t\t\t\t\tmessage={ errorMessage }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! errorMessage && statusMessage && (\n\t\t\t\t\t<ValidityIndicator\n\t\t\t\t\t\ttype={ statusMessage.type }\n\t\t\t\t\t\tmessage={ statusMessage.message }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const ControlWithError = forwardRef( UnforwardedControlWithError );\n"],"mappings":"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B,MAAM,EAAGA,MAAQ;MACjBQ,SAAS,EAAG9C,mBAAmB,CAAE8C,SAAU,CAAG;MAAAlC,QAAA,GAE5ChB,YAAY,CAAEgB,QAAQ,EAAE;QACzBH,KAAK,EAAED,uBAAuB,CAC7BI,QAAQ,CAACiC,KAAK,CAACpC,KAAK,EACpBC,QAAQ,EACRC,gBACD,CAAC;QACDgC,QAAQ;QACRjC;MACD,CAAE,CAAC,eACHL,KAAA;QAAK,aAAU,QAAQ;QAAAO,QAAA,GACpBM,YAAY,iBACbX,IAAA,CAACN,iBAAiB;UACjBwB,IAAI,EAAC,SAAS;UACdU,OAAO,EAAGjB;QAAc,CACxB,CACD,EACC,CAAEA,YAAY,IAAIE,aAAa,iBAChCb,IAAA,CAACN,iBAAiB;UACjBwB,IAAI,EAAGL,aAAa,CAACK,IAAM;UAC3BU,OAAO,EAAGf,aAAa,CAACe;QAAS,CACjC,CACD;MAAA,CACG,CAAC;IAAA,CACF;EAAC;AAER;AAEA,OAAO,MAAMe,gBAAgB,GAAGrD,UAAU,CAAEgB,2BAA4B,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-calendar.story.d.ts","sourceRoot":"","sources":["../../../src/calendar/stories/date-calendar.story.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD;;GAEG;AACH,OAAO,EAAE,YAAY,EAAU,MAAM,IAAI,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"date-calendar.story.d.ts","sourceRoot":"","sources":["../../../src/calendar/stories/date-calendar.story.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD;;GAEG;AACH,OAAO,EAAE,YAAY,EAAU,MAAM,IAAI,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,CA4EpC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,YAAY,CAAE,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAC;AAQF,eAAO,MAAM,wBAAwB,EAAE,KAKtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAyD1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-range-calendar.story.d.ts","sourceRoot":"","sources":["../../../src/calendar/stories/date-range-calendar.story.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAU,MAAM,IAAI,CAAC;AAE/C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"date-range-calendar.story.d.ts","sourceRoot":"","sources":["../../../src/calendar/stories/date-range-calendar.story.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAU,MAAM,IAAI,CAAC;AAE/C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,iBAAiB,CA4EzC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,iBAAiB,CAAE,CAAC;AAElD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAC;AASF,eAAO,MAAM,yBAAyB,EAAE,KAQvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KA+D1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/card/context.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,6BAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/card/context.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,6BAAsB,CAAC;AAG/C,eAAO,MAAM,cAAc,UAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/composite/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,gBAAgB,gDAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/composite/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,gBAAgB,gDAA+C,CAAC;AAG7E,eAAO,MAAM,mBAAmB,6BAAuC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { ForwardedRef,
|
|
4
|
+
import type { ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
5
5
|
import type { WordPressComponentFromProps } from '.';
|
|
6
6
|
type AcceptsTwoArgs<F extends (...args: any) => any, ErrorMessage = never> = Parameters<F>['length'] extends 2 ? {} : ErrorMessage;
|
|
7
7
|
/**
|
|
@@ -28,7 +28,7 @@ export declare function contextConnectWithoutRef<P>(Component: (props: P) => JSX
|
|
|
28
28
|
* @param Component The component to retrieve a namespace from.
|
|
29
29
|
* @return The connected namespaces.
|
|
30
30
|
*/
|
|
31
|
-
export declare function getConnectNamespace(Component:
|
|
31
|
+
export declare function getConnectNamespace(Component: ReactElement | number | string | undefined | {}): string[];
|
|
32
32
|
/**
|
|
33
33
|
* Checks to see if a component is connected within the Context system.
|
|
34
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-connect.d.ts","sourceRoot":"","sources":["../../src/context/context-connect.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"context-connect.d.ts","sourceRoot":"","sources":["../../src/context/context-connect.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAanE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,GAAG,CAAC;AAErD,KAAK,cAAc,CAClB,CAAC,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,KAAM,GAAG,EACjC,YAAY,GAAG,KAAK,IACjB,UAAU,CAAE,CAAC,CAAE,CAAE,QAAQ,CAAE,SAAS,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC;AAM9D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC7B,CAAC,SAAS,CAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,CAAE,GAAG,CAAE,KAAM,GAAG,CAAC,OAAO,GAAG,IAAI,EAExE,SAAS,EAAE,CAAC,GACX,cAAc,CACb,CAAC,EACD,8HAA8H,CAC9H,EACF,SAAS,EAAE,MAAM,2MAGjB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAE,CAAC,EAC1C,SAAS,EAAE,CAAE,KAAK,EAAE,CAAC,KAAM,GAAG,CAAC,OAAO,GAAG,IAAI,EAC7C,SAAS,EAAE,MAAM,yCAGjB;AAgDD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE,GACxD,MAAM,EAAE,CAoBV;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,GACtB,OAAO,CAeT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-system-provider.d.ts","sourceRoot":"","sources":["../../src/context/context-system-provider.js"],"names":[],"mappings":"AAwBA,6EAEE;
|
|
1
|
+
{"version":3,"file":"context-system-provider.d.ts","sourceRoot":"","sources":["../../src/context/context-system-provider.js"],"names":[],"mappings":"AAwBA,6EAEE;AAGK,4DAAkE;AA4EzE,0EAhBmC,CAAC,SAAtB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAE,uBAE/B;IAA2C,QAAQ,EAA3C,OAAO,OAAO,EAAE,SAAS;IACU,KAAK,EAAxC,CAAC;CACT,KAAS,GAAG,CAAC,OAAO,GAYgD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-select.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/custom-select.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,mBAAmB,IAAI,uBAAuB,EAC9C,iBAAiB,EAEjB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,mBAAmB,kDACsB,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-select.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/custom-select.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,mBAAmB,IAAI,uBAAuB,EAC9C,iBAAiB,EAEjB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,mBAAmB,kDACsB,CAAC;AA0DvD,iBAAS,aAAa,CACrB,KAAK,EAAE,0BAA0B,GAChC,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,+BAsEvB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disabled/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disabled/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAQ1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,iBAAS,QAAQ,CAAE,EAClB,SAAS,EACT,QAAQ,EACR,UAAiB,EACjB,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,CAAE,+BAmBjD;kBAxBQ,QAAQ;;;;AA6BjB,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/item-group/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,gBAAgB,kCAEf,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/item-group/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,gBAAgB,kCAEf,CAAC;AAGf,eAAO,MAAM,mBAAmB,eAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA4V1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,KAAK,uGAAiC,CAAC;AAEpD,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAM1E,eAAO,MAAM,iBAAiB,gDAmB3B,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAM1E,eAAO,MAAM,iBAAiB,gDAmB3B,CAAC;AAIJ,eAAO,MAAM,oBAAoB,6BAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/navigation/group/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAErF,eAAO,MAAM,sBAAsB,qDACiC,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/navigation/group/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAErF,eAAO,MAAM,sBAAsB,qDACiC,CAAC;AAGrE,eAAO,MAAM,yBAAyB,kCACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/navigation/menu/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAEnF,eAAO,MAAM,qBAAqB,oDAKjC,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/navigation/menu/context.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAEnF,eAAO,MAAM,qBAAqB,oDAKjC,CAAC;AAGF,eAAO,MAAM,wBAAwB,iCACD,CAAC"}
|
|
@@ -30,7 +30,7 @@ export declare const PopoverSlot: import("react").ForwardRefExoticComponent<Popo
|
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
33
|
-
export declare const Popover: import("../context").WordPressComponent<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | null, Omit<WordPressComponentProps<PopoverProps, "div", false>, "inherit" | "initial" | "layout" | "drag" | "transition" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "viewport" | "
|
|
33
|
+
export declare const Popover: import("../context").WordPressComponent<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | null, Omit<WordPressComponentProps<PopoverProps, "div", false>, "inherit" | "initial" | "layout" | "drag" | "transition" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "viewport" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit" | "onUpdate" | "dragDirectionLock" | "dragPropagation" | "dragConstraints" | "dragElastic" | "dragMomentum" | "dragTransition" | "dragControls" | "dragSnapToOrigin" | "dragListener" | "onMeasureDragConstraints" | "_dragX" | "_dragY" | "transformTemplate" | "data-framer-appear-id" | "variants" | "onBeforeLayoutMeasure" | "onLayoutMeasure" | "onAnimationComplete" | "onPan" | "onPanStart" | "onPanSessionStart" | "onPanEnd" | "onTap" | "onTapStart" | "onTapCancel" | "globalTapTarget" | "onHoverStart" | "onHoverEnd" | "onViewportEnter" | "onViewportLeave" | "onDirectionLock" | "onDragTransitionEnd" | "layoutId" | "onLayoutAnimationStart" | "onLayoutAnimationComplete" | "layoutDependency" | "layoutScroll" | "layoutRoot" | "data-framer-portal-id" | "custom" | "ignoreStrict"> & import("react").RefAttributes<any>, boolean> & {
|
|
34
34
|
/**
|
|
35
35
|
* Renders a slot that is used internally by Popover for rendering content.
|
|
36
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACX,YAAY,EAGZ,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACX,YAAY,EAGZ,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAY,CAAC;AAuanC,eAAO,MAAM,WAAW,6GAWvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,OAAO;IAGlB;;OAEG;;;;IAIH;;;;OAIG;;;;CAKJ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: import("../../../context").WordPressComponent<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | null, Omit<import("../../../context").WordPressComponentProps<import("../../types").PopoverProps, "div", false>, "inherit" | "initial" | "layout" | "drag" | "transition" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "viewport" | "
|
|
3
|
+
component: import("../../../context").WordPressComponent<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | null, Omit<import("../../../context").WordPressComponentProps<import("../../types").PopoverProps, "div", false>, "inherit" | "initial" | "layout" | "drag" | "transition" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "viewport" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit" | "onUpdate" | "dragDirectionLock" | "dragPropagation" | "dragConstraints" | "dragElastic" | "dragMomentum" | "dragTransition" | "dragControls" | "dragSnapToOrigin" | "dragListener" | "onMeasureDragConstraints" | "_dragX" | "_dragY" | "transformTemplate" | "data-framer-appear-id" | "variants" | "onBeforeLayoutMeasure" | "onLayoutMeasure" | "onAnimationComplete" | "onPan" | "onPanStart" | "onPanSessionStart" | "onPanEnd" | "onTap" | "onTapStart" | "onTapCancel" | "globalTapTarget" | "onHoverStart" | "onHoverEnd" | "onViewportEnter" | "onViewportLeave" | "onDirectionLock" | "onDragTransitionEnd" | "layoutId" | "onLayoutAnimationStart" | "onLayoutAnimationComplete" | "layoutDependency" | "layoutScroll" | "layoutRoot" | "data-framer-portal-id" | "custom" | "ignoreStrict"> & import("react").RefAttributes<any>, boolean> & {
|
|
4
4
|
Slot: import("react").ForwardRefExoticComponent<import("../../types").PopoverSlotProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot-fill-context.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/slot-fill-context.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAoBhE,QAAA,MAAM,eAAe,0DAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"slot-fill-context.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/slot-fill-context.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAoBhE,QAAA,MAAM,eAAe,0DAAuC,CAAC;AAG7D,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/slot-fill/context.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAWnD,eAAO,MAAM,eAAe,8CAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/slot-fill/context.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAWnD,eAAO,MAAM,eAAe,8CAAgC,CAAC;AAG7D,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tabs/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,2CAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tabs/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,2CAAiD,CAAC;AAG1E,eAAO,MAAM,cAAc,wBAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/tabs/styles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAS1C,eAAO,MAAM,aAAa;;;;;;UAuIzB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/tabs/styles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAS1C,eAAO,MAAM,aAAa;;;;;;UAuIzB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;;UAiFf,CAAC;AAEF,eAAO,MAAM,WAAW;;SA/Md,MAAO,WACb;2GA0NH,CAAC;AAEF,eAAO,MAAM,UAAU;;UAuBtB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;UAapB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/toggle-group-control/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,QAAA,MAAM,yBAAyB,yDAE9B,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/toggle-group-control/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAE9D,QAAA,MAAM,yBAAyB,yDAE9B,CAAC;AAGF,eAAO,MAAM,4BAA4B,sCACD,CAAC;AACzC,eAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAO/C,QAAA,MAAM,cAAc,2DAEnB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-context/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAO/C,QAAA,MAAM,cAAc,2DAEnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tools-panel/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI1E,eAAO,MAAM,iBAAiB,gDAW3B,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tools-panel/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI1E,eAAO,MAAM,iBAAiB,gDAW3B,CAAC;AAGJ,eAAO,MAAM,oBAAoB,6BACwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":"AAmBA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":"AAmBA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,MAAM,SAAS,CAAC;AASjB;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AA0HjC,eAAO,MAAM,OAAO,8FAAmC,CAAC;AAExD,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-tab-index-context.d.ts","sourceRoot":"","sources":["../../src/tree-grid/roving-tab-index-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roving-tab-index-context.d.ts","sourceRoot":"","sources":["../../src/tree-grid/roving-tab-index-context.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,wBAAwB;wBATd,WAAW,GAAG,SAAS;2BACpB,KAAK,CAAC,QAAQ,CACpC,KAAK,CAAC,cAAc,CAAE,WAAW,GAAG,SAAS,CAAE,CAC/C;aAOgC,CAAC;AACrC,eAAO,MAAM,sBAAsB;wBAXZ,WAAW,GAAG,SAAS;2BACpB,KAAK,CAAC,QAAQ,CACpC,KAAK,CAAC,cAAc,CAAE,WAAW,GAAG,SAAS,CAAE,CAC/C;cAQgE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { CSSProperties
|
|
4
|
+
import type { CSSProperties } from 'react';
|
|
5
5
|
export type HeadingSize = 1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6';
|
|
6
6
|
export declare const BASE_FONT_SIZE = 13;
|
|
7
7
|
export declare const PRESET_FONT_SIZES: {
|
|
@@ -14,5 +14,5 @@ export declare const PRESET_FONT_SIZES: {
|
|
|
14
14
|
};
|
|
15
15
|
export declare const HEADING_FONT_SIZES: HeadingSize[];
|
|
16
16
|
export declare function getFontSize(size?: CSSProperties['fontSize'] | keyof typeof PRESET_FONT_SIZES): string;
|
|
17
|
-
export declare function getHeadingFontSize(size?:
|
|
17
|
+
export declare function getHeadingFontSize(size?: number | string): string;
|
|
18
18
|
//# sourceMappingURL=font-size.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-size.d.ts","sourceRoot":"","sources":["../../src/utils/font-size.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"font-size.d.ts","sourceRoot":"","sources":["../../src/utils/font-size.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO3C,MAAM,MAAM,WAAW,GACpB,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAEP,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,eAAO,MAAM,iBAAiB;;;;;;;CAO7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAG5B,CAAC;AAEJ,wBAAgB,WAAW,CAC1B,IAAI,GACD,aAAa,CAAE,UAAU,CAAE,GAC3B,MAAM,OAAO,iBAAkC,GAChD,MAAM,CAiBR;AAED,wBAAgB,kBAAkB,CAAE,IAAI,GAAE,MAAM,GAAG,MAAU,GAAI,MAAM,CAOtE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { ReactNode,
|
|
4
|
+
import type { ReactNode, ReactElement, ReactPortal } from 'react';
|
|
5
5
|
/**
|
|
6
6
|
* Gets a collection of available children elements from a React component's children prop.
|
|
7
7
|
*
|
|
@@ -9,5 +9,5 @@ import type { ReactNode, ReactChild, ReactFragment, ReactPortal } from 'react';
|
|
|
9
9
|
*
|
|
10
10
|
* @return An array of available children.
|
|
11
11
|
*/
|
|
12
|
-
export declare function getValidChildren(children: ReactNode): Array<
|
|
12
|
+
export declare function getValidChildren(children: ReactNode): Array<ReactElement | number | string | Iterable<ReactNode> | ReactPortal>;
|
|
13
13
|
//# sourceMappingURL=get-valid-children.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-valid-children.d.ts","sourceRoot":"","sources":["../../src/utils/get-valid-children.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"get-valid-children.d.ts","sourceRoot":"","sources":["../../src/utils/get-valid-children.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAOlE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,SAAS,GACjB,KAAK,CACP,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAE,SAAS,CAAE,GAAG,WAAW,CACpE,CAQA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.story.d.ts","sourceRoot":"","sources":["../../../../src/validated-form-controls/components/stories/overview.story.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overview.story.d.ts","sourceRoot":"","sources":["../../../../src/validated-form-controls/components/stories/overview.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AASvD;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,gBAAgB,CAIxC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,gBAAgB,CAAE,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KA0DlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAmCrC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAE,OAAO,qBAAqB,CA8DnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/control-with-error.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAyBhE;;;;;;;GAOG;AACH,KAAK,cAAc,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,CAAC;AAoMvB,eAAO,MAAM,gBAAgB;IAzL3B;;OAEG;eACQ,OAAO;IAClB;;OAEG;uBACgB,OAAO;IAC1B;;OAEG;iBACU,MAAM,IAAI;qBACN,qBAAqB,CAAE,OAAO,CAAE,CAAE,gBAAgB,CAAE;IACrE;;OAEG;uBACgB,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS;IAC1D;;OAEG;;kDAsKoE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-with-error.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/control-with-error.tsx"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/components",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.3.0",
|
|
4
4
|
"description": "UI components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -44,30 +44,30 @@
|
|
|
44
44
|
"@types/gradient-parser": "1.1.0",
|
|
45
45
|
"@types/highlight-words-core": "1.2.1",
|
|
46
46
|
"@use-gesture/react": "^10.3.1",
|
|
47
|
-
"@wordpress/a11y": "^4.
|
|
48
|
-
"@wordpress/compose": "^7.
|
|
49
|
-
"@wordpress/date": "^5.
|
|
50
|
-
"@wordpress/deprecated": "^4.
|
|
51
|
-
"@wordpress/dom": "^4.
|
|
52
|
-
"@wordpress/element": "^6.
|
|
53
|
-
"@wordpress/escape-html": "^3.
|
|
54
|
-
"@wordpress/hooks": "^4.
|
|
55
|
-
"@wordpress/html-entities": "^4.
|
|
56
|
-
"@wordpress/i18n": "^6.
|
|
57
|
-
"@wordpress/icons": "^10.
|
|
58
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
59
|
-
"@wordpress/keycodes": "^4.
|
|
60
|
-
"@wordpress/primitives": "^4.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/rich-text": "^7.
|
|
63
|
-
"@wordpress/warning": "^3.
|
|
47
|
+
"@wordpress/a11y": "^4.30.0",
|
|
48
|
+
"@wordpress/compose": "^7.30.0",
|
|
49
|
+
"@wordpress/date": "^5.30.0",
|
|
50
|
+
"@wordpress/deprecated": "^4.30.0",
|
|
51
|
+
"@wordpress/dom": "^4.30.0",
|
|
52
|
+
"@wordpress/element": "^6.30.0",
|
|
53
|
+
"@wordpress/escape-html": "^3.30.0",
|
|
54
|
+
"@wordpress/hooks": "^4.30.0",
|
|
55
|
+
"@wordpress/html-entities": "^4.30.0",
|
|
56
|
+
"@wordpress/i18n": "^6.3.0",
|
|
57
|
+
"@wordpress/icons": "^10.30.0",
|
|
58
|
+
"@wordpress/is-shallow-equal": "^5.30.0",
|
|
59
|
+
"@wordpress/keycodes": "^4.30.0",
|
|
60
|
+
"@wordpress/primitives": "^4.30.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.30.0",
|
|
62
|
+
"@wordpress/rich-text": "^7.30.0",
|
|
63
|
+
"@wordpress/warning": "^3.30.0",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"clsx": "^2.1.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
67
67
|
"date-fns": "^3.6.0",
|
|
68
68
|
"deepmerge": "^4.3.0",
|
|
69
69
|
"fast-deep-equal": "^3.1.3",
|
|
70
|
-
"framer-motion": "^11.
|
|
70
|
+
"framer-motion": "^11.15.0",
|
|
71
71
|
"gradient-parser": "1.1.1",
|
|
72
72
|
"highlight-words-core": "^1.2.2",
|
|
73
73
|
"is-plain-object": "^5.0.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c66cb089eed19d4f4956962fa7b4c81abe6dd513"
|
|
90
90
|
}
|
|
@@ -34,6 +34,7 @@ import { DateRangeCalendar, TZDate } from '..';
|
|
|
34
34
|
const meta: Meta< typeof DateRangeCalendar > = {
|
|
35
35
|
title: 'Components/Selection & Input/Time & Date/DateRangeCalendar',
|
|
36
36
|
component: DateRangeCalendar,
|
|
37
|
+
tags: [ 'status-private' ],
|
|
37
38
|
argTypes: {
|
|
38
39
|
locale: {
|
|
39
40
|
options: [
|
package/src/card/context.ts
CHANGED
|
@@ -9,5 +9,6 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
9
9
|
import type { CompositeContextProps } from './types';
|
|
10
10
|
|
|
11
11
|
export const CompositeContext = createContext< CompositeContextProps >( {} );
|
|
12
|
+
CompositeContext.displayName = 'CompositeContext';
|
|
12
13
|
|
|
13
14
|
export const useCompositeContext = () => useContext( CompositeContext );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { ForwardedRef,
|
|
4
|
+
import type { ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -114,7 +114,7 @@ function _contextConnect<
|
|
|
114
114
|
* @return The connected namespaces.
|
|
115
115
|
*/
|
|
116
116
|
export function getConnectNamespace(
|
|
117
|
-
Component:
|
|
117
|
+
Component: ReactElement | number | string | undefined | {}
|
|
118
118
|
): string[] {
|
|
119
119
|
if ( ! Component ) {
|
|
120
120
|
return [];
|
|
@@ -25,6 +25,8 @@ import { useUpdateEffect } from '../utils';
|
|
|
25
25
|
export const ComponentsContext = createContext(
|
|
26
26
|
/** @type {Record<string, any>} */ ( {} )
|
|
27
27
|
);
|
|
28
|
+
ComponentsContext.displayName = 'ComponentsContext';
|
|
29
|
+
|
|
28
30
|
export const useComponentsContext = () => useContext( ComponentsContext );
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -28,6 +28,7 @@ import BaseControl from '../base-control';
|
|
|
28
28
|
|
|
29
29
|
export const CustomSelectContext =
|
|
30
30
|
createContext< CustomSelectContextType >( undefined );
|
|
31
|
+
CustomSelectContext.displayName = 'CustomSelectContext';
|
|
31
32
|
|
|
32
33
|
function defaultRenderSelectedValue(
|
|
33
34
|
value: CustomSelectButtonProps[ 'value' ]
|
package/src/disabled/index.tsx
CHANGED
|
@@ -11,5 +11,6 @@ import type { ItemGroupContext as Context } from './types';
|
|
|
11
11
|
export const ItemGroupContext = createContext( {
|
|
12
12
|
size: 'medium',
|
|
13
13
|
} as Context );
|
|
14
|
+
ItemGroupContext.displayName = 'ItemGroupContext';
|
|
14
15
|
|
|
15
16
|
export const useItemGroupContext = () => useContext( ItemGroupContext );
|
package/src/menu/context.tsx
CHANGED
package/src/modal/index.tsx
CHANGED
|
@@ -44,6 +44,7 @@ type Dismissers = Set<
|
|
|
44
44
|
React.RefObject< ModalProps[ 'onRequestClose' ] | undefined >
|
|
45
45
|
>;
|
|
46
46
|
const ModalContext = createContext< Dismissers >( new Set() );
|
|
47
|
+
ModalContext.displayName = 'ModalContext';
|
|
47
48
|
|
|
48
49
|
// Used to track body class names applied while modals are open.
|
|
49
50
|
const bodyOpenClasses = new Map< string, number >();
|
|
@@ -10,6 +10,7 @@ import type { NavigationGroupContext as NavigationGroupContextType } from '../ty
|
|
|
10
10
|
|
|
11
11
|
export const NavigationGroupContext =
|
|
12
12
|
createContext< NavigationGroupContextType >( { group: undefined } );
|
|
13
|
+
NavigationGroupContext.displayName = 'NavigationGroupContext';
|
|
13
14
|
|
|
14
15
|
export const useNavigationGroupContext = () =>
|
|
15
16
|
useContext( NavigationGroupContext );
|
package/src/navigator/context.ts
CHANGED
package/src/popover/index.tsx
CHANGED
|
@@ -102,6 +102,7 @@ const ArrowTriangle = () => (
|
|
|
102
102
|
);
|
|
103
103
|
|
|
104
104
|
const slotNameContext = createContext< string | undefined >( undefined );
|
|
105
|
+
slotNameContext.displayName = '__unstableSlotNameContext';
|
|
105
106
|
|
|
106
107
|
const fallbackContainerClassname = 'components-popover__fallback-container';
|
|
107
108
|
const getPopoverFallbackContainer = () => {
|
package/src/slot-fill/context.ts
CHANGED
package/src/tabs/context.ts
CHANGED
|
@@ -9,5 +9,6 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
9
9
|
import type { TabsContextProps } from './types';
|
|
10
10
|
|
|
11
11
|
export const TabsContext = createContext< TabsContextProps >( undefined );
|
|
12
|
+
TabsContext.displayName = 'TabsContext';
|
|
12
13
|
|
|
13
14
|
export const useTabsContext = () => useContext( TabsContext );
|
package/src/tabs/styles.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Ariakit from '@ariakit/react';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { COLORS, CONFIG } from '../utils';
|
|
10
|
+
import { COLORS, CONFIG, font } from '../utils';
|
|
11
11
|
import { space } from '../utils/space';
|
|
12
12
|
import Icon from '../icon';
|
|
13
13
|
|
|
@@ -163,6 +163,7 @@ export const Tab = styled( Ariakit.Tab )`
|
|
|
163
163
|
cursor: pointer;
|
|
164
164
|
line-height: 1.2; // Characters in some languages (e.g. Japanese) may have a native higher line-height.
|
|
165
165
|
font-weight: 400;
|
|
166
|
+
font-size: ${ font( 'default.fontSize' ) };
|
|
166
167
|
color: ${ COLORS.theme.foreground };
|
|
167
168
|
|
|
168
169
|
&[aria-disabled='true'] {
|