@frontify/fondue 12.0.0-beta.339 → 12.0.0-beta.340
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/dist/components/RichTextEditor/EditorPositioningWrapper/index.es.js +11 -8
- package/dist/components/RichTextEditor/EditorPositioningWrapper/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/types.es.js +1 -1
- package/dist/components/RichTextEditor/types.es.js.map +1 -1
- package/dist/index.cjs.js +24 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.umd.js +25 -25
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/typography/Text/Text.es.js +30 -22
- package/dist/typography/Text/Text.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.es.js","sources":["../../../src/typography/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@utilities/merge';\nimport { AriaAttributes, ReactElement, ReactNode } from 'react';\nimport { decorationMap, displayMap, overflowMap, whitespaceMap, wordBreakMap } from '../shared/records';\nimport { SharedTypographyProps } from '../shared/types';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\n\nexport type TextProps = SharedTypographyProps &\n AriaAttributes & {\n size?: TextSize;\n weight?: TextWeight;\n as?: 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';\n color?: TextColor;\n children?: ReactNode;\n };\n\nconst weightMap: Record<TextWeight, string> = {\n default: 'tw-font-regular',\n strong: 'tw-font-medium',\n 'x-strong': 'tw-font-bold',\n};\n\nconst sizeMap: Record<TextSize, string> = {\n 'x-small': 'tw-text-body-x-small',\n small: 'tw-text-body-small',\n medium: 'tw-text-body-medium',\n large: 'tw-text-body-large',\n};\n\nconst colorMap: Record<TextColor, string> = {\n default: 'tw-text-text',\n weak: 'tw-text-text-weak',\n 'x-weak': 'tw-text-text-x-weak',\n disabled: 'tw-text-text-disabled',\n negative: 'tw-text-text-negative',\n positive: 'tw-text-text-positive',\n warning: 'tw-text-text-warning',\n interactive: 'tw-text-text-interactive',\n};\n\nexport const Text = ({\n children,\n as: Tag = 'span',\n weight = 'default',\n size = 'medium',\n color = 'default',\n decoration = 'none',\n wordBreak = 'normal',\n whitespace = 'normal',\n overflow = 'visible',\n display,\n ...props\n}: TextProps): ReactElement => (\n <Tag\n data-test-id=\"text\"\n className={merge([\n 'tw-font-body tw-max-w-full',\n weightMap[weight],\n sizeMap[size],\n
|
|
1
|
+
{"version":3,"file":"Text.es.js","sources":["../../../src/typography/Text/Text.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@utilities/merge';\nimport { AriaAttributes, ReactElement, ReactNode } from 'react';\nimport { decorationMap, displayMap, overflowMap, whitespaceMap, wordBreakMap } from '../shared/records';\nimport { SharedTypographyProps } from '../shared/types';\n\ntype TextWeight = 'default' | 'strong' | 'x-strong';\ntype TextSize = 'x-small' | 'small' | 'medium' | 'large';\ntype TextColor = 'default' | 'weak' | 'x-weak' | 'disabled' | 'negative' | 'positive' | 'warning' | 'interactive';\ntype BoxColor = 'neutral' | 'selected' | 'disabled' | 'positive' | 'negative' | 'warning';\n\nexport type TextProps = SharedTypographyProps &\n AriaAttributes & {\n size?: TextSize;\n weight?: TextWeight;\n as?: 'a' | 'abbr' | 'address' | 'em' | 'label' | 'li' | 'span' | 'strong' | 'time' | 'p';\n color?: TextColor;\n /** @description optional color prop that uses the inverse box color when accessibility contrast is needed */\n boxColor?: BoxColor;\n children?: ReactNode;\n };\n\nconst weightMap: Record<TextWeight, string> = {\n default: 'tw-font-regular',\n strong: 'tw-font-medium',\n 'x-strong': 'tw-font-bold',\n};\n\nconst sizeMap: Record<TextSize, string> = {\n 'x-small': 'tw-text-body-x-small',\n small: 'tw-text-body-small',\n medium: 'tw-text-body-medium',\n large: 'tw-text-body-large',\n};\n\nconst colorMap: Record<TextColor, string> = {\n default: 'tw-text-text',\n weak: 'tw-text-text-weak',\n 'x-weak': 'tw-text-text-x-weak',\n disabled: 'tw-text-text-disabled',\n negative: 'tw-text-text-negative',\n positive: 'tw-text-text-positive',\n warning: 'tw-text-text-warning',\n interactive: 'tw-text-text-interactive',\n};\n\nconst boxColorMap: Record<BoxColor, string> = {\n neutral: 'tw-text-box-neutral-inverse',\n selected: 'tw-text-box-selected-inverse',\n disabled: 'tw-text-box-disabled-inverse',\n positive: 'tw-text-box-positive-inverse',\n negative: 'tw-text-box-negative-inverse',\n warning: 'tw-text-box-warning-inverse',\n};\n\nexport const Text = ({\n children,\n as: Tag = 'span',\n weight = 'default',\n size = 'medium',\n color = 'default',\n decoration = 'none',\n wordBreak = 'normal',\n whitespace = 'normal',\n overflow = 'visible',\n boxColor,\n display,\n ...props\n}: TextProps): ReactElement => (\n <Tag\n data-test-id=\"text\"\n className={merge([\n 'tw-font-body tw-max-w-full',\n weightMap[weight],\n sizeMap[size],\n decorationMap[decoration],\n boxColor ? boxColorMap[boxColor] : colorMap[color],\n wordBreakMap[wordBreak],\n overflow !== 'truncate' && whitespaceMap[whitespace],\n overflowMap[overflow],\n display && displayMap[display],\n ])}\n {...props}\n >\n {children}\n </Tag>\n);\nText.displayName = 'FondueText';\n"],"names":["weightMap","sizeMap","colorMap","boxColorMap","Text","children","Tag","weight","size","color","decoration","wordBreak","whitespace","overflow","boxColor","display","props","jsx","merge","decorationMap","wordBreakMap","whitespaceMap","overflowMap","displayMap"],"mappings":";;;AAuBA,MAAMA,IAAwC;AAAA,EAC1C,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAChB,GAEMC,IAAoC;AAAA,EACtC,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR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