@cimpress-ui/react 0.0.1 → 0.1.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/LICENSE +201 -0
- package/README.md +5 -1
- package/dist/commonjs/components/button/button.d.ts +1 -1
- package/dist/commonjs/components/button/button.js +1 -1
- package/dist/commonjs/components/button/button.js.map +1 -1
- package/dist/commonjs/components/button/icon-button.d.ts +1 -1
- package/dist/commonjs/components/button/icon-button.js +1 -1
- package/dist/commonjs/components/button/icon-button.js.map +1 -1
- package/dist/commonjs/components/button/icon-link-button.d.ts +2 -2
- package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/icon-link-button.js +1 -1
- package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
- package/dist/commonjs/components/button/link-button.d.ts +2 -2
- package/dist/commonjs/components/button/link-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/link-button.js +1 -1
- package/dist/commonjs/components/button/link-button.js.map +1 -1
- package/dist/commonjs/components/button/types.d.ts +1 -1
- package/dist/commonjs/components/button/types.d.ts.map +1 -1
- package/dist/commonjs/components/button/types.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox.d.ts +1 -1
- package/dist/commonjs/components/checkbox/checkbox.js +1 -1
- package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts +3 -3
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.js +2 -2
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
- package/dist/commonjs/components/menu/menu.d.ts +5 -4
- package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
- package/dist/commonjs/components/menu/menu.js +3 -3
- package/dist/commonjs/components/menu/menu.js.map +1 -1
- package/dist/commonjs/components/radio/radio-group.d.ts +1 -1
- package/dist/commonjs/components/radio/radio-group.js +1 -1
- package/dist/commonjs/components/radio/radio-group.js.map +1 -1
- package/dist/commonjs/components/radio/radio.d.ts +1 -1
- package/dist/commonjs/components/radio/radio.js +1 -1
- package/dist/commonjs/components/radio/radio.js.map +1 -1
- package/dist/commonjs/components/select/select.d.ts +4 -4
- package/dist/commonjs/components/select/select.d.ts.map +1 -1
- package/dist/commonjs/components/select/select.js +3 -3
- package/dist/commonjs/components/select/select.js.map +1 -1
- package/dist/commonjs/components/spinner/spinner.d.ts +5 -1
- package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
- package/dist/commonjs/components/spinner/spinner.js +5 -2
- package/dist/commonjs/components/spinner/spinner.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-area.d.ts +1 -1
- package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.d.ts +2 -2
- package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.js +1 -1
- package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
- package/dist/commonjs/components/types.d.ts +16 -4
- package/dist/commonjs/components/types.d.ts.map +1 -1
- package/dist/commonjs/components/types.js.map +1 -1
- package/dist/commonjs/components/typography/link.d.ts +6 -2
- package/dist/commonjs/components/typography/link.d.ts.map +1 -1
- package/dist/commonjs/components/typography/link.js +5 -2
- package/dist/commonjs/components/typography/link.js.map +1 -1
- package/dist/commonjs/components/typography/text.d.ts +5 -1
- package/dist/commonjs/components/typography/text.d.ts.map +1 -1
- package/dist/commonjs/components/typography/text.js +5 -2
- package/dist/commonjs/components/typography/text.js.map +1 -1
- package/dist/commonjs/components/typography/types.d.ts +1 -1
- package/dist/commonjs/components/typography/types.d.ts.map +1 -1
- package/dist/commonjs/components/typography/types.js.map +1 -1
- package/dist/commonjs/icons/accounting-document.d.ts +8 -0
- package/dist/commonjs/icons/accounting-document.d.ts.map +1 -0
- package/dist/commonjs/icons/accounting-document.js +22 -0
- package/dist/commonjs/icons/accounting-document.js.map +1 -0
- package/dist/commonjs/icons/add-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/add-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/add-circle-fill.js +22 -0
- package/dist/commonjs/icons/add-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/add-circle.d.ts +8 -0
- package/dist/commonjs/icons/add-circle.d.ts.map +1 -0
- package/dist/commonjs/icons/add-circle.js +22 -0
- package/dist/commonjs/icons/add-circle.js.map +1 -0
- package/dist/commonjs/icons/add.d.ts +1 -1
- package/dist/commonjs/icons/add.d.ts.map +1 -1
- package/dist/commonjs/icons/add.js +4 -3
- package/dist/commonjs/icons/add.js.map +1 -1
- package/dist/commonjs/icons/alert-triangle.d.ts +1 -1
- package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -1
- package/dist/commonjs/icons/alert-triangle.js +4 -3
- package/dist/commonjs/icons/alert-triangle.js.map +1 -1
- package/dist/commonjs/icons/calculator-alt.d.ts +8 -0
- package/dist/commonjs/icons/calculator-alt.d.ts.map +1 -0
- package/dist/commonjs/icons/calculator-alt.js +22 -0
- package/dist/commonjs/icons/calculator-alt.js.map +1 -0
- package/dist/commonjs/icons/calculator.d.ts +8 -0
- package/dist/commonjs/icons/calculator.d.ts.map +1 -0
- package/dist/commonjs/icons/calculator.js +22 -0
- package/dist/commonjs/icons/calculator.js.map +1 -0
- package/dist/commonjs/icons/checkmark-circle-fill.d.ts +1 -1
- package/dist/commonjs/icons/checkmark-circle-fill.d.ts.map +1 -1
- package/dist/commonjs/icons/checkmark-circle-fill.js +4 -3
- package/dist/commonjs/icons/checkmark-circle-fill.js.map +1 -1
- package/dist/commonjs/icons/checkmark-circle.d.ts +8 -0
- package/dist/commonjs/icons/checkmark-circle.d.ts.map +1 -0
- package/dist/commonjs/icons/checkmark-circle.js +22 -0
- package/dist/commonjs/icons/checkmark-circle.js.map +1 -0
- package/dist/commonjs/icons/checkmark-small.d.ts +1 -1
- package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -1
- package/dist/commonjs/icons/checkmark-small.js +4 -3
- package/dist/commonjs/icons/checkmark-small.js.map +1 -1
- package/dist/commonjs/icons/checkmark.d.ts +1 -1
- package/dist/commonjs/icons/checkmark.d.ts.map +1 -1
- package/dist/commonjs/icons/checkmark.js +4 -3
- package/dist/commonjs/icons/checkmark.js.map +1 -1
- package/dist/commonjs/icons/chevron-down-fill.d.ts +1 -1
- package/dist/commonjs/icons/chevron-down-fill.d.ts.map +1 -1
- package/dist/commonjs/icons/chevron-down-fill.js +4 -3
- package/dist/commonjs/icons/chevron-down-fill.js.map +1 -1
- package/dist/commonjs/icons/error-circle-fill.d.ts +1 -1
- package/dist/commonjs/icons/error-circle-fill.d.ts.map +1 -1
- package/dist/commonjs/icons/error-circle-fill.js +4 -3
- package/dist/commonjs/icons/error-circle-fill.js.map +1 -1
- package/dist/commonjs/icons/index.d.ts +8 -0
- package/dist/commonjs/icons/index.d.ts.map +1 -1
- package/dist/commonjs/icons/index.js +17 -1
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/icons/info-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/info-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/info-circle-fill.js +22 -0
- package/dist/commonjs/icons/info-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/minus-small.d.ts +1 -1
- package/dist/commonjs/icons/minus-small.d.ts.map +1 -1
- package/dist/commonjs/icons/minus-small.js +4 -3
- package/dist/commonjs/icons/minus-small.js.map +1 -1
- package/dist/commonjs/icons/warning-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/warning-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/warning-circle-fill.js +22 -0
- package/dist/commonjs/icons/warning-circle-fill.js.map +1 -0
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/with-style-props.d.ts.map +1 -1
- package/dist/esm/components/button/button.d.ts +1 -1
- package/dist/esm/components/button/button.js +1 -1
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/button/icon-button.d.ts +1 -1
- package/dist/esm/components/button/icon-button.js +1 -1
- package/dist/esm/components/button/icon-button.js.map +1 -1
- package/dist/esm/components/button/icon-link-button.d.ts +2 -2
- package/dist/esm/components/button/icon-link-button.d.ts.map +1 -1
- package/dist/esm/components/button/icon-link-button.js +1 -1
- package/dist/esm/components/button/icon-link-button.js.map +1 -1
- package/dist/esm/components/button/link-button.d.ts +2 -2
- package/dist/esm/components/button/link-button.d.ts.map +1 -1
- package/dist/esm/components/button/link-button.js +1 -1
- package/dist/esm/components/button/link-button.js.map +1 -1
- package/dist/esm/components/button/types.d.ts +1 -1
- package/dist/esm/components/button/types.d.ts.map +1 -1
- package/dist/esm/components/button/types.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.d.ts +1 -1
- package/dist/esm/components/checkbox/checkbox.js +1 -1
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/combo-box/combo-box.d.ts +3 -3
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/esm/components/combo-box/combo-box.js +2 -2
- package/dist/esm/components/combo-box/combo-box.js.map +1 -1
- package/dist/esm/components/menu/menu.d.ts +5 -4
- package/dist/esm/components/menu/menu.d.ts.map +1 -1
- package/dist/esm/components/menu/menu.js +3 -3
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/radio/radio-group.d.ts +1 -1
- package/dist/esm/components/radio/radio-group.js +1 -1
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/radio.d.ts +1 -1
- package/dist/esm/components/radio/radio.js +1 -1
- package/dist/esm/components/radio/radio.js.map +1 -1
- package/dist/esm/components/select/select.d.ts +4 -4
- package/dist/esm/components/select/select.d.ts.map +1 -1
- package/dist/esm/components/select/select.js +3 -3
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/spinner/spinner.d.ts +5 -1
- package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner/spinner.js +5 -2
- package/dist/esm/components/spinner/spinner.js.map +1 -1
- package/dist/esm/components/text-inputs/text-area.d.ts +1 -1
- package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-area.js.map +1 -1
- package/dist/esm/components/text-inputs/text-field.d.ts +2 -2
- package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-field.js +1 -1
- package/dist/esm/components/text-inputs/text-field.js.map +1 -1
- package/dist/esm/components/types.d.ts +16 -4
- package/dist/esm/components/types.d.ts.map +1 -1
- package/dist/esm/components/types.js.map +1 -1
- package/dist/esm/components/typography/link.d.ts +6 -2
- package/dist/esm/components/typography/link.d.ts.map +1 -1
- package/dist/esm/components/typography/link.js +5 -2
- package/dist/esm/components/typography/link.js.map +1 -1
- package/dist/esm/components/typography/text.d.ts +5 -1
- package/dist/esm/components/typography/text.d.ts.map +1 -1
- package/dist/esm/components/typography/text.js +5 -2
- package/dist/esm/components/typography/text.js.map +1 -1
- package/dist/esm/components/typography/types.d.ts +1 -1
- package/dist/esm/components/typography/types.d.ts.map +1 -1
- package/dist/esm/components/typography/types.js.map +1 -1
- package/dist/esm/icons/accounting-document.d.ts +8 -0
- package/dist/esm/icons/accounting-document.d.ts.map +1 -0
- package/dist/esm/icons/accounting-document.js +17 -0
- package/dist/esm/icons/accounting-document.js.map +1 -0
- package/dist/esm/icons/add-circle-fill.d.ts +8 -0
- package/dist/esm/icons/add-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/add-circle-fill.js +17 -0
- package/dist/esm/icons/add-circle-fill.js.map +1 -0
- package/dist/esm/icons/add-circle.d.ts +8 -0
- package/dist/esm/icons/add-circle.d.ts.map +1 -0
- package/dist/esm/icons/add-circle.js +17 -0
- package/dist/esm/icons/add-circle.js.map +1 -0
- package/dist/esm/icons/add.d.ts +1 -1
- package/dist/esm/icons/add.d.ts.map +1 -1
- package/dist/esm/icons/add.js +4 -3
- package/dist/esm/icons/add.js.map +1 -1
- package/dist/esm/icons/alert-triangle.d.ts +1 -1
- package/dist/esm/icons/alert-triangle.d.ts.map +1 -1
- package/dist/esm/icons/alert-triangle.js +4 -3
- package/dist/esm/icons/alert-triangle.js.map +1 -1
- package/dist/esm/icons/calculator-alt.d.ts +8 -0
- package/dist/esm/icons/calculator-alt.d.ts.map +1 -0
- package/dist/esm/icons/calculator-alt.js +17 -0
- package/dist/esm/icons/calculator-alt.js.map +1 -0
- package/dist/esm/icons/calculator.d.ts +8 -0
- package/dist/esm/icons/calculator.d.ts.map +1 -0
- package/dist/esm/icons/calculator.js +17 -0
- package/dist/esm/icons/calculator.js.map +1 -0
- package/dist/esm/icons/checkmark-circle-fill.d.ts +1 -1
- package/dist/esm/icons/checkmark-circle-fill.d.ts.map +1 -1
- package/dist/esm/icons/checkmark-circle-fill.js +4 -3
- package/dist/esm/icons/checkmark-circle-fill.js.map +1 -1
- package/dist/esm/icons/checkmark-circle.d.ts +8 -0
- package/dist/esm/icons/checkmark-circle.d.ts.map +1 -0
- package/dist/esm/icons/checkmark-circle.js +17 -0
- package/dist/esm/icons/checkmark-circle.js.map +1 -0
- package/dist/esm/icons/checkmark-small.d.ts +1 -1
- package/dist/esm/icons/checkmark-small.d.ts.map +1 -1
- package/dist/esm/icons/checkmark-small.js +4 -3
- package/dist/esm/icons/checkmark-small.js.map +1 -1
- package/dist/esm/icons/checkmark.d.ts +1 -1
- package/dist/esm/icons/checkmark.d.ts.map +1 -1
- package/dist/esm/icons/checkmark.js +4 -3
- package/dist/esm/icons/checkmark.js.map +1 -1
- package/dist/esm/icons/chevron-down-fill.d.ts +1 -1
- package/dist/esm/icons/chevron-down-fill.d.ts.map +1 -1
- package/dist/esm/icons/chevron-down-fill.js +4 -3
- package/dist/esm/icons/chevron-down-fill.js.map +1 -1
- package/dist/esm/icons/error-circle-fill.d.ts +1 -1
- package/dist/esm/icons/error-circle-fill.d.ts.map +1 -1
- package/dist/esm/icons/error-circle-fill.js +4 -3
- package/dist/esm/icons/error-circle-fill.js.map +1 -1
- package/dist/esm/icons/index.d.ts +8 -0
- package/dist/esm/icons/index.d.ts.map +1 -1
- package/dist/esm/icons/index.js +8 -0
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/icons/info-circle-fill.d.ts +8 -0
- package/dist/esm/icons/info-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/info-circle-fill.js +17 -0
- package/dist/esm/icons/info-circle-fill.js.map +1 -0
- package/dist/esm/icons/minus-small.d.ts +1 -1
- package/dist/esm/icons/minus-small.d.ts.map +1 -1
- package/dist/esm/icons/minus-small.js +4 -3
- package/dist/esm/icons/minus-small.js.map +1 -1
- package/dist/esm/icons/warning-circle-fill.d.ts +8 -0
- package/dist/esm/icons/warning-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/warning-circle-fill.js +17 -0
- package/dist/esm/icons/warning-circle-fill.js.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/with-style-props.d.ts.map +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +25 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OA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from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio usage guidelines](https://ui.cimpress.io/components/radio
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAoC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,MAAC,QAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,kBAAkB,YAC/B,cAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
|
|
1
|
+
import { type ListBoxProps as RACListBoxProps, type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
|
|
2
2
|
import type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
|
|
3
|
-
export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder'> {
|
|
3
|
+
export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Allows users to select one item from a collapsible list.
|
|
7
7
|
*
|
|
8
|
-
* See [select usage guidelines](https://ui.cimpress.io/components/select/
|
|
8
|
+
* See [select usage guidelines](https://ui.cimpress.io/components/select/).
|
|
9
9
|
*/
|
|
10
10
|
declare const _Select: <T extends CollectionItem>(props: SelectProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
11
11
|
export { _Select as Select };
|
|
12
|
-
export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled'> {
|
|
12
|
+
export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
13
13
|
children: StringLikeChildren;
|
|
14
14
|
}
|
|
15
15
|
/** Renders a single list item within `Select`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,IAAI,eAAe,EAMpC,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAA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Aa"}
|
|
@@ -9,7 +9,7 @@ import { withStyleProps } from '../../with-style-props.js';
|
|
|
9
9
|
import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
|
|
10
10
|
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
|
|
11
11
|
import { textStyle } from '../typography/utils.js';
|
|
12
|
-
function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
12
|
+
function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }, ref) {
|
|
13
13
|
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
@@ -19,12 +19,12 @@ function Select({ children, items, label, description, error, UNSAFE_className,
|
|
|
19
19
|
if (items != null && typeof children !== 'function') {
|
|
20
20
|
console.warn('`Select` requires `children` to be a function when using `items` prop');
|
|
21
21
|
}
|
|
22
|
-
return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", items: items, children: children }) })] }));
|
|
22
|
+
return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", onScroll: onScroll, items: items, children: children }) })] }));
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Allows users to select one item from a collapsible list.
|
|
26
26
|
*
|
|
27
|
-
* See [select usage guidelines](https://ui.cimpress.io/components/select/
|
|
27
|
+
* See [select usage guidelines](https://ui.cimpress.io/components/select/).
|
|
28
28
|
*/
|
|
29
29
|
const _Select = withStyleProps(forwardRef(Select), 'Select');
|
|
30
30
|
export { _Select as Select };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,UAAU,
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,UAAU,EAErB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,MAAM,IAAI,SAAS,EACnB,WAAW,IAAI,cAAc,EAC7B,IAAI,IAAI,OAAO,GAGhB,MAAM,uBAAuB,CA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,EAEjB,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,IACT,CACJ,GACc,CAClB,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAStC,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAyB;IACjH,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDownFill />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckmark />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
|
|
@@ -6,7 +6,11 @@ export interface SpinnerProps extends CommonProps, LabellableProps {
|
|
|
6
6
|
*/
|
|
7
7
|
size?: 'small' | 'medium' | 'large';
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Displays a loading indicator to represent an ongoing operation.
|
|
11
|
+
*
|
|
12
|
+
* See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
|
|
13
|
+
*/
|
|
10
14
|
declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
11
15
|
export { _Spinner as Spinner };
|
|
12
16
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AA8BD;;;;GAIG;AACH,QAAA,MAAM,QAAQ,8JAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -25,8 +25,11 @@ function Spinner({ size = 'medium', label, ...props }, ref) {
|
|
|
25
25
|
}, [label, ariaLabel, ariaLabelledBy]);
|
|
26
26
|
return (_jsx(InternalSpinner, { ...props, size: ringSizes[size], spinnerRef: ref, children: label && _jsx(RACLabel, { className: textStyle({ variant: labelVariants[size], tone: 'title' }), children: label }) }));
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Displays a loading indicator to represent an ongoing operation.
|
|
30
|
+
*
|
|
31
|
+
* See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
|
|
32
|
+
*/
|
|
30
33
|
const _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');
|
|
31
34
|
export { _Spinner as Spinner };
|
|
32
35
|
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUnD,MAAM,SAAS,GAAsD;IACnE,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,aAAa,GAA2E;IAC5F,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,SAAS,OAAO,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB,EAAE,GAAiC;IACpG,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE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KAAK,EAAE,GAAG,KAAK,EAAgB,EAAE,GAAiC;IACpG,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;QACjG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,OAAO,CACL,KAAC,eAAe,OAAK,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,YAC/D,KAAK,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,YAAG,KAAK,GAAY,GAC7F,CACnB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Label as RACLabel } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { InternalSpinner } from '../internal/spinner/spinner.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\nimport type { TextStyleOptions } from '../typography/types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SpinnerProps extends CommonProps, LabellableProps {\n /**\n * Determines the size of the spinner.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n}\n\nconst ringSizes: Record<NonNullable<SpinnerProps['size']>, string> = {\n small: '24px',\n medium: '48px',\n large: '80px',\n};\n\nconst labelVariants: Record<NonNullable<SpinnerProps['size']>, TextStyleOptions['variant']> = {\n small: 'small',\n medium: 'medium',\n large: 'body',\n};\n\nfunction Spinner({ size = 'medium', label, ...props }: SpinnerProps, ref: ForwardedRef<HTMLDivElement>) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <InternalSpinner {...props} size={ringSizes[size]} spinnerRef={ref}>\n {label && <RACLabel className={textStyle({ variant: labelVariants[size], tone: 'title' })}>{label}</RACLabel>}\n </InternalSpinner>\n );\n}\n\n/**\n * Displays a loading indicator to represent an ongoing operation.\n *\n * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).\n */\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TextAreaProps as RACTextAreaProps, type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
2
|
import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
-
export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {
|
|
3
|
+
export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'onFocus' | 'onBlur'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {
|
|
4
4
|
}
|
|
5
5
|
/** Allows users to enter multiple lines of text with a keyboard. */
|
|
6
6
|
declare const _TextArea: (props: TextAreaProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,CACX,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAgDhG,oEAAoE;AACpE,QAAA,MAAM,SAAS,+JAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,SAAS,IAAI,YAAY,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,SAAS,IAAI,YAAY,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MA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c,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED,qCAAqC;AACrC,oEAAoE;AACpE,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n TextArea as RACTextArea,\n TextField as RACTextField,\n type TextAreaProps as RACTextAreaProps,\n type TextFieldProps as RACTextFieldProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextAreaProps\n extends CommonProps,\n FieldWithPlaceholderProps<string>,\n Pick<\n RACTextFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'name'\n | 'type'\n | 'autoFocus'\n | 'autoComplete'\n | 'inputMode'\n | 'minLength'\n | 'maxLength'\n | 'onFocus'\n | 'onBlur'\n >,\n Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {}\n\nfunction TextArea(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n autoCapitalize,\n autoCorrect,\n rows,\n spellCheck,\n wrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TextArea requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACTextField {...props} ref={ref} className={clsx('cim-text-area', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACTextArea\n className={clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' }))}\n placeholder={placeholder}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n rows={rows}\n spellCheck={spellCheck}\n wrap={wrap}\n />\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTextField>\n );\n}\n\n// TODO: add link to usage guidelines\n/** Allows users to enter multiple lines of text with a keyboard. */\nconst _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');\n\nexport { _TextArea as TextArea };\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
2
|
import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
-
export interface TextFieldProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern'> {
|
|
3
|
+
export interface TextFieldProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern' | 'onFocus' | 'onBlur'> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Allows users to enter a single line of text with a keyboard.
|
|
7
7
|
*
|
|
8
|
-
* See [text field usage guidelines](https://ui.cimpress.io/components/text-field/
|
|
8
|
+
* See [text field usage guidelines](https://ui.cimpress.io/components/text-field/).
|
|
9
9
|
*/
|
|
10
10
|
declare const _TextField: (props: TextFieldProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
11
11
|
export { _TextField as TextField };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,cACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,cACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CACX;CAAG;AA6BR;;;;GAIG;AACH,QAAA,MAAM,UAAU,gKAAqD,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -19,7 +19,7 @@ function TextField({ label, description, error: errorMessage, placeholder, UNSAF
|
|
|
19
19
|
/**
|
|
20
20
|
* Allows users to enter a single line of text with a keyboard.
|
|
21
21
|
*
|
|
22
|
-
* See [text field usage guidelines](https://ui.cimpress.io/components/text-field/
|
|
22
|
+
* See [text field usage guidelines](https://ui.cimpress.io/components/text-field/).
|
|
23
23
|
*/
|
|
24
24
|
const _TextField = withStyleProps(forwardRef(TextField), 'TextField');
|
|
25
25
|
export { _TextField as TextField };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,IAAI,QAAQ,EACjB,SAAS,IAAI,YAAY,GAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,IAAI,QAAQ,EACjB,SAAS,IAAI,YA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WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Input as RACInput,\n TextField as RACTextField,\n type TextFieldProps as RACTextFieldProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextFieldProps\n extends CommonProps,\n FieldWithPlaceholderProps<string>,\n Pick<\n RACTextFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'name'\n | 'type'\n | 'autoFocus'\n | 'autoComplete'\n | 'inputMode'\n | 'minLength'\n | 'maxLength'\n | 'pattern'\n | 'onFocus'\n | 'onBlur'\n > {}\n\nfunction TextField(\n { label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, ...props }: TextFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TextField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACTextField {...props} ref={ref} className={clsx('cim-text-field', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACInput\n className={clsx('cim-text-field-input', textStyle({ variant: 'medium', tone: 'base' }))}\n placeholder={placeholder}\n />\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTextField>\n );\n}\n\n/**\n * Allows users to enter a single line of text with a keyboard.\n *\n * See [text field usage guidelines](https://ui.cimpress.io/components/text-field/).\n */\nconst _TextField = withStyleProps(forwardRef(TextField), 'TextField');\n\nexport { _TextField as TextField };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { LinkProps as RACLinkProps, PressEvent as RACPressEvent, ValidationResult as RACValidationResult } from 'react-aria-components';
|
|
2
|
+
import type { ButtonProps as RACButtonProps, LinkProps as RACLinkProps, PressEvent as RACPressEvent, ValidationResult as RACValidationResult } from 'react-aria-components';
|
|
3
3
|
/** Represents an identifier for a collection item. */
|
|
4
4
|
export type Key = string | number;
|
|
5
5
|
/** Represents a direction (vertical or horizontal). */
|
|
@@ -20,10 +20,18 @@ export interface CommonProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
|
|
22
22
|
*/
|
|
23
|
-
'data-cim-style-root'?: boolean;
|
|
24
|
-
/**
|
|
23
|
+
'data-cim-style-root'?: boolean | 'no-reset';
|
|
24
|
+
/**
|
|
25
|
+
* Sets the CSS className for the element. Only use as a **last resort**. Use style props instead.
|
|
26
|
+
*
|
|
27
|
+
* See [styling guide](https://ui.cimpress.io/dev-guides/styling/).
|
|
28
|
+
*/
|
|
25
29
|
UNSAFE_className?: string;
|
|
26
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Sets the CSS style for the element. Only use as a **last resort**. Use style props instead.
|
|
32
|
+
*
|
|
33
|
+
* See [styling guide](https://ui.cimpress.io/dev-guides/styling/).
|
|
34
|
+
*/
|
|
27
35
|
UNSAFE_style?: CSSProperties;
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
@@ -34,6 +42,8 @@ export interface CommonProps {
|
|
|
34
42
|
* it can call `continuePropagation()` to allow a parent to handle it.
|
|
35
43
|
*/
|
|
36
44
|
export type PressEvent = RACPressEvent;
|
|
45
|
+
/** An event fired when a component is hovered. */
|
|
46
|
+
export type HoverEvent = Parameters<NonNullable<RACButtonProps['onHoverStart']>>[0];
|
|
37
47
|
/**
|
|
38
48
|
* Props for components that require a label, which can be hidden if necessary.
|
|
39
49
|
*/
|
|
@@ -131,5 +141,7 @@ export interface IconProps extends CommonProps, Pick<LabellableProps, 'aria-labe
|
|
|
131
141
|
* @default true
|
|
132
142
|
*/
|
|
133
143
|
'aria-hidden'?: boolean;
|
|
144
|
+
/** The size of the icon in pixels. */
|
|
145
|
+
size?: 16 | 24 | 32;
|
|
134
146
|
}
|
|
135
147
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,SAAS,IAAI,YAAY,EACzB,UAAU,IAAI,aAAa,EAC3B,gBAAgB,IAAI,mBAAmB,EACxC,MAAM,uBAAuB,CAAC;AAE/B,sDAAsD;AACtD,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;AAElC,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources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AE,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,gBAAgB,CAAC;IAClG,wBAAwB;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,qDAAqD;IACrD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,EAAE,EAAE,GAAG,CAAC;CACT;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,cAAc;IACvD,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC;IAChD,8CAA8C;IAC9C,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACrB;AAED,gCAAgC;AAChC,MAAM,WAAW,SAAU,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACrG;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sCAAsC;IACtC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type {\n LinkProps as RACLinkProps,\n PressEvent as RACPressEvent,\n ValidationResult as RACValidationResult,\n} from 'react-aria-components';\n\n/** Represents an identifier for a collection item. */\nexport type Key = string | number;\n\n/** Represents a direction (vertical or horizontal). */\nexport type Direction = 'vertical' | 'horizontal';\n\n/**\n * Use this type when you want to restrict `children` to a string,\n * but also want to allow expressions that resolve to strings.\n */\nexport type StringLikeChildren = string | number | (string | number)[];\n\n/**\n * A set of common props that are allowed on every component\n */\nexport interface CommonProps {\n /**\n * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n */\n id?: string;\n /**\n * Use this attribute to \"claim\" the component tree for exclusive Cimpress UI usage.\n */\n 'data-cim-style-root'?: boolean;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type {\n ButtonProps as RACButtonProps,\n LinkProps as RACLinkProps,\n PressEvent as RACPressEvent,\n ValidationResult as RACValidationResult,\n} from 'react-aria-components';\n\n/** Represents an identifier for a collection item. */\nexport type Key = string | number;\n\n/** Represents a direction (vertical or horizontal). */\nexport type Direction = 'vertical' | 'horizontal';\n\n/**\n * Use this type when you want to restrict `children` to a string,\n * but also want to allow expressions that resolve to strings.\n */\nexport type StringLikeChildren = string | number | (string | number)[];\n\n/**\n * A set of common props that are allowed on every component\n */\nexport interface CommonProps {\n /**\n * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n */\n id?: string;\n /**\n * Use this attribute to \"claim\" the component tree for exclusive Cimpress UI usage.\n */\n 'data-cim-style-root'?: boolean | 'no-reset';\n /**\n * Sets the CSS className for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_className?: string;\n /**\n * Sets the CSS style for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_style?: CSSProperties;\n}\n\n/**\n * An event fired when a component is pressed.\n *\n * By default, press events stop propagation to parent elements.\n * In cases where a handler decides not to handle a specific event,\n * it can call `continuePropagation()` to allow a parent to handle it.\n */\nexport type PressEvent = RACPressEvent;\n\n// HoverEvent is not exported from react-aria-components\n/** An event fired when a component is hovered. */\nexport type HoverEvent = Parameters<NonNullable<RACButtonProps['onHoverStart']>>[0];\n\n/**\n * Props for components that require a label, which can be hidden if necessary.\n */\n// Copied and modified from AriaLabelingProps from @react-types/shared\nexport interface LabellableProps {\n /** The content to display as the label. */\n label?: string;\n\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string;\n\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string;\n\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string;\n\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string;\n}\n\n/** Provides details about the validation state of a form field. */\nexport type ValidationResult = RACValidationResult;\n\n/** Represents the error message(s) for a form field. */\nexport type FieldError =\n | string\n | string[]\n | undefined\n | ((validation: ValidationResult) => string | string[] | undefined);\n\n/** Props available on form field components. */\nexport interface FieldProps<T> extends LabellableProps {\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: string;\n /** An error message for the field. */\n error?: FieldError;\n /**\n * A function that returns an error message (or `true`) if a given value is invalid.\n * Validation errors are displayed to the user when the form is submitted.\n * For real-time validation, use the `error` prop instead.\n */\n validate?: (value: T) => string | string[] | true | undefined;\n}\n\n/** Props available on form field components with text inputs. */\nexport interface FieldWithPlaceholderProps<T> extends FieldProps<T> {\n /** The placeholder text displayed in the input field. */\n placeholder?: string;\n}\n\n/** Changes specified optional properties within the provided type to be required. */\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\n/**\n * This interface allows configuring navigation props with router options and type-safe URLs via TypeScript module augmentation.\n * By default, this is an empty interface. Extend with `href` and `routerOptions` properties to configure your router.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RouterConfig {}\n\n/**\n * Represents a URL for navigation components.\n * This type can be configured by augmenting `RouterConfig` with an `href` property.\n */\nexport type Href = RouterConfig extends { href: infer H } ? H : string;\n\n/**\n * Represents router options for navigation components.\n * This type can be configured by augmenting `RouterConfig` with a `routerOptions` property.\n */\nexport type RouterOptions = RouterConfig extends { routerOptions: infer O } ? O : never;\n\n/**\n * Props available on components that perform navigation.\n */\nexport interface NavigationProps\n extends Pick<RACLinkProps, 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy'> {\n /** A URL to link to. */\n href?: Href;\n /** Options for the configured client side router. */\n routerOptions?: RouterOptions;\n}\n\n/** Represents a minimal data shape of a dynamic item in collection components. */\nexport interface CollectionItem {\n /** Unique identifier for the item or group. */\n id: Key;\n}\n\n/** Props available on components that render collections. */\nexport interface CollectionProps<T extends CollectionItem> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode);\n /** The items to display in the collection. */\n items?: Iterable<T>;\n}\n\n/** Props available on icons. */\nexport interface IconProps extends CommonProps, Pick<LabellableProps, 'aria-label' | 'aria-labelledby'> {\n /**\n * Whether the icon is hidden from assistive technologies.\n * @default true\n */\n 'aria-hidden'?: boolean;\n /** The size of the icon in pixels. */\n size?: 16 | 24 | 32;\n}\n"]}
|
|
@@ -2,13 +2,17 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import { type LinkProps as RACLinkProps } from 'react-aria-components';
|
|
3
3
|
import type { NavigationProps, WithRequired } from '../types.js';
|
|
4
4
|
import type { BaseTypographyProps } from './types.js';
|
|
5
|
-
export interface LinkProps extends Omit<BaseTypographyProps, 'id'>, WithRequired<NavigationProps, 'href'>, Pick<RACLinkProps, 'isDisabled'> {
|
|
5
|
+
export interface LinkProps extends Omit<BaseTypographyProps, 'id'>, WithRequired<NavigationProps, 'href'>, Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
6
6
|
/** An icon displayed before the link text. */
|
|
7
7
|
iconStart?: ReactNode;
|
|
8
8
|
/** An icon displayed after the link text. */
|
|
9
9
|
iconEnd?: ReactNode;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Displays a textual link that allows users to navigate to another page or resource.
|
|
13
|
+
*
|
|
14
|
+
* See [link usage guidelines](https://ui.cimpress.io/components/link/).
|
|
15
|
+
*/
|
|
12
16
|
declare const _Link: (props: LinkProps & import("react").RefAttributes<HTMLAnchorElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
13
17
|
export { _Link as Link };
|
|
14
18
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAKtD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EACrC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAKtD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EACrC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IAClE,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAyBD;;;;GAIG;AACH,QAAA,MAAM,KAAK,8JAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -9,8 +9,11 @@ const WORD_JOINER = '\u2060';
|
|
|
9
9
|
function Link({ children, iconStart, iconEnd, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
10
10
|
return (_jsxs(RACLink, { ...props, ref: ref, className: clsx('cim-link', UNSAFE_className), style: UNSAFE_style, children: [iconStart && (_jsxs(_Fragment, { children: [_jsx("span", { className: "cim-link-icon", children: iconStart }), WORD_JOINER] })), _jsx("span", { className: "cim-link-text", children: children }), iconEnd && (_jsxs(_Fragment, { children: [WORD_JOINER, _jsx("span", { className: "cim-link-icon", children: iconEnd })] }))] }));
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Displays a textual link that allows users to navigate to another page or resource.
|
|
14
|
+
*
|
|
15
|
+
* See [link usage guidelines](https://ui.cimpress.io/components/link/).
|
|
16
|
+
*/
|
|
14
17
|
const _Link = withStyleProps(forwardRef(Link), 'Link');
|
|
15
18
|
export { _Link as Link };
|
|
16
19
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,mDAAmD;AACnD,MAAM,WAAW,GAAG,QAAQ,CAAC;AAY7B,SAAS,IAAI,CACX,EAAE,QAAQ,EAAE,SAAS,EAAE,O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AAC,eAAe,YAAE,QAAQ,GAAQ,EAChD,OAAO,IAAI,CACV,8BACG,WAAW,EACZ,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,GAAQ,IAC/C,CACJ,IACO,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { NavigationProps, WithRequired } from '../types.js';\nimport type { BaseTypographyProps } from './types.js';\n\n// Used to prevent word wrap between icons and text\nconst WORD_JOINER = '\\u2060';\n\nexport interface LinkProps\n extends Omit<BaseTypographyProps, 'id'>,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** An icon displayed before the link text. */\n iconStart?: ReactNode;\n /** An icon displayed after the link text. */\n iconEnd?: ReactNode;\n}\n\nfunction Link(\n { children, iconStart, iconEnd, UNSAFE_className, UNSAFE_style, ...props }: LinkProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n return (\n <RACLink {...props} ref={ref} className={clsx('cim-link', UNSAFE_className)} style={UNSAFE_style}>\n {iconStart && (\n <>\n <span className=\"cim-link-icon\">{iconStart}</span>\n {WORD_JOINER}\n </>\n )}\n <span className=\"cim-link-text\">{children}</span>\n {iconEnd && (\n <>\n {WORD_JOINER}\n <span className=\"cim-link-icon\">{iconEnd}</span>\n </>\n )}\n </RACLink>\n );\n}\n\n/**\n * Displays a textual link that allows users to navigate to another page or resource.\n *\n * See [link usage guidelines](https://ui.cimpress.io/components/link/).\n */\nconst _Link = withStyleProps(forwardRef(Link), 'Link');\n\nexport { _Link as Link };\n"]}
|
|
@@ -5,7 +5,11 @@ export interface TextProps<T extends TextElement> extends BaseTypographyProps, T
|
|
|
5
5
|
/** The HTML element to render as. */
|
|
6
6
|
as: T;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Renders the provided text contents in a specified style.
|
|
10
|
+
*
|
|
11
|
+
* See [typography guide](https://ui.cimpress.io/foundations/typography/).
|
|
12
|
+
*/
|
|
9
13
|
declare const _Text: <T extends TextElement>(props: TextProps<T> & import("react").RefAttributes<ElementRef<T>> & import("../../with-style-props.js").StyleProps) => JSX.Element | null;
|
|
10
14
|
export { _Text as Text };
|
|
11
15
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAGpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGxE,KAAK,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAE7D,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,mBAAmB,EAAE,gBAAgB;IAC7F,qCAAqC;IACrC,EAAE,EAAE,CAAC,CAAC;CACP;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAGpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGxE,KAAK,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAE7D,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,mBAAmB,EAAE,gBAAgB;IAC7F,qCAAqC;IACrC,EAAE,EAAE,CAAC,CAAC;CACP;AA6BD;;;;GAIG;AACH,QAAA,MAAM,KAAK,GAhCG,CAAC,SAAS,WAAW,0HAOpB,IACX,OAAG,OAwB+C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -12,8 +12,11 @@ function Text({ children, as, variant, fontStyle, alignment, textDecoration, ton
|
|
|
12
12
|
style: UNSAFE_style,
|
|
13
13
|
}, children);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Renders the provided text contents in a specified style.
|
|
17
|
+
*
|
|
18
|
+
* See [typography guide](https://ui.cimpress.io/foundations/typography/).
|
|
19
|
+
*/
|
|
17
20
|
const _Text = withStyleProps(forwardRef(Text), 'Text');
|
|
18
21
|
export { _Text as Text };
|
|
19
22
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAgD,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,SAAS,IAAI,CACX,EACE,QAAQ,EACR,EAAE,EACF,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACK,EACf,GAAgC;IAEhC,OAAO,aAAa,CAClB,EAAE,EACF;QACE,GAAG,KAAK;QACR,GAAG;QACH,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,gBAAgB,CAAC;QACrG,KAAK,EAAE,YAAY;KACpB,EACD,QAAQ,CACT,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAgD,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,SAAS,IAAI,CACX,EACE,QAAQ,EACR,EAAE,EACF,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACK,EACf,GAAgC;IAEhC,OAAO,aAAa,CAClB,EAAE,EACF;QACE,GAAG,KAAK;QACR,GAAG;QACH,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,gBAAgB,CAAC;QACrG,KAAK,EAAE,YAAY;KACpB,EACD,QAAQ,CACT,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { createElement, type ForwardedRef, type ElementRef, type JSX } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { BaseTypographyProps, TextStyleOptions } from './types.js';\nimport { textStyle } from './utils.js';\n\ntype TextElement = Exclude<keyof JSX.IntrinsicElements, 'a'>;\n\nexport interface TextProps<T extends TextElement> extends BaseTypographyProps, TextStyleOptions {\n /** The HTML element to render as. */\n as: T;\n}\n\nfunction Text<T extends TextElement>(\n {\n children,\n as,\n variant,\n fontStyle,\n alignment,\n textDecoration,\n tone,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextProps<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n return createElement(\n as,\n {\n ...props,\n ref,\n className: clsx(textStyle({ variant, fontStyle, alignment, textDecoration, tone }), UNSAFE_className),\n style: UNSAFE_style,\n },\n children,\n );\n}\n\n/**\n * Renders the provided text contents in a specified style.\n *\n * See [typography guide](https://ui.cimpress.io/foundations/typography/).\n */\nconst _Text = withStyleProps(forwardRef(Text), 'Text');\n\nexport { _Text as Text };\n"]}
|
|
@@ -9,7 +9,7 @@ export interface BaseTypographyProps extends CommonProps, Omit<LabellableProps,
|
|
|
9
9
|
}
|
|
10
10
|
export interface TextStyleOptions {
|
|
11
11
|
/** Determines the visual variant of text. */
|
|
12
|
-
variant?: 'title-1' | 'title-2' | 'title-3' | 'title-4' | 'title-5' | 'title-6' | 'body' | 'body-semibold' | 'medium' | 'medium-semibold' | 'small' | 'small-semibold'
|
|
12
|
+
variant?: 'title-1' | 'title-2' | 'title-3' | 'title-4' | 'title-5' | 'title-6' | 'body' | 'body-semibold' | 'medium' | 'medium-semibold' | 'small' | 'small-semibold';
|
|
13
13
|
/** Whether the font should be styled with a normal or italic face. */
|
|
14
14
|
fontStyle?: 'normal' | 'italic';
|
|
15
15
|
/** Horizontal alignment of text. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACtF,mEAAmE;IACnE,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,CAAC,EACJ,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,MAAM,GACN,eAAe,GACf,QAAQ,GACR,iBAAiB,GACjB,OAAO,GACP,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACtF,mEAAmE;IACnE,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,CAAC,EACJ,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,MAAM,GACN,eAAe,GACf,QAAQ,GACR,iBAAiB,GACjB,OAAO,GACP,gBAAgB,CAAC;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IACnD,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,CAAC;IACxD,6CAA6C;IAC7C,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;CACnH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/typography/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { CommonProps, LabellableProps } from '../types.js';\n\n/**\n * Props available on all typography components.\n */\nexport interface BaseTypographyProps extends CommonProps, Omit<LabellableProps, 'label'> {\n /** Text to display. Allows nesting other typography components. */\n children: ReactNode;\n}\n\nexport interface TextStyleOptions {\n /** Determines the visual variant of text. */\n variant?:\n | 'title-1'\n | 'title-2'\n | 'title-3'\n | 'title-4'\n | 'title-5'\n | 'title-6'\n | 'body'\n | 'body-semibold'\n | 'medium'\n | 'medium-semibold'\n | 'small'\n | 'small-semibold'
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/typography/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { CommonProps, LabellableProps } from '../types.js';\n\n/**\n * Props available on all typography components.\n */\nexport interface BaseTypographyProps extends CommonProps, Omit<LabellableProps, 'label'> {\n /** Text to display. Allows nesting other typography components. */\n children: ReactNode;\n}\n\nexport interface TextStyleOptions {\n /** Determines the visual variant of text. */\n variant?:\n | 'title-1'\n | 'title-2'\n | 'title-3'\n | 'title-4'\n | 'title-5'\n | 'title-6'\n | 'body'\n | 'body-semibold'\n | 'medium'\n | 'medium-semibold'\n | 'small'\n | 'small-semibold';\n /** Whether the font should be styled with a normal or italic face. */\n fontStyle?: 'normal' | 'italic';\n /** Horizontal alignment of text. */\n alignment?: 'start' | 'center' | 'end' | 'justify';\n /** The kind of decorative line applied to the text. */\n textDecoration?: 'none' | 'strikethrough' | 'underline';\n /** Determines the color tone of the text. */\n tone?: 'title' | 'base' | 'subtle' | 'muted' | 'inverse' | 'action' | 'info' | 'success' | 'warning' | 'critical';\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from '../components/types.js';
|
|
2
|
+
/** Renders an SVG icon. */
|
|
3
|
+
declare const SvgAccountingDocument: {
|
|
4
|
+
({ size, "aria-hidden": ariaHidden, UNSAFE_className, UNSAFE_style, ...rest }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default SvgAccountingDocument;
|
|
8
|
+
//# sourceMappingURL=accounting-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-document.d.ts","sourceRoot":"","sources":["../../../src/icons/accounting-document.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,2BAA2B;AAC3B,QAAA,MAAM,qBAAqB;mFAMxB,SAAS;;CA2BX,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
const displayName = 'IconAccountingDocument';
|
|
4
|
+
/** Renders an SVG icon. */
|
|
5
|
+
const SvgAccountingDocument = ({ size, 'aria-hidden': ariaHidden, UNSAFE_className, UNSAFE_style, ...rest }) => {
|
|
6
|
+
const props = {
|
|
7
|
+
...rest,
|
|
8
|
+
'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),
|
|
9
|
+
className: clsx('cim-icon', UNSAFE_className),
|
|
10
|
+
width: size != null ? size + 'px' : '1em',
|
|
11
|
+
height: size != null ? size + 'px' : '1em',
|
|
12
|
+
};
|
|
13
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 32 32", "data-icon": "true", ...props, children: [_jsx("path", { fillRule: "evenodd", d: "M9 4a1 1 0 0 0-1 1v22a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V10h-4.5A1.5 1.5 0 0 1 18 8.5V4zm11 1.414L22.586 8H20zM6 5a3 3 0 0 1 3-3h10a1 1 0 0 1 .707.293l6 6A1 1 0 0 1 26 9v18a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3z", clipRule: "evenodd" }), _jsx("path", { fillRule: "evenodd", d: "M10 23a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2h-4a1 1 0 0 1-1-1m8-4a1 1 0 0 1 1-1h2a1 1 0 1 1 0 2h-2a1 1 0 0 1-1-1m0 4a1 1 0 0 1 1-1h2a1 1 0 1 1 0 2h-2a1 1 0 0 1-1-1M13 8.5a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1m0 8a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1", clipRule: "evenodd" }), _jsx("path", { fillRule: "evenodd", d: "M14.12 9.745c.318.075.761.222 1.087.548.372.372.573.761.68 1.078a2.3 2.3 0 0 1 .112.591v.02l.001.01v.006S16 12 15 12h1a1 1 0 0 1-1.999.05.74.74 0 0 0-.174-.306 1 1 0 0 0-.165-.052 3 3 0 0 0-.662-.067c-.252 0-.486.026-.662.067a1 1 0 0 0-.165.051.9.9 0 0 0-.23.463c-.015.117-.007.3.232.554.02.009.083.038.216.078.215.063.48.117.805.181l.023.005c.296.06.645.129.954.22.277.081.716.23 1.034.549 1.077 1.077 1.037 2.877 0 3.914-.326.326-.769.473-1.087.548a5 5 0 0 1-1.12.12 5 5 0 0 1-1.12-.12c-.318-.075-.761-.222-1.087-.548a2.8 2.8 0 0 1-.68-1.078 2.3 2.3 0 0 1-.112-.591v-.02l-.001-.01v-.006S10 16 11 16h-1a1 1 0 0 1 1.999-.05.74.74 0 0 0 .174.306c.021.01.073.03.165.052.176.041.41.067.662.067s.486-.026.662-.067c.09-.021.14-.04.164-.05.23-.271.234-.745-.004-1.02-.021-.009-.085-.038-.213-.075a10 10 0 0 0-.805-.182l-.023-.005c-.296-.06-.645-.129-.954-.22-.277-.081-.716-.23-1.034-.549-.691-.69-.932-1.496-.833-2.26.093-.71.466-1.287.833-1.654.326-.326.769-.473 1.087-.548a5 5 0 0 1 1.12-.12c.373 0 .764.037 1.12.12", clipRule: "evenodd" })] }));
|
|
14
|
+
};
|
|
15
|
+
SvgAccountingDocument.displayName = displayName;
|
|
16
|
+
export default SvgAccountingDocument;
|
|
17
|
+
//# sourceMappingURL=accounting-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-document.js","sourceRoot":"","sources":["../../../src/icons/accounting-document.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C,2BAA2B;AAC3B,MAAM,qBAAqB,GAAG,CAAC,EAC7B,IAAI,EACJ,aAAa,EAAE,UAAU,EACzB,gBAAgB,EAChB,YAAY,EACZ,GAAG,IAAI,EACG,EAAE,EAAE;IACd,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI;QACP,aAAa,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;QAC5F,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC;QAC7C,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;QACzC,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK;KAC3C,CAAC;IACF,OAAO,CACL,eAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,eAAW,MAAM,KAAK,KAAK,aACxG,eACE,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,yMAAyM,EAC3M,QAAQ,EAAC,SAAS,GAClB,EACF,eACE,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,sQAAsQ,EACxQ,QAAQ,EAAC,SAAS,GAClB,EACF,eACE,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,s/BAAs/B,EACx/B,QAAQ,EAAC,SAAS,GAClB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AACF,qBAAqB,CAAC,WAAW,GAAG,WAAW,CAAC;AAChD,eAAe,qBAAqB,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { IconProps } from '../components/types.js';\nconst displayName = 'IconAccountingDocument';\n/** Renders an SVG icon. */\nconst SvgAccountingDocument = ({\n size,\n 'aria-hidden': ariaHidden,\n UNSAFE_className,\n UNSAFE_style,\n ...rest\n}: IconProps) => {\n const props = {\n ...rest,\n 'aria-hidden': ariaHidden ?? (rest['aria-label'] == null && rest['aria-labelledby'] == null),\n className: clsx('cim-icon', UNSAFE_className),\n width: size != null ? size + 'px' : '1em',\n height: size != null ? size + 'px' : '1em',\n };\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 32 32\" data-icon=\"true\" {...props}>\n <path\n fillRule=\"evenodd\"\n d=\"M9 4a1 1 0 0 0-1 1v22a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V10h-4.5A1.5 1.5 0 0 1 18 8.5V4zm11 1.414L22.586 8H20zM6 5a3 3 0 0 1 3-3h10a1 1 0 0 1 .707.293l6 6A1 1 0 0 1 26 9v18a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3z\"\n clipRule=\"evenodd\"\n />\n <path\n fillRule=\"evenodd\"\n d=\"M10 23a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2h-4a1 1 0 0 1-1-1m8-4a1 1 0 0 1 1-1h2a1 1 0 1 1 0 2h-2a1 1 0 0 1-1-1m0 4a1 1 0 0 1 1-1h2a1 1 0 1 1 0 2h-2a1 1 0 0 1-1-1M13 8.5a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1m0 8a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1\"\n clipRule=\"evenodd\"\n />\n <path\n fillRule=\"evenodd\"\n d=\"M14.12 9.745c.318.075.761.222 1.087.548.372.372.573.761.68 1.078a2.3 2.3 0 0 1 .112.591v.02l.001.01v.006S16 12 15 12h1a1 1 0 0 1-1.999.05.74.74 0 0 0-.174-.306 1 1 0 0 0-.165-.052 3 3 0 0 0-.662-.067c-.252 0-.486.026-.662.067a1 1 0 0 0-.165.051.9.9 0 0 0-.23.463c-.015.117-.007.3.232.554.02.009.083.038.216.078.215.063.48.117.805.181l.023.005c.296.06.645.129.954.22.277.081.716.23 1.034.549 1.077 1.077 1.037 2.877 0 3.914-.326.326-.769.473-1.087.548a5 5 0 0 1-1.12.12 5 5 0 0 1-1.12-.12c-.318-.075-.761-.222-1.087-.548a2.8 2.8 0 0 1-.68-1.078 2.3 2.3 0 0 1-.112-.591v-.02l-.001-.01v-.006S10 16 11 16h-1a1 1 0 0 1 1.999-.05.74.74 0 0 0 .174.306c.021.01.073.03.165.052.176.041.41.067.662.067s.486-.026.662-.067c.09-.021.14-.04.164-.05.23-.271.234-.745-.004-1.02-.021-.009-.085-.038-.213-.075a10 10 0 0 0-.805-.182l-.023-.005c-.296-.06-.645-.129-.954-.22-.277-.081-.716-.23-1.034-.549-.691-.69-.932-1.496-.833-2.26.093-.71.466-1.287.833-1.654.326-.326.769-.473 1.087-.548a5 5 0 0 1 1.12-.12c.373 0 .764.037 1.12.12\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n};\nSvgAccountingDocument.displayName = displayName;\nexport default SvgAccountingDocument;\n"]}
|