@elliemae/ds-svg 3.22.0-next.3 → 3.22.0-next.30

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/DSSvg.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/DSSvg.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes } from './react-desc-prop-types.js';\nimport { useSvg } from './config/useSvg.js';\nimport { DSSvgName } from './constants/index.js';\nimport { StyledWrapper } from './styled.js';\n\nconst DSSvg: React.ComponentType<DSSvgT.Props> = (props) => {\n const {\n globalProps,\n xstyledProps,\n propsWithDefault: { viewBox, size, children, focusable },\n } = useSvg(props);\n\n return (\n <StyledWrapper\n viewBox={viewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable={focusable}\n {...globalProps}\n {...xstyledProps}\n size={size}\n display={xstyledProps.display as string | undefined}\n overflow={xstyledProps.overflow as string | undefined}\n visibility={xstyledProps.visibility as string | undefined}\n >\n {children}\n </StyledWrapper>\n );\n};\n\nDSSvg.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\nDSSvg.displayName = DSSvgName;\nconst DSSvgWithSchema = describe(DSSvg);\nDSSvgWithSchema.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\n\nexport { DSSvg, DSSvgWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADenB;AAdJ,8BAAyB;AACzB,mCAA4C;AAC5C,oBAAuB;AACvB,uBAA0B;AAC1B,oBAA8B;AAE9B,MAAM,QAA2C,CAAC,UAAU;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,SAAS,MAAM,UAAU,UAAU;AAAA,EACzD,QAAI,sBAAO,KAAK;AAEhB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAM;AAAA,MACN,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,SAAS,aAAa;AAAA,MACtB,UAAU,aAAa;AAAA,MACvB,YAAY,aAAa;AAAA,MAExB;AAAA;AAAA,EACH;AAEJ;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,sBAAkB,kCAAS,KAAK;AACtC,gBAAgB,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/config/useSvg.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/config/useSvg.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface SvgCTX {\n propsWithDefault: DSSvgT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useSvg = (propsFromUser: DSSvgT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSvgT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSSvgPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSSvgT.InternalProps>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAyF;AACzF,mCAA0D;AAC1D,8BAAiC;AAS1B,MAAM,SAAS,CAAC,kBAAgC;AAIrD,QAAM,uBAAmB,sDAAmD,eAAe,yCAAY;AACvG,gDAAiB,kBAAkB,2CAAc;AAIjD,QAAM,kBAAc,gDAA6C,gBAAgB;AACjF,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/config/useValidateProps.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT } from '../react-desc-prop-types.js';\nimport { DSSvgName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSSvgT.InternalProps, propTypes: DSPropTypesSchema<DSSvgT.Props>): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSSvgName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA+C;AAE/C,uBAA0B;AAEnB,MAAM,mBAAmB,CAAC,OAA6B,cAAqD;AACjH,8DAA+B,OAAO,WAAW,0BAAS;AAC5D;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/constants/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const DSSvgName = 'DSSvg';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_SLOTS = {\n ROOT: 'root',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_DATA_TESTID = {\n ROOT: `ds-svg-${SVG_SLOTS.ROOT}`,\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,YAAY;AAGlB,MAAM,YAAY;AAAA,EACvB,MAAM;AACR;AAGO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,UAAU;AAC5B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSSvg, DSSvgWithSchema } from './DSSvg.js';\nexport { type DSSvgT } from './react-desc-prop-types.js';\nexport { SVG_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAuC;AACvC,mCAA4B;AAC5B,uBAAgC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSvgT {\n export type SizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n export interface RequiredProps {\n viewBox: string;\n }\n\n export interface DefaultProps {\n focusable: boolean;\n }\n\n export interface OptionalProps {\n size?: SizeType;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSSvgT.DefaultProps = {\n focusable: false,\n};\n\nexport const DSSvgPropTypes: DSPropTypesSchema<DSSvgT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n viewBox: PropTypes.string.isRequired.description(\n 'The viewBox attribute defines the coordinate system for the SVG content.',\n ),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description(\n 'The size of the SVG. This will be used to set the width and height of the SVG.',\n ),\n focusable: PropTypes.bool\n .description('The focusable attribute is used to determine whether an element can be focused.')\n .defaultValue(false),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAsChE,MAAM,eAAoC;AAAA,EAC/C,WAAW;AACb;AAEO,MAAM,iBAAkD;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,OAAO,WAAW;AAAA,IACnC;AAAA,EACF;AAAA,EACA,MAAM,kCAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,WAAW,kCAAU,KAClB,YAAY,iFAAiF,EAC7F,aAAa,KAAK;AACvB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { FlattenInterpolation, Theme } from '@elliemae/ds-system';\nimport { layout, sizing, space, css, styled, th } from '@elliemae/ds-system';\nimport type { DSSvgT } from './react-desc-prop-types.js';\nimport { DSSvgName, SVG_SLOTS } from './constants/index.js';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\n\nconst xxlSizes = css`\n width: 4rem;\n height: 4rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 4.923rem;\n height: 4.923rem;\n }\n`;\n\nconst xlSizes = css`\n width: 3rem;\n height: 3rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 3.692rem;\n height: 3.692rem;\n }\n`;\n\nconst lSizes = css`\n width: 2rem;\n height: 2rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 2.462rem;\n height: 2.462rem;\n }\n`;\n\nconst mSizes = css`\n width: 1.5rem;\n height: 1.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.846rem;\n height: 1.846rem;\n }\n`;\n\nconst sSizes = css`\n width: 1rem;\n height: 1rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.231rem;\n height: 1.231rem;\n }\n`;\n\nconst xsSizes = css`\n width: 0.5rem;\n height: 0.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.615rem;\n height: 0.615rem;\n }\n`;\n\nconst xxsSizes = css`\n width: 0.25rem;\n height: 0.25rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.308rem;\n height: 0.308rem;\n }\n`;\n\nconst standarSizes = css`\n ${sSizes}\n`;\n\nconst getSize = (\n size: DSSvgT.SizeType | undefined,\n): FlattenInterpolation<{\n theme: Theme;\n}> => {\n if (size === 'xxl') return xxlSizes;\n if (size === 'xl') return xlSizes;\n if (size === 'l') return lSizes;\n if (size === 'm') return mSizes;\n if (size === 's') return sSizes;\n if (size === 'xs') return xsSizes;\n if (size === 'xxs') return xxsSizes;\n return standarSizes;\n};\n\nexport const StyledWrapper = styled('svg', { name: DSSvgName, slot: SVG_SLOTS.ROOT })<\n { size?: DSSvgT.SizeType } & XstyledProps\n>`\n ${layout}\n ${space}\n ${sizing}\n\n ${({ size }) => {\n if (size) return getSize(size);\n }};\n\n ${({ width, theme }) => {\n if (typeof width === 'string') {\n return `\n width: ${width};\n `;\n } else if (typeof width === 'number') {\n return `\n width: ${width / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n width: ${width / 13}rem;\n }\n `;\n }\n }}\n\n ${({ height, theme }) => {\n if (typeof height === 'string') {\n return `\n height: ${height};\n `;\n } else if (typeof height === 'number') {\n return `\n height: ${height / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n height: ${height / 13}rem;\n }\n `;\n }\n }}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA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,iBACI;AAAA;AAAA,EAEb,WAAW,OAAO,UAAU,UAAU;AACpC,WAAO;AAAA,iBACI,QAAQ;AAAA,6BACI,MAAM,aAAa;AAAA,mBAC7B,QAAQ;AAAA;AAAA;AAAA,EAGvB;AACF;AAAA;AAAA,IAEE,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,kBACK;AAAA;AAAA,EAEd,WAAW,OAAO,WAAW,UAAU;AACrC,WAAO;AAAA,kBACK,SAAS;AAAA,6BACE,MAAM,aAAa;AAAA,oBAC5B,SAAS;AAAA;AAAA;AAAA,EAGzB;AACF;AAAA;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSSvg.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSSvg.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes } from './react-desc-prop-types.js';\nimport { useSvg } from './config/useSvg.js';\nimport { DSSvgName } from './constants/index.js';\nimport { StyledWrapper } from './styled.js';\n\nconst DSSvg: React.ComponentType<DSSvgT.Props> = (props) => {\n const {\n globalProps,\n xstyledProps,\n propsWithDefault: { viewBox, size, children, focusable },\n } = useSvg(props);\n\n return (\n <StyledWrapper\n viewBox={viewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n focusable={focusable}\n {...globalProps}\n {...xstyledProps}\n size={size}\n display={xstyledProps.display as string | undefined}\n overflow={xstyledProps.overflow as string | undefined}\n visibility={xstyledProps.visibility as string | undefined}\n >\n {children}\n </StyledWrapper>\n );\n};\n\nDSSvg.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\nDSSvg.displayName = DSSvgName;\nconst DSSvgWithSchema = describe(DSSvg);\nDSSvgWithSchema.propTypes = DSSvgPropTypes as React.WeakValidationMap<unknown>;\n\nexport { DSSvg, DSSvgWithSchema };\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACenB;AAdJ,SAAS,gBAAgB;AACzB,SAAsB,sBAAsB;AAC5C,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAE9B,MAAM,QAA2C,CAAC,UAAU;AAC1D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,SAAS,MAAM,UAAU,UAAU;AAAA,EACzD,IAAI,OAAO,KAAK;AAEhB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAM;AAAA,MACN,eAAY;AAAA,MACZ;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,SAAS,aAAa;AAAA,MACtB,UAAU,aAAa;AAAA,MACvB,YAAY,aAAa;AAAA,MAExB;AAAA;AAAA,EACH;AAEJ;AAEA,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,MAAM,kBAAkB,SAAS,KAAK;AACtC,gBAAgB,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useSvg.ts"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useSvg.ts"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT, DSSvgPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface SvgCTX {\n propsWithDefault: DSSvgT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useSvg = (propsFromUser: DSSvgT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSvgT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSSvgPropTypes);\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSSvgT.InternalProps>(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n }),\n [propsWithDefault, globalProps, xstyledProps],\n );\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,wBAAwB,oBAAoB,oCAAoC;AACzF,SAAsB,gBAAgB,oBAAoB;AAC1D,SAAS,wBAAwB;AAS1B,MAAM,SAAS,CAAC,kBAAgC;AAIrD,QAAM,mBAAmB,6BAAmD,eAAe,YAAY;AACvG,mBAAiB,kBAAkB,cAAc;AAIjD,QAAM,cAAc,uBAA6C,gBAAgB;AACjF,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,YAAY;AAAA,EAC9C;AACF;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSSvgT } from '../react-desc-prop-types.js';\nimport { DSSvgName } from '../constants/index.js';\n\nexport const useValidateProps = (props: DSSvgT.InternalProps, propTypes: DSPropTypesSchema<DSSvgT.Props>): void => {\n useValidateTypescriptPropTypes(props, propTypes, DSSvgName);\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,sCAAsC;AAE/C,SAAS,iBAAiB;AAEnB,MAAM,mBAAmB,CAAC,OAA6B,cAAqD;AACjH,iCAA+B,OAAO,WAAW,SAAS;AAC5D;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSSvgName = 'DSSvg';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_SLOTS = {\n ROOT: 'root',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const SVG_DATA_TESTID = {\n ROOT: `ds-svg-${SVG_SLOTS.ROOT}`,\n} as const;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,YAAY;AAGlB,MAAM,YAAY;AAAA,EACvB,MAAM;AACR;AAGO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,UAAU;AAC5B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSSvg, DSSvgWithSchema } from './DSSvg.js';\nexport { type DSSvgT } from './react-desc-prop-types.js';\nexport { SVG_DATA_TESTID } from './constants/index.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,OAAO,uBAAuB;AACvC,eAA4B;AAC5B,SAAS,uBAAuB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSvgT {\n export type SizeType = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n export interface RequiredProps {\n viewBox: string;\n }\n\n export interface DefaultProps {\n focusable: boolean;\n }\n\n export interface OptionalProps {\n size?: SizeType;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<SVGElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSSvgT.DefaultProps = {\n focusable: false,\n};\n\nexport const DSSvgPropTypes: DSPropTypesSchema<DSSvgT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n viewBox: PropTypes.string.isRequired.description(\n 'The viewBox attribute defines the coordinate system for the SVG content.',\n ),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description(\n 'The size of the SVG. This will be used to set the width and height of the SVG.',\n ),\n focusable: PropTypes.bool\n .description('The focusable attribute is used to determine whether an element can be focused.')\n .defaultValue(false),\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAsChE,MAAM,eAAoC;AAAA,EAC/C,WAAW;AACb;AAEO,MAAM,iBAAkD;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,OAAO,WAAW;AAAA,IACnC;AAAA,EACF;AAAA,EACA,MAAM,UAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,WAAW,UAAU,KAClB,YAAY,iFAAiF,EAC7F,aAAa,KAAK;AACvB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FlattenInterpolation, Theme } from '@elliemae/ds-system';\nimport { layout, sizing, space, css, styled, th } from '@elliemae/ds-system';\nimport type { DSSvgT } from './react-desc-prop-types.js';\nimport { DSSvgName, SVG_SLOTS } from './constants/index.js';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\n\nconst xxlSizes = css`\n width: 4rem;\n height: 4rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 4.923rem;\n height: 4.923rem;\n }\n`;\n\nconst xlSizes = css`\n width: 3rem;\n height: 3rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 3.692rem;\n height: 3.692rem;\n }\n`;\n\nconst lSizes = css`\n width: 2rem;\n height: 2rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 2.462rem;\n height: 2.462rem;\n }\n`;\n\nconst mSizes = css`\n width: 1.5rem;\n height: 1.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.846rem;\n height: 1.846rem;\n }\n`;\n\nconst sSizes = css`\n width: 1rem;\n height: 1rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 1.231rem;\n height: 1.231rem;\n }\n`;\n\nconst xsSizes = css`\n width: 0.5rem;\n height: 0.5rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.615rem;\n height: 0.615rem;\n }\n`;\n\nconst xxsSizes = css`\n width: 0.25rem;\n height: 0.25rem;\n @media (min-width: ${th.breakpoint('small')}) {\n width: 0.308rem;\n height: 0.308rem;\n }\n`;\n\nconst standarSizes = css`\n ${sSizes}\n`;\n\nconst getSize = (\n size: DSSvgT.SizeType | undefined,\n): FlattenInterpolation<{\n theme: Theme;\n}> => {\n if (size === 'xxl') return xxlSizes;\n if (size === 'xl') return xlSizes;\n if (size === 'l') return lSizes;\n if (size === 'm') return mSizes;\n if (size === 's') return sSizes;\n if (size === 'xs') return xsSizes;\n if (size === 'xxs') return xxsSizes;\n return standarSizes;\n};\n\nexport const StyledWrapper = styled('svg', { name: DSSvgName, slot: SVG_SLOTS.ROOT })<\n { size?: DSSvgT.SizeType } & XstyledProps\n>`\n ${layout}\n ${space}\n ${sizing}\n\n ${({ size }) => {\n if (size) return getSize(size);\n }};\n\n ${({ width, theme }) => {\n if (typeof width === 'string') {\n return `\n width: ${width};\n `;\n } else if (typeof width === 'number') {\n return `\n width: ${width / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n width: ${width / 13}rem;\n }\n `;\n }\n }}\n\n ${({ height, theme }) => {\n if (typeof height === 'string') {\n return `\n height: ${height};\n `;\n } else if (typeof height === 'number') {\n return `\n height: ${height / 16}rem;\n @media (min-width: ${theme.breakpoints?.small}) {\n height: ${height / 13}rem;\n }\n `;\n }\n }}\n`;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,QAAQ,OAAO,KAAK,QAAQ,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AA,iBACI;AAAA;AAAA,EAEb,WAAW,OAAO,UAAU,UAAU;AACpC,WAAO;AAAA,iBACI,QAAQ;AAAA,6BACI,MAAM,aAAa;AAAA,mBAC7B,QAAQ;AAAA;AAAA;AAAA,EAGvB;AACF;AAAA;AAAA,IAEE,CAAC,EAAE,QAAQ,MAAM,MAAM;AACvB,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,kBACK;AAAA;AAAA,EAEd,WAAW,OAAO,WAAW,UAAU;AACrC,WAAO;AAAA,kBACK,SAAS;AAAA,6BACE,MAAM,aAAa;AAAA,oBAC5B,SAAS;AAAA;AAAA;AAAA,EAGzB;AACF;AAAA;",
6
6
  "names": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-svg",
3
- "version": "3.22.0-next.3",
3
+ "version": "3.22.0-next.30",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Svg",
6
6
  "files": [
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@xstyled/system": "~3.6.0",
39
- "@elliemae/ds-props-helpers": "3.22.0-next.3",
40
- "@elliemae/ds-system": "3.22.0-next.3"
39
+ "@elliemae/ds-props-helpers": "3.22.0-next.30",
40
+ "@elliemae/ds-system": "3.22.0-next.30"
41
41
  },
42
42
  "devDependencies": {
43
- "@elliemae/pui-cli": "~9.0.0-next.17",
43
+ "@elliemae/pui-cli": "~9.0.0-next.22",
44
44
  "@testing-library/jest-dom": "~5.16.5",
45
45
  "@testing-library/react": "~12.1.3",
46
46
  "jest-axe": "^7.0.1",
47
- "@elliemae/ds-monorepo-devops": "3.22.0-next.3"
47
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.30"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^17.0.2",
@@ -56,15 +56,15 @@
56
56
  "typeSafety": false
57
57
  },
58
58
  "scripts": {
59
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
59
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
60
60
  "test": "pui-cli test --passWithNoTests",
61
- "lint": "node ../../scripts/lint.mjs --fix",
62
- "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
63
- "dts": "node ../../scripts/dts.mjs",
61
+ "lint": "node ../../../scripts/lint.mjs --fix",
62
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
63
+ "dts": "node ../../../scripts/dts.mjs",
64
64
  "dts:withdeps": "pnpm --filter {.}... dts",
65
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
65
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
66
66
  "dev:build": "pnpm --filter {.}... build",
67
67
  "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
68
- "checkDeps": "npm exec ../ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
68
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
69
69
  }
70
70
  }