@cimpress-ui/react 0.0.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 +17 -0
- package/dist/commonjs/components/button/button.d.ts +6 -0
- package/dist/commonjs/components/button/button.d.ts.map +1 -0
- package/dist/commonjs/components/button/button.js +18 -0
- package/dist/commonjs/components/button/button.js.map +1 -0
- package/dist/commonjs/components/button/icon-button.d.ts +6 -0
- package/dist/commonjs/components/button/icon-button.d.ts.map +1 -0
- package/dist/commonjs/components/button/icon-button.js +18 -0
- package/dist/commonjs/components/button/icon-button.js.map +1 -0
- package/dist/commonjs/components/button/icon-link-button.d.ts +7 -0
- package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -0
- package/dist/commonjs/components/button/icon-link-button.js +17 -0
- package/dist/commonjs/components/button/icon-link-button.js.map +1 -0
- package/dist/commonjs/components/button/link-button.d.ts +7 -0
- package/dist/commonjs/components/button/link-button.d.ts.map +1 -0
- package/dist/commonjs/components/button/link-button.js +17 -0
- package/dist/commonjs/components/button/link-button.js.map +1 -0
- package/dist/commonjs/components/button/types.d.ts +62 -0
- package/dist/commonjs/components/button/types.d.ts.map +1 -0
- package/dist/commonjs/components/button/types.js +3 -0
- package/dist/commonjs/components/button/types.js.map +1 -0
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts +11 -0
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -0
- package/dist/commonjs/components/checkbox/checkbox-group.js +31 -0
- package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -0
- package/dist/commonjs/components/checkbox/checkbox.d.ts +9 -0
- package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/commonjs/components/checkbox/checkbox.js +26 -0
- package/dist/commonjs/components/checkbox/checkbox.js.map +1 -0
- package/dist/commonjs/components/combo-box/combo-box.d.ts +33 -0
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -0
- package/dist/commonjs/components/combo-box/combo-box.js +45 -0
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -0
- package/dist/commonjs/components/form/form.d.ts +7 -0
- package/dist/commonjs/components/form/form.d.ts.map +1 -0
- package/dist/commonjs/components/form/form.js +17 -0
- package/dist/commonjs/components/form/form.js.map +1 -0
- package/dist/commonjs/components/form-field/form-field.d.ts +13 -0
- package/dist/commonjs/components/form-field/form-field.d.ts.map +1 -0
- package/dist/commonjs/components/form-field/form-field.js +36 -0
- package/dist/commonjs/components/form-field/form-field.js.map +1 -0
- package/dist/commonjs/components/menu/menu.d.ts +38 -0
- package/dist/commonjs/components/menu/menu.d.ts.map +1 -0
- package/dist/commonjs/components/menu/menu.js +43 -0
- package/dist/commonjs/components/menu/menu.js.map +1 -0
- package/dist/commonjs/components/radio/radio-group.d.ts +11 -0
- package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -0
- package/dist/commonjs/components/radio/radio-group.js +31 -0
- package/dist/commonjs/components/radio/radio-group.js.map +1 -0
- package/dist/commonjs/components/radio/radio.d.ts +9 -0
- package/dist/commonjs/components/radio/radio.d.ts.map +1 -0
- package/dist/commonjs/components/radio/radio.js +25 -0
- package/dist/commonjs/components/radio/radio.js.map +1 -0
- package/dist/commonjs/components/select/select.d.ts +28 -0
- package/dist/commonjs/components/select/select.d.ts.map +1 -0
- package/dist/commonjs/components/select/select.js +34 -0
- package/dist/commonjs/components/select/select.js.map +1 -0
- package/dist/commonjs/components/spacing/box/box.d.ts +8 -0
- package/dist/commonjs/components/spacing/box/box.d.ts.map +1 -0
- package/dist/commonjs/components/spacing/box/box.js +12 -0
- package/dist/commonjs/components/spacing/box/box.js.map +1 -0
- package/dist/commonjs/components/spacing/stack/stack.d.ts +11 -0
- package/dist/commonjs/components/spacing/stack/stack.d.ts.map +1 -0
- package/dist/commonjs/components/spacing/stack/stack.js +23 -0
- package/dist/commonjs/components/spacing/stack/stack.js.map +1 -0
- package/dist/commonjs/components/spacing/types.d.ts +23 -0
- package/dist/commonjs/components/spacing/types.d.ts.map +1 -0
- package/dist/commonjs/components/spacing/types.js +40 -0
- package/dist/commonjs/components/spacing/types.js.map +1 -0
- package/dist/commonjs/components/spinner/spinner.d.ts +9 -0
- package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -0
- package/dist/commonjs/components/spinner/spinner.js +26 -0
- package/dist/commonjs/components/spinner/spinner.js.map +1 -0
- package/dist/commonjs/components/sr-only/sr-only.d.ts +8 -0
- package/dist/commonjs/components/sr-only/sr-only.d.ts.map +1 -0
- package/dist/commonjs/components/sr-only/sr-only.js +10 -0
- package/dist/commonjs/components/sr-only/sr-only.js.map +1 -0
- package/dist/commonjs/components/text-inputs/text-area.d.ts +7 -0
- package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -0
- package/dist/commonjs/components/text-inputs/text-area.js +19 -0
- package/dist/commonjs/components/text-inputs/text-area.js.map +1 -0
- package/dist/commonjs/components/text-inputs/text-field.d.ts +7 -0
- package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -0
- package/dist/commonjs/components/text-inputs/text-field.js +19 -0
- package/dist/commonjs/components/text-inputs/text-field.js.map +1 -0
- package/dist/commonjs/components/types.d.ts +79 -0
- package/dist/commonjs/components/types.d.ts.map +1 -0
- package/dist/commonjs/components/types.js +3 -0
- package/dist/commonjs/components/types.js.map +1 -0
- package/dist/commonjs/components/typography/link.d.ts +13 -0
- package/dist/commonjs/components/typography/link.d.ts.map +1 -0
- package/dist/commonjs/components/typography/link.js +17 -0
- package/dist/commonjs/components/typography/link.js.map +1 -0
- package/dist/commonjs/components/typography/text.d.ts +10 -0
- package/dist/commonjs/components/typography/text.d.ts.map +1 -0
- package/dist/commonjs/components/typography/text.js +22 -0
- package/dist/commonjs/components/typography/text.js.map +1 -0
- package/dist/commonjs/components/typography/types.d.ts +21 -0
- package/dist/commonjs/components/typography/types.d.ts.map +1 -0
- package/dist/commonjs/components/typography/types.js +3 -0
- package/dist/commonjs/components/typography/types.js.map +1 -0
- package/dist/commonjs/components/typography/utils.d.ts +3 -0
- package/dist/commonjs/components/typography/utils.d.ts.map +1 -0
- package/dist/commonjs/components/typography/utils.js +17 -0
- package/dist/commonjs/components/typography/utils.js.map +1 -0
- package/dist/commonjs/forward-ref.d.ts +3 -0
- package/dist/commonjs/forward-ref.d.ts.map +1 -0
- package/dist/commonjs/forward-ref.js +20 -0
- package/dist/commonjs/forward-ref.js.map +1 -0
- package/dist/commonjs/icons/add.d.ts +7 -0
- package/dist/commonjs/icons/add.d.ts.map +1 -0
- package/dist/commonjs/icons/add.js +7 -0
- package/dist/commonjs/icons/add.js.map +1 -0
- package/dist/commonjs/icons/alert-triangle.d.ts +7 -0
- package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -0
- package/dist/commonjs/icons/alert-triangle.js +7 -0
- package/dist/commonjs/icons/alert-triangle.js.map +1 -0
- package/dist/commonjs/icons/checkmark-small.d.ts +7 -0
- package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -0
- package/dist/commonjs/icons/checkmark-small.js +7 -0
- package/dist/commonjs/icons/checkmark-small.js.map +1 -0
- package/dist/commonjs/icons/index.d.ts +5 -0
- package/dist/commonjs/icons/index.d.ts.map +1 -0
- package/dist/commonjs/icons/index.js +15 -0
- package/dist/commonjs/icons/index.js.map +1 -0
- package/dist/commonjs/icons/minus-small.d.ts +7 -0
- package/dist/commonjs/icons/minus-small.d.ts.map +1 -0
- package/dist/commonjs/icons/minus-small.js +7 -0
- package/dist/commonjs/icons/minus-small.js.map +1 -0
- package/dist/commonjs/index.d.ts +23 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +38 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts +13 -0
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts.map +1 -0
- package/dist/commonjs/providers/ssr/ssr-provider.js +18 -0
- package/dist/commonjs/providers/ssr/ssr-provider.js.map +1 -0
- package/dist/commonjs/with-style-props.d.ts +15 -0
- package/dist/commonjs/with-style-props.d.ts.map +1 -0
- package/dist/commonjs/with-style-props.js +29 -0
- package/dist/commonjs/with-style-props.js.map +1 -0
- package/dist/esm/components/button/button.d.ts +6 -0
- package/dist/esm/components/button/button.d.ts.map +1 -0
- package/dist/esm/components/button/button.js +12 -0
- package/dist/esm/components/button/button.js.map +1 -0
- package/dist/esm/components/button/icon-button.d.ts +6 -0
- package/dist/esm/components/button/icon-button.d.ts.map +1 -0
- package/dist/esm/components/button/icon-button.js +12 -0
- package/dist/esm/components/button/icon-button.js.map +1 -0
- package/dist/esm/components/button/icon-link-button.d.ts +7 -0
- package/dist/esm/components/button/icon-link-button.d.ts.map +1 -0
- package/dist/esm/components/button/icon-link-button.js +11 -0
- package/dist/esm/components/button/icon-link-button.js.map +1 -0
- package/dist/esm/components/button/link-button.d.ts +7 -0
- package/dist/esm/components/button/link-button.d.ts.map +1 -0
- package/dist/esm/components/button/link-button.js +11 -0
- package/dist/esm/components/button/link-button.js.map +1 -0
- package/dist/esm/components/button/types.d.ts +62 -0
- package/dist/esm/components/button/types.d.ts.map +1 -0
- package/dist/esm/components/button/types.js +2 -0
- package/dist/esm/components/button/types.js.map +1 -0
- package/dist/esm/components/checkbox/checkbox-group.d.ts +11 -0
- package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -0
- package/dist/esm/components/checkbox/checkbox-group.js +25 -0
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -0
- package/dist/esm/components/checkbox/checkbox.d.ts +9 -0
- package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/esm/components/checkbox/checkbox.js +20 -0
- package/dist/esm/components/checkbox/checkbox.js.map +1 -0
- package/dist/esm/components/combo-box/combo-box.d.ts +33 -0
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -0
- package/dist/esm/components/combo-box/combo-box.js +39 -0
- package/dist/esm/components/combo-box/combo-box.js.map +1 -0
- package/dist/esm/components/form/form.d.ts +7 -0
- package/dist/esm/components/form/form.d.ts.map +1 -0
- package/dist/esm/components/form/form.js +11 -0
- package/dist/esm/components/form/form.js.map +1 -0
- package/dist/esm/components/form-field/form-field.d.ts +13 -0
- package/dist/esm/components/form-field/form-field.d.ts.map +1 -0
- package/dist/esm/components/form-field/form-field.js +28 -0
- package/dist/esm/components/form-field/form-field.js.map +1 -0
- package/dist/esm/components/menu/menu.d.ts +38 -0
- package/dist/esm/components/menu/menu.d.ts.map +1 -0
- package/dist/esm/components/menu/menu.js +34 -0
- package/dist/esm/components/menu/menu.js.map +1 -0
- package/dist/esm/components/radio/radio-group.d.ts +11 -0
- package/dist/esm/components/radio/radio-group.d.ts.map +1 -0
- package/dist/esm/components/radio/radio-group.js +25 -0
- package/dist/esm/components/radio/radio-group.js.map +1 -0
- package/dist/esm/components/radio/radio.d.ts +9 -0
- package/dist/esm/components/radio/radio.d.ts.map +1 -0
- package/dist/esm/components/radio/radio.js +19 -0
- package/dist/esm/components/radio/radio.js.map +1 -0
- package/dist/esm/components/select/select.d.ts +28 -0
- package/dist/esm/components/select/select.d.ts.map +1 -0
- package/dist/esm/components/select/select.js +28 -0
- package/dist/esm/components/select/select.js.map +1 -0
- package/dist/esm/components/spacing/box/box.d.ts +8 -0
- package/dist/esm/components/spacing/box/box.d.ts.map +1 -0
- package/dist/esm/components/spacing/box/box.js +9 -0
- package/dist/esm/components/spacing/box/box.js.map +1 -0
- package/dist/esm/components/spacing/stack/stack.d.ts +11 -0
- package/dist/esm/components/spacing/stack/stack.d.ts.map +1 -0
- package/dist/esm/components/spacing/stack/stack.js +17 -0
- package/dist/esm/components/spacing/stack/stack.js.map +1 -0
- package/dist/esm/components/spacing/types.d.ts +23 -0
- package/dist/esm/components/spacing/types.d.ts.map +1 -0
- package/dist/esm/components/spacing/types.js +37 -0
- package/dist/esm/components/spacing/types.js.map +1 -0
- package/dist/esm/components/spinner/spinner.d.ts +9 -0
- package/dist/esm/components/spinner/spinner.d.ts.map +1 -0
- package/dist/esm/components/spinner/spinner.js +20 -0
- package/dist/esm/components/spinner/spinner.js.map +1 -0
- package/dist/esm/components/sr-only/sr-only.d.ts +8 -0
- package/dist/esm/components/sr-only/sr-only.d.ts.map +1 -0
- package/dist/esm/components/sr-only/sr-only.js +7 -0
- package/dist/esm/components/sr-only/sr-only.js.map +1 -0
- package/dist/esm/components/text-inputs/text-area.d.ts +7 -0
- package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -0
- package/dist/esm/components/text-inputs/text-area.js +13 -0
- package/dist/esm/components/text-inputs/text-area.js.map +1 -0
- package/dist/esm/components/text-inputs/text-field.d.ts +7 -0
- package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -0
- package/dist/esm/components/text-inputs/text-field.js +13 -0
- package/dist/esm/components/text-inputs/text-field.js.map +1 -0
- package/dist/esm/components/types.d.ts +79 -0
- package/dist/esm/components/types.d.ts.map +1 -0
- package/dist/esm/components/types.js +2 -0
- package/dist/esm/components/types.js.map +1 -0
- package/dist/esm/components/typography/link.d.ts +13 -0
- package/dist/esm/components/typography/link.d.ts.map +1 -0
- package/dist/esm/components/typography/link.js +11 -0
- package/dist/esm/components/typography/link.js.map +1 -0
- package/dist/esm/components/typography/text.d.ts +10 -0
- package/dist/esm/components/typography/text.d.ts.map +1 -0
- package/dist/esm/components/typography/text.js +16 -0
- package/dist/esm/components/typography/text.js.map +1 -0
- package/dist/esm/components/typography/types.d.ts +21 -0
- package/dist/esm/components/typography/types.d.ts.map +1 -0
- package/dist/esm/components/typography/types.js +2 -0
- package/dist/esm/components/typography/types.js.map +1 -0
- package/dist/esm/components/typography/utils.d.ts +3 -0
- package/dist/esm/components/typography/utils.d.ts.map +1 -0
- package/dist/esm/components/typography/utils.js +11 -0
- package/dist/esm/components/typography/utils.js.map +1 -0
- package/dist/esm/forward-ref.d.ts +3 -0
- package/dist/esm/forward-ref.d.ts.map +1 -0
- package/dist/esm/forward-ref.js +19 -0
- package/dist/esm/forward-ref.js.map +1 -0
- package/dist/esm/icons/add.d.ts +7 -0
- package/dist/esm/icons/add.d.ts.map +1 -0
- package/dist/esm/icons/add.js +5 -0
- package/dist/esm/icons/add.js.map +1 -0
- package/dist/esm/icons/alert-triangle.d.ts +7 -0
- package/dist/esm/icons/alert-triangle.d.ts.map +1 -0
- package/dist/esm/icons/alert-triangle.js +5 -0
- package/dist/esm/icons/alert-triangle.js.map +1 -0
- package/dist/esm/icons/checkmark-small.d.ts +7 -0
- package/dist/esm/icons/checkmark-small.d.ts.map +1 -0
- package/dist/esm/icons/checkmark-small.js +5 -0
- package/dist/esm/icons/checkmark-small.js.map +1 -0
- package/dist/esm/icons/index.d.ts +5 -0
- package/dist/esm/icons/index.d.ts.map +1 -0
- package/dist/esm/icons/index.js +5 -0
- package/dist/esm/icons/index.js.map +1 -0
- package/dist/esm/icons/minus-small.d.ts +7 -0
- package/dist/esm/icons/minus-small.d.ts.map +1 -0
- package/dist/esm/icons/minus-small.js +5 -0
- package/dist/esm/icons/minus-small.js.map +1 -0
- package/dist/esm/index.d.ts +23 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/providers/ssr/ssr-provider.d.ts +13 -0
- package/dist/esm/providers/ssr/ssr-provider.d.ts.map +1 -0
- package/dist/esm/providers/ssr/ssr-provider.js +15 -0
- package/dist/esm/providers/ssr/ssr-provider.js.map +1 -0
- package/dist/esm/with-style-props.d.ts +15 -0
- package/dist/esm/with-style-props.d.ts.map +1 -0
- package/dist/esm/with-style-props.js +23 -0
- package/dist/esm/with-style-props.js.map +1 -0
- package/dist-styles/styles.css +2 -0
- package/package.json +104 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { forwardRef } from '../../../forward-ref.js';
|
|
4
|
+
import { withStyleProps } from '../../../with-style-props.js';
|
|
5
|
+
import { getResponsiveVariables } from '../types.js';
|
|
6
|
+
function Stack({ children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
7
|
+
const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);
|
|
8
|
+
const inline = getResponsiveVariables('stack-fd', 'stack-fd-inline', responsiveInline, false);
|
|
9
|
+
return (_jsx("div", { ...props, ref: ref, className: clsx('cim-stack', UNSAFE_className), style: {
|
|
10
|
+
...UNSAFE_style,
|
|
11
|
+
...gap,
|
|
12
|
+
...inline,
|
|
13
|
+
}, role: "presentation", children: children }));
|
|
14
|
+
}
|
|
15
|
+
const _Stack = withStyleProps(forwardRef(Stack), 'Stack');
|
|
16
|
+
export { _Stack as Stack };
|
|
17
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAiC,MAAM,aAAa,CAAC;AAQpF,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAChH,GAAiC;IAEjC,MAAM,GAAG,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAE9F,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAC9C,KAAK,EAAE;YACL,GAAG,YAAY;YACf,GAAG,GAAG;YACN,GAAG,MAAM;SACV,EACD,IAAI,EAAC,cAAc,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { DOMProps } from '../../types.js';\nimport { getResponsiveVariables, type Responsive, type Spacing } from '../types.js';\n\nexport interface StackProps extends DOMProps {\n children: ReactNode;\n inline?: Responsive<boolean>;\n gap: Responsive<Spacing>;\n}\n\nfunction Stack(\n { children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }: StackProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);\n const inline = getResponsiveVariables('stack-fd', 'stack-fd-inline', responsiveInline, false);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-stack', UNSAFE_className)}\n style={{\n ...UNSAFE_style,\n ...gap,\n ...inline,\n }}\n role=\"presentation\"\n >\n {children}\n </div>\n );\n}\n\nconst _Stack = withStyleProps(forwardRef(Stack), 'Stack');\n\nexport { _Stack as Stack };\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;
|
|
2
|
+
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;
|
|
4
|
+
/**
|
|
5
|
+
* Given params like so:
|
|
6
|
+
* (
|
|
7
|
+
* 'box-ml',
|
|
8
|
+
* 'space',
|
|
9
|
+
* {
|
|
10
|
+
* sm: 4,
|
|
11
|
+
* lg: 6,
|
|
12
|
+
* }
|
|
13
|
+
* )
|
|
14
|
+
*
|
|
15
|
+
* Creates an object like so:
|
|
16
|
+
* {
|
|
17
|
+
* '--cim-box-ml-sm': 'var(--cim-space-4)',
|
|
18
|
+
* '--cim-box-ml-lg': 'var(--cim-space-6)',
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare function getResponsiveVariables<T extends string | number | boolean>(targetTokenGroup: string, sourceTokenGroup: string, data?: Responsive<T>, defaultValue?: T): Record<string, string> | undefined;
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC5E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EACxE,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAqBpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given params like so:
|
|
3
|
+
* (
|
|
4
|
+
* 'box-ml',
|
|
5
|
+
* 'space',
|
|
6
|
+
* {
|
|
7
|
+
* sm: 4,
|
|
8
|
+
* lg: 6,
|
|
9
|
+
* }
|
|
10
|
+
* )
|
|
11
|
+
*
|
|
12
|
+
* Creates an object like so:
|
|
13
|
+
* {
|
|
14
|
+
* '--cim-box-ml-sm': 'var(--cim-space-4)',
|
|
15
|
+
* '--cim-box-ml-lg': 'var(--cim-space-6)',
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export function getResponsiveVariables(targetTokenGroup, sourceTokenGroup, data, defaultValue) {
|
|
20
|
+
if (data === undefined && defaultValue === undefined) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (typeof data !== 'object') {
|
|
24
|
+
return {
|
|
25
|
+
[`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${data ?? defaultValue})`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const result = {
|
|
29
|
+
// Default value in case the smallest breakpoint isn't defined
|
|
30
|
+
[`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${defaultValue})`,
|
|
31
|
+
};
|
|
32
|
+
Object.entries(data).forEach(([breakpoint, value]) => {
|
|
33
|
+
result[`--cim-${targetTokenGroup}-${breakpoint}`] = `var(--cim-${sourceTokenGroup}-${value})`;
|
|
34
|
+
});
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAwB,EACxB,gBAAwB,EACxB,IAAoB,EACpB,YAAgB;IAEhB,IAAI,IAAI,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO;YACL,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,IAAI,IAAI,YAAY,GAAG;SAC3F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAA2B;QACrC,8DAA8D;QAC9D,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,YAAY,GAAG;KACnF,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,MAAM,CAAC,SAAS,gBAAgB,IAAI,UAAU,EAAE,CAAC,GAAG,aAAa,gBAAgB,IAAI,KAAK,GAAG,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["export type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;\n\n/**\n * Given params like so:\n * (\n * 'box-ml',\n * 'space',\n * {\n * sm: 4,\n * lg: 6,\n * }\n * )\n *\n * Creates an object like so:\n * {\n * '--cim-box-ml-sm': 'var(--cim-space-4)',\n * '--cim-box-ml-lg': 'var(--cim-space-6)',\n * }\n *\n */\nexport function getResponsiveVariables<T extends string | number | boolean>(\n targetTokenGroup: string,\n sourceTokenGroup: string,\n data?: Responsive<T>,\n defaultValue?: T,\n): Record<string, string> | undefined {\n if (data === undefined && defaultValue === undefined) {\n return undefined;\n }\n\n if (typeof data !== 'object') {\n return {\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${data ?? defaultValue})`,\n };\n }\n\n const result: Record<string, string> = {\n // Default value in case the smallest breakpoint isn't defined\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${defaultValue})`,\n };\n\n Object.entries(data).forEach(([breakpoint, value]) => {\n result[`--cim-${targetTokenGroup}-${breakpoint}`] = `var(--cim-${sourceTokenGroup}-${value})`;\n });\n\n return result;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DOMProps } from '../types.js';
|
|
2
|
+
interface SpinnerProps extends DOMProps {
|
|
3
|
+
size?: 'small' | 'medium' | 'large';
|
|
4
|
+
/** A string value that identifies the spinner's purpose for assistive technologies. */
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
}
|
|
7
|
+
declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
|
|
8
|
+
export { _Spinner as Spinner };
|
|
9
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,UAAU,YAAa,SAAQ,QAAQ;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;CACtB;AAyDD,QAAA,MAAM,QAAQ,qJAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { ProgressBar as RACProgressBar } from 'react-aria-components';
|
|
4
|
+
import { forwardRef } from '../../forward-ref.js';
|
|
5
|
+
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
+
const spinnerDimensions = {
|
|
7
|
+
small: '16px',
|
|
8
|
+
medium: '38px',
|
|
9
|
+
large: '72px',
|
|
10
|
+
};
|
|
11
|
+
const offset = 0;
|
|
12
|
+
const duration = 2;
|
|
13
|
+
const modOffset = offset % 1;
|
|
14
|
+
const begin = (1 - modOffset) * duration - duration;
|
|
15
|
+
function Spinner({ size = 'large', UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
16
|
+
return (_jsx(RACProgressBar, { ...props, isIndeterminate: true, ref: ref, className: clsx('cim-spinner', UNSAFE_className), style: UNSAFE_style, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: spinnerDimensions[size], height: spinnerDimensions[size], viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid", "aria-hidden": true, children: [_jsx("circle", { className: "cim-spinner-ring-bg", cx: "50", cy: "50", r: "40" }), _jsxs("circle", { className: "cim-spinner-ring-animated", cx: "50", cy: "50", r: "40", children: [_jsx("animate", { attributeName: "stroke-dashoffset", dur: duration, repeatCount: "indefinite", from: "0", to: "-502", begin: begin }), _jsx("animate", { attributeName: "stroke-dasharray", dur: duration, repeatCount: "indefinite", values: "75.3 175.7;1 250;75.3 175.7", begin: begin })] })] }) }));
|
|
17
|
+
}
|
|
18
|
+
const _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');
|
|
19
|
+
export { _Spinner as Spinner };
|
|
20
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC;AAC7B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpD,SAAS,OAAO,CACd,EAAE,IAAI,GAAG,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAgB,EAC1E,GAAiC;IAEjC,OAAO,CACL,KAAC,cAAc,OACT,KAAK,EACT,eAAe,QACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,EAChD,KAAK,EAAE,YAAY,YAEnB,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAC9B,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAC/B,OAAO,EAAC,aAAa,EACrB,mBAAmB,EAAC,UAAU,kCAG9B,iBAAQ,SAAS,EAAC,qBAAqB,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EAEjE,kBAAQ,SAAS,EAAC,2BAA2B,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,aAClE,kBACE,aAAa,EAAC,mBAAmB,EACjC,GAAG,EAAE,QAAQ,EACb,WAAW,EAAC,YAAY,EACxB,IAAI,EAAC,GAAG,EACR,EAAE,EAAC,MAAM,EACT,KAAK,EAAE,KAAK,GACZ,EACF,kBACE,aAAa,EAAC,kBAAkB,EAChC,GAAG,EAAE,QAAQ,EACb,WAAW,EAAC,YAAY,EACxB,MAAM,EAAC,6BAA6B,EACpC,KAAK,EAAE,KAAK,GACZ,IACK,IACL,GACS,CAClB,CAAC;AACJ,CAAC;AAED,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { ProgressBar as RACProgressBar } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps } from '../types.js';\n\ninterface SpinnerProps extends DOMProps {\n size?: 'small' | 'medium' | 'large';\n /** A string value that identifies the spinner's purpose for assistive technologies. */\n 'aria-label': string;\n}\n\nconst spinnerDimensions = {\n small: '16px',\n medium: '38px',\n large: '72px',\n};\n\nconst offset = 0;\nconst duration = 2;\nconst modOffset = offset % 1;\nconst begin = (1 - modOffset) * duration - duration;\n\nfunction Spinner(\n { size = 'large', UNSAFE_className, UNSAFE_style, ...props }: SpinnerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACProgressBar\n {...props}\n isIndeterminate\n ref={ref}\n className={clsx('cim-spinner', UNSAFE_className)}\n style={UNSAFE_style}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={spinnerDimensions[size]}\n height={spinnerDimensions[size]}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid\"\n aria-hidden\n >\n <circle className=\"cim-spinner-ring-bg\" cx=\"50\" cy=\"50\" r=\"40\" />\n\n <circle className=\"cim-spinner-ring-animated\" cx=\"50\" cy=\"50\" r=\"40\">\n <animate\n attributeName=\"stroke-dashoffset\"\n dur={duration}\n repeatCount=\"indefinite\"\n from=\"0\"\n to=\"-502\"\n begin={begin}\n />\n <animate\n attributeName=\"stroke-dasharray\"\n dur={duration}\n repeatCount=\"indefinite\"\n values=\"75.3 175.7;1 250;75.3 175.7\"\n begin={begin}\n />\n </circle>\n </svg>\n </RACProgressBar>\n );\n}\n\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function ScreenReaderOnly({ children }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace ScreenReaderOnly {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=sr-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sr-only.d.ts","sourceRoot":"","sources":["../../../../src/components/sr-only/sr-only.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAErE;yBAFe,gBAAgB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'react-aria-components';
|
|
3
|
+
export function ScreenReaderOnly({ children }) {
|
|
4
|
+
return _jsx(Text, { className: "cim-sr-only", children: children });
|
|
5
|
+
}
|
|
6
|
+
ScreenReaderOnly.displayName = 'ScreenReaderOnly';
|
|
7
|
+
//# sourceMappingURL=sr-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sr-only.js","sourceRoot":"","sources":["../../../../src/components/sr-only/sr-only.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAA2B;IACpE,OAAO,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAQ,CAAC;AACzD,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { Text } from 'react-aria-components';\n\nexport function ScreenReaderOnly({ children }: { children: ReactNode }) {\n return <Text className=\"cim-sr-only\">{children}</Text>;\n}\n\nScreenReaderOnly.displayName = 'ScreenReaderOnly';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TextAreaProps as RACTextAreaProps, type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
|
+
import type { DOMProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
+
export interface TextAreaProps extends DOMProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'wrap'> {
|
|
4
|
+
}
|
|
5
|
+
declare const _TextArea: (props: TextAreaProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
|
|
6
|
+
export { _TextArea as TextArea };
|
|
7
|
+
//# sourceMappingURL=text-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,aACf,SAAQ,QAAQ,EACd,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,CACd,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAqCvF,QAAA,MAAM,SAAS,sJAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { TextArea as RACTextArea, TextField as RACTextField, } from 'react-aria-components';
|
|
4
|
+
import { forwardRef } from '../../forward-ref.js';
|
|
5
|
+
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
+
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
|
|
7
|
+
import { textStyle } from '../typography/utils.js';
|
|
8
|
+
function TextArea({ label, description, error: errorMessage, placeholder, autoCapitalize, autoCorrect, spellCheck, wrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
9
|
+
return (_jsxs(RACTextField, { ...props, ref: ref, className: clsx('cim-text-area', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsx(RACTextArea, { className: clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' })), placeholder: placeholder, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, spellCheck: spellCheck, wrap: wrap }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
|
|
10
|
+
}
|
|
11
|
+
const _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');
|
|
12
|
+
export { _TextArea as TextArea };
|
|
13
|
+
//# sourceMappingURL=text-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,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,6BAA6B,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAwBnD,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACM,EAChB,GAAiC;IAEjC,OAAO,CACL,MAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aACxG,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,KAAC,WAAW,IACV,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EACtF,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport 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 '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextAreaProps\n extends DOMProps,\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 >,\n Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'wrap'> {}\n\nfunction TextArea(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n autoCapitalize,\n autoCorrect,\n spellCheck,\n wrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\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 spellCheck={spellCheck}\n wrap={wrap}\n />\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTextField>\n );\n}\n\nconst _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');\n\nexport { _TextArea as TextArea };\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
|
+
import type { DOMProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
+
export interface TextFieldProps extends DOMProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern'> {
|
|
4
|
+
}
|
|
5
|
+
declare const _TextField: (props: TextFieldProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
|
|
6
|
+
export { _TextField as TextField };
|
|
7
|
+
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,cACf,SAAQ,QAAQ,EACd,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,CACZ;CAAG;AAqBR,QAAA,MAAM,UAAU,uJAAqD,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Input as RACInput, TextField as RACTextField, } from 'react-aria-components';
|
|
4
|
+
import { forwardRef } from '../../forward-ref.js';
|
|
5
|
+
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
+
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
|
|
7
|
+
import { textStyle } from '../typography/utils.js';
|
|
8
|
+
function TextField({ label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
9
|
+
return (_jsxs(RACTextField, { ...props, ref: ref, className: clsx('cim-text-field', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsx(RACInput, { className: clsx('cim-text-field-input', textStyle({ variant: 'medium', tone: 'base' })), placeholder: placeholder }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
|
|
10
|
+
}
|
|
11
|
+
const _TextField = withStyleProps(forwardRef(TextField), 'TextField');
|
|
12
|
+
export { _TextField as TextField };
|
|
13
|
+
//# sourceMappingURL=text-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,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,6BAA6B,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAwBnD,SAAS,SAAS,CAChB,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAkB,EAClH,GAAiC;IAEjC,OAAO,CACL,MAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aACzG,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,KAAC,QAAQ,IACP,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EACvF,WAAW,EAAE,WAAW,GACxB,EACF,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport 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 '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextFieldProps\n extends DOMProps,\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 > {}\n\nfunction TextField(\n { label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, ...props }: TextFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\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\nconst _TextField = withStyleProps(forwardRef(TextField), 'TextField');\n\nexport { _TextField as TextField };\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { LinkProps as RACLinkProps, PressEvent as RACPressEvent, ValidationResult as RACValidationResult } from 'react-aria-components';
|
|
3
|
+
export type Key = string | number;
|
|
4
|
+
/**
|
|
5
|
+
* A set of common DOM props that are allowed on any component
|
|
6
|
+
*/
|
|
7
|
+
export interface DOMProps {
|
|
8
|
+
/**
|
|
9
|
+
* The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
|
|
14
|
+
*/
|
|
15
|
+
'data-experimental-cim-style-root'?: boolean;
|
|
16
|
+
/** Sets the CSS className for the element. Only use as a last resort. Use style props instead. */
|
|
17
|
+
UNSAFE_className?: string;
|
|
18
|
+
/** Sets the CSS style for the element. Only use as a last resort. Use style props instead. */
|
|
19
|
+
UNSAFE_style?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An event fired when a component is pressed.
|
|
23
|
+
*
|
|
24
|
+
* By default, press events stop propagation to parent elements.
|
|
25
|
+
* In cases where a handler decides not to handle a specific event,
|
|
26
|
+
* it can call `continuePropagation()` to allow a parent to handle it.
|
|
27
|
+
*/
|
|
28
|
+
export type PressEvent = RACPressEvent;
|
|
29
|
+
/**
|
|
30
|
+
* Props available on components that perform navigation.
|
|
31
|
+
*/
|
|
32
|
+
export interface NavigationProps extends Pick<WithRequired<RACLinkProps, 'href'>, 'href' | 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy' | 'routerOptions' | 'isDisabled'> {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Props for components that require a label, which can be hidden if necessary.
|
|
36
|
+
*/
|
|
37
|
+
export interface LabellableProps {
|
|
38
|
+
/** The content to display as the label. */
|
|
39
|
+
label?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Defines a string value that labels the current element.
|
|
42
|
+
*/
|
|
43
|
+
'aria-label'?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Identifies the element (or elements) that labels the current element.
|
|
46
|
+
*/
|
|
47
|
+
'aria-labelledby'?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Identifies the element (or elements) that describes the object.
|
|
50
|
+
*/
|
|
51
|
+
'aria-describedby'?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Identifies the element (or elements) that provide a detailed, extended description for the object.
|
|
54
|
+
*/
|
|
55
|
+
'aria-details'?: string;
|
|
56
|
+
}
|
|
57
|
+
export type ValidationResult = RACValidationResult;
|
|
58
|
+
export type FieldError = string | string[] | undefined | ((validation: ValidationResult) => string | string[] | undefined);
|
|
59
|
+
export interface FieldProps<T> extends LabellableProps {
|
|
60
|
+
/** A description for the field. Provides a hint such as specific requirements for what to choose. */
|
|
61
|
+
description?: string;
|
|
62
|
+
/** An error message for the field. */
|
|
63
|
+
error?: FieldError;
|
|
64
|
+
/**
|
|
65
|
+
* A function that returns an error message (or `true`) if a given value is invalid.
|
|
66
|
+
* Validation errors are displayed to the user when the form is submitted.
|
|
67
|
+
* For real-time validation, use the `error` prop instead.
|
|
68
|
+
*/
|
|
69
|
+
validate?: (value: T) => string | string[] | true | undefined;
|
|
70
|
+
}
|
|
71
|
+
export interface FieldWithPlaceholderProps<T> extends FieldProps<T> {
|
|
72
|
+
/** The placeholder text displayed in the input field. */
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
}
|
|
75
|
+
/** Changes specified optional properties within the provided type to be required. */
|
|
76
|
+
export type WithRequired<T, K extends keyof T> = T & {
|
|
77
|
+
[P in K]-?: T[P];
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,SAAS,IAAI,YAAY,EACzB,UAAU,IAAI,aAAa,EAC3B,gBAAgB,IAAI,mBAAmB,EACxC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,EAClC,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,gBAAgB,GAAG,eAAe,GAAG,YAAY,CACjH;CAAG;AAEN;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAEnD,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,EAAE,GACR,SAAS,GACT,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAEtE,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,eAAe;IACpD,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACjE,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qFAAqF;AACrF,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CSSProperties } from 'react';\nimport type {\n LinkProps as RACLinkProps,\n PressEvent as RACPressEvent,\n ValidationResult as RACValidationResult,\n} from 'react-aria-components';\n\nexport type Key = string | number;\n\n/**\n * A set of common DOM props that are allowed on any component\n */\nexport interface DOMProps {\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-experimental-cim-style-root'?: boolean;\n /** Sets the CSS className for the element. Only use as a last resort. Use style props instead. */\n UNSAFE_className?: string;\n /** Sets the CSS style for the element. Only use as a last resort. Use style props instead. */\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/**\n * Props available on components that perform navigation.\n */\nexport interface NavigationProps\n extends Pick<\n WithRequired<RACLinkProps, 'href'>,\n 'href' | 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy' | 'routerOptions' | 'isDisabled'\n > {}\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\nexport type ValidationResult = RACValidationResult;\n\nexport type FieldError =\n | string\n | string[]\n | undefined\n | ((validation: ValidationResult) => string | string[] | undefined);\n\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\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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type LinkProps as RACLinkProps } from 'react-aria-components';
|
|
3
|
+
import type { NavigationProps } from '../types.js';
|
|
4
|
+
import type { BaseTypographyProps } from './types.js';
|
|
5
|
+
export interface LinkProps extends Omit<BaseTypographyProps, 'id'>, NavigationProps, Pick<RACLinkProps, 'isDisabled'> {
|
|
6
|
+
/** An icon displayed before the link text. */
|
|
7
|
+
iconStart?: ReactNode;
|
|
8
|
+
/** An icon displayed after the link text. */
|
|
9
|
+
iconEnd?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const _Link: (props: LinkProps & import("react").RefAttributes<HTMLAnchorElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
|
|
12
|
+
export { _Link as Link };
|
|
13
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":"AACA,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,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC;IACnH,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAeD,QAAA,MAAM,KAAK,qIAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Link as RACLink } from 'react-aria-components';
|
|
4
|
+
import { forwardRef } from '../../forward-ref.js';
|
|
5
|
+
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
+
function Link({ children, iconStart, iconEnd, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
7
|
+
return (_jsxs(RACLink, { ...props, ref: ref, className: clsx('cim-link', UNSAFE_className), style: UNSAFE_style, children: [iconStart && _jsx("span", { className: "cim-link-icon", children: iconStart }), _jsx("span", { className: "cim-link-text", children: children }), iconEnd && _jsx("span", { className: "cim-link-icon", children: iconEnd })] }));
|
|
8
|
+
}
|
|
9
|
+
const _Link = withStyleProps(forwardRef(Link), 'Link');
|
|
10
|
+
export { _Link as Link };
|
|
11
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/components/typography/link.tsx"],"names":[],"mappings":";AAAA,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;AAW3D,SAAS,IAAI,CACX,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAa,EACrF,GAAoC;IAEpC,OAAO,CACL,MAAC,OAAO,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAC7F,SAAS,IAAI,eAAM,SAAS,EAAC,eAAe,YAAE,SAAS,GAAQ,EAChE,eAAM,SAAS,EAAC,eAAe,YAAE,QAAQ,GAAQ,EAChD,OAAO,IAAI,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,GAAQ,IACpD,CACX,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["import 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 } from '../types.js';\nimport type { BaseTypographyProps } from './types.js';\n\nexport interface LinkProps extends Omit<BaseTypographyProps, 'id'>, NavigationProps, Pick<RACLinkProps, 'isDisabled'> {\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 && <span className=\"cim-link-icon\">{iconStart}</span>}\n <span className=\"cim-link-text\">{children}</span>\n {iconEnd && <span className=\"cim-link-icon\">{iconEnd}</span>}\n </RACLink>\n );\n}\n\nconst _Link = withStyleProps(forwardRef(Link), 'Link');\n\nexport { _Link as Link };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ElementRef } from 'react';
|
|
2
|
+
import type { BaseTypographyProps, TextStyleOptions } from './types.js';
|
|
3
|
+
type TextElement = Exclude<keyof JSX.IntrinsicElements, 'a'>;
|
|
4
|
+
export interface TextProps<T extends TextElement> extends BaseTypographyProps, TextStyleOptions {
|
|
5
|
+
/** The HTML element to render as. */
|
|
6
|
+
as: T;
|
|
7
|
+
}
|
|
8
|
+
declare const _Text: <T extends TextElement>(props: TextProps<T> & import("react").RefAttributes<ElementRef<T>> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
|
|
9
|
+
export { _Text as Text };
|
|
10
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1E,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,QAAA,MAAM,KAAK,GA3BG,CAAC,SAAS,WAAW,mJA2BmB,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { forwardRef } from '../../forward-ref.js';
|
|
4
|
+
import { withStyleProps } from '../../with-style-props.js';
|
|
5
|
+
import { textStyle } from './utils.js';
|
|
6
|
+
function Text({ children, as, variant, fontStyle, alignment, textDecoration, tone, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
7
|
+
return createElement(as, {
|
|
8
|
+
...props,
|
|
9
|
+
ref,
|
|
10
|
+
className: clsx(textStyle({ variant, fontStyle, alignment, textDecoration, tone }), UNSAFE_className),
|
|
11
|
+
style: UNSAFE_style,
|
|
12
|
+
}, children);
|
|
13
|
+
}
|
|
14
|
+
const _Text = withStyleProps(forwardRef(Text), 'Text');
|
|
15
|
+
export { _Text as Text };
|
|
16
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/typography/text.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAsC,MAAM,OAAO,CAAC;AAC1E,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,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { createElement, type ForwardedRef, type ElementRef } 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\nconst _Text = withStyleProps(forwardRef(Text), 'Text');\n\nexport { _Text as Text };\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DOMProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Props available on all typography components.
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseTypographyProps extends DOMProps {
|
|
7
|
+
/** Text to display. Allows nesting other typography components. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface TextStyleOptions {
|
|
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' | 'extra-small' | 'extra-small-semibold';
|
|
13
|
+
/** Whether the font should be styled with a normal or italic face. */
|
|
14
|
+
fontStyle?: 'normal' | 'italic';
|
|
15
|
+
/** Horizontal alignment of text. */
|
|
16
|
+
alignment?: 'start' | 'center' | 'end' | 'justify';
|
|
17
|
+
/** The kind of decorative line applied to the text. */
|
|
18
|
+
textDecoration?: 'none' | 'strikethrough' | 'underline';
|
|
19
|
+
tone?: 'title' | 'base' | 'subtle' | 'muted' | 'inverse' | 'action' | 'info' | 'success' | 'warning' | 'critical';
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,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,GAChB,aAAa,GACb,sBAAsB,CAAC;IAC3B,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;IAExD,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;CACnH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/typography/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { DOMProps } from '../types.js';\n\n/**\n * Props available on all typography components.\n */\nexport interface BaseTypographyProps extends DOMProps {\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 | 'extra-small'\n | 'extra-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 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,gBAAgB,UAQlG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
export function textStyle({ variant, fontStyle, alignment, textDecoration, tone }) {
|
|
3
|
+
return clsx('cim-text', {
|
|
4
|
+
[`cim-text-variant-${variant}`]: variant,
|
|
5
|
+
[`cim-text-fs-${fontStyle}`]: fontStyle,
|
|
6
|
+
[`cim-text-alignment-${alignment}`]: alignment,
|
|
7
|
+
[`cim-text-decoration-${textDecoration}`]: textDecoration,
|
|
8
|
+
[`cim-text-tone-${tone}`]: tone,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/typography/utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,UAAU,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAoB;IACjG,OAAO,IAAI,CAAC,UAAU,EAAE;QACtB,CAAC,oBAAoB,OAAO,EAAE,CAAC,EAAE,OAAO;QACxC,CAAC,eAAe,SAAS,EAAE,CAAC,EAAE,SAAS;QACvC,CAAC,sBAAsB,SAAS,EAAE,CAAC,EAAE,SAAS;QAC9C,CAAC,uBAAuB,cAAc,EAAE,CAAC,EAAE,cAAc;QACzD,CAAC,iBAAiB,IAAI,EAAE,CAAC,EAAE,IAAI;KAChC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { TextStyleOptions } from './types.js';\n\nexport function textStyle({ variant, fontStyle, alignment, textDecoration, tone }: TextStyleOptions) {\n return clsx('cim-text', {\n [`cim-text-variant-${variant}`]: variant,\n [`cim-text-fs-${fontStyle}`]: fontStyle,\n [`cim-text-alignment-${alignment}`]: alignment,\n [`cim-text-decoration-${textDecoration}`]: textDecoration,\n [`cim-text-tone-${tone}`]: tone,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forward-ref.d.ts","sourceRoot":"","sources":["../../src/forward-ref.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAQf,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,EAC/C,WAAW,CAAC,EAAE,MAAM,GACnB,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,SAAS,CAS5C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Override forwardRef types so that generic components retain their generics.
|
|
2
|
+
import {
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports
|
|
4
|
+
forwardRef as originalForwardRef, } from 'react';
|
|
5
|
+
/*
|
|
6
|
+
In order for generic components to retain their generics,
|
|
7
|
+
`forwardRef` must return a simple function.
|
|
8
|
+
We cannot therefore expose `displayName` as a property on the return type.
|
|
9
|
+
As a workaround, our `forwardRef` accepts a `displayName` parameter and sets it on the component internally.
|
|
10
|
+
*/
|
|
11
|
+
export function forwardRef(Component, displayName) {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
const WrappedComponent = originalForwardRef(Component);
|
|
14
|
+
// @ts-expect-error missing type definition for displayName
|
|
15
|
+
const existingDisplayName = Component.displayName || Component.name || 'Component';
|
|
16
|
+
WrappedComponent.displayName = displayName || `ForwardRef(${existingDisplayName})`;
|
|
17
|
+
return WrappedComponent;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=forward-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forward-ref.js","sourceRoot":"","sources":["../../src/forward-ref.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,OAAO;AACL,iDAAiD;AACjD,UAAU,IAAI,kBAAkB,GAIjC,MAAM,OAAO,CAAC;AAEf;;;;;EAKE;AACF,MAAM,UAAU,UAAU,CACxB,SAA+C,EAC/C,WAAoB;IAEpB,8DAA8D;IAC9D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAgB,CAAC,CAAC;IAE9D,2DAA2D;IAC3D,MAAM,mBAAmB,GAAG,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,CAAC;IACnF,gBAAgB,CAAC,WAAW,GAAG,WAAW,IAAI,cAAc,mBAAmB,GAAG,CAAC;IAEnF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Override forwardRef types so that generic components retain their generics.\n\nimport {\n // eslint-disable-next-line no-restricted-imports\n forwardRef as originalForwardRef,\n type ReactNode,\n type Ref,\n type RefAttributes,\n} from 'react';\n\n/*\nIn order for generic components to retain their generics,\n`forwardRef` must return a simple function.\nWe cannot therefore expose `displayName` as a property on the return type.\nAs a workaround, our `forwardRef` accepts a `displayName` parameter and sets it on the component internally.\n*/\nexport function forwardRef<T, R>(\n Component: (props: T, ref: Ref<R>) => ReactNode,\n displayName?: string,\n): (props: T & RefAttributes<R>) => ReactNode {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const WrappedComponent = originalForwardRef(Component as any);\n\n // @ts-expect-error missing type definition for displayName\n const existingDisplayName = Component.displayName || Component.name || 'Component';\n WrappedComponent.displayName = displayName || `ForwardRef(${existingDisplayName})`;\n\n return WrappedComponent;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/icons/add.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,MAAM;YAAW,QAAQ,CAAC,aAAa,CAAC;;CAa7C,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const SvgAdd = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "1em", height: "1em", className: "cim-icon", "data-icon": "true", fill: "currentColor", ...props, children: _jsx("path", { d: "M0 12a1.5 1.5 0 0 0 1.5 1.5h8.75a.25.25 0 0 1 .25.25v8.75a1.5 1.5 0 0 0 3 0v-8.75a.25.25 0 0 1 .25-.25h8.75a1.5 1.5 0 0 0 0-3h-8.75a.25.25 0 0 1-.25-.25V1.5a1.5 1.5 0 0 0-3 0v8.75a.25.25 0 0 1-.25.25H1.5A1.5 1.5 0 0 0 0 12" }) }));
|
|
3
|
+
SvgAdd.displayName = 'IconAdd';
|
|
4
|
+
export default SvgAdd;
|
|
5
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/icons/add.tsx"],"names":[],"mappings":";AACA,MAAM,MAAM,GAAG,CAAC,KAA8B,EAAE,EAAE,CAAC,CACjD,cACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,SAAS,EAAC,UAAU,eACV,MAAM,EAChB,IAAI,EAAC,cAAc,KACf,KAAK,YAET,eAAM,CAAC,EAAC,gOAAgO,GAAG,GACvO,CACP,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC;AAC/B,eAAe,MAAM,CAAC","sourcesContent":["import type { SVGProps } from 'react';\nconst SvgAdd = (props: SVGProps<SVGSVGElement>) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"1em\"\n height=\"1em\"\n className=\"cim-icon\"\n data-icon=\"true\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M0 12a1.5 1.5 0 0 0 1.5 1.5h8.75a.25.25 0 0 1 .25.25v8.75a1.5 1.5 0 0 0 3 0v-8.75a.25.25 0 0 1 .25-.25h8.75a1.5 1.5 0 0 0 0-3h-8.75a.25.25 0 0 1-.25-.25V1.5a1.5 1.5 0 0 0-3 0v8.75a.25.25 0 0 1-.25.25H1.5A1.5 1.5 0 0 0 0 12\" />\n </svg>\n);\nSvgAdd.displayName = 'IconAdd';\nexport default SvgAdd;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-triangle.d.ts","sourceRoot":"","sources":["../../../src/icons/alert-triangle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,QAAA,MAAM,gBAAgB;YAAW,QAAQ,CAAC,aAAa,CAAC;;CAmBvD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const SvgAlertTriangle = (props) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "1em", height: "1em", className: "cim-icon", "data-icon": "true", fill: "currentColor", ...props, children: [_jsx("path", { fillRule: "evenodd", d: "M16.91 4.6a1.018 1.018 0 0 0-1.82 0L5.147 24.489a1.018 1.018 0 0 0 .91 1.474H25.94c.757 0 1.25-.797.91-1.474L16.912 4.6Zm-3.642-.911c1.125-2.252 4.338-2.252 5.464 0l9.941 19.89C29.69 25.608 28.212 28 25.941 28H6.058c-2.27 0-3.747-2.39-2.732-4.422L13.268 3.69Z", clipRule: "evenodd" }), _jsx("path", { d: "M17 23a1 1 0 1 1-2 0 1 1 0 0 1 2 0" }), _jsx("path", { fillRule: "evenodd", d: "M16 12a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1", clipRule: "evenodd" })] }));
|
|
3
|
+
SvgAlertTriangle.displayName = 'IconAlertTriangle';
|
|
4
|
+
export default SvgAlertTriangle;
|
|
5
|
+
//# sourceMappingURL=alert-triangle.js.map
|