@veeqo/ui 11.0.0 → 11.2.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/dist/components/DataGrid/DataGrid.cjs +17 -3
- package/dist/components/DataGrid/DataGrid.cjs.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +1 -1
- package/dist/components/DataGrid/DataGrid.js +17 -3
- package/dist/components/DataGrid/DataGrid.js.map +1 -1
- package/dist/components/DataGrid/components/Body/Body.cjs +1 -1
- package/dist/components/DataGrid/components/Body/Body.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/Body.js +1 -1
- package/dist/components/DataGrid/components/Body/Body.js.map +1 -1
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.cjs +34 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.d.ts +24 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.js +28 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.js.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.cjs +9 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.js +7 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/EmptyBody.module.scss.js.map +1 -0
- package/dist/components/DataGrid/components/Body/EmptyBody/index.d.ts +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.cjs +21 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.d.ts +21 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.js +15 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBody.js.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +46 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.d.ts +13 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +40 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/index.d.ts +1 -0
- package/dist/components/DataGrid/components/Body/Row/Row.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/Row/Row.d.ts +6 -3
- package/dist/components/DataGrid/components/Body/Row/Row.js.map +1 -1
- package/dist/components/DataGrid/components/Body/index.d.ts +2 -0
- package/dist/components/DataGrid/components/Footer/Footer.cjs +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.cjs.map +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.js +1 -1
- package/dist/components/DataGrid/components/Footer/Footer.js.map +1 -1
- package/dist/components/DataGrid/types/DataGridProps.d.ts +21 -0
- package/dist/components/DataGrid/types/EmptyState.d.ts +6 -0
- package/dist/components/DataGrid/types/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +7 -12
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +4 -4
- package/dist/components/Skeleton/Skeleton.js +6 -11
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.scss.cjs +9 -0
- package/dist/components/Skeleton/Skeleton.module.scss.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js +7 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js.map +1 -0
- package/dist/components/ViewTab/ViewTab.cjs +3 -4
- package/dist/components/ViewTab/ViewTab.cjs.map +1 -1
- package/dist/components/ViewTab/ViewTab.d.ts +3 -1
- package/dist/components/ViewTab/ViewTab.js +3 -4
- package/dist/components/ViewTab/ViewTab.js.map +1 -1
- package/dist/components/ViewTab/styled.cjs +27 -2
- package/dist/components/ViewTab/styled.cjs.map +1 -1
- package/dist/components/ViewTab/styled.d.ts +1 -1
- package/dist/components/ViewTab/styled.js +27 -2
- package/dist/components/ViewTab/styled.js.map +1 -1
- package/dist/components/ViewTab/types.cjs.map +1 -1
- package/dist/components/ViewTab/types.d.ts +7 -2
- package/dist/components/ViewTab/types.js.map +1 -1
- package/dist/utils/assignCssVars.cjs +26 -0
- package/dist/utils/assignCssVars.cjs.map +1 -0
- package/dist/utils/assignCssVars.d.ts +13 -0
- package/dist/utils/assignCssVars.js +24 -0
- package/dist/utils/assignCssVars.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../src/components/ViewTab/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { CSSProperties } from 'react';\nimport { ColourPalette, colors } from '../../theme/modules/colors';\n\nimport { Text } from '../Text';\nimport { BaseContainer } from '../BaseContainer';\n\nimport { ViewTabProps } from './types';\nimport { sizes } from '../../theme/modules/sizes';\nimport { ThreeDotsIcon, CrossIcon } from '../../icons';\nimport { FlatButton } from '../Button/components/styled';\nimport { theme } from '../../theme';\n\ntype RequiredPalette = { colourPalette: ColourPalette };\nexport type ContourProps = Pick<ViewTabProps, 'active' | 'customTextColour'> & RequiredPalette;\nexport type CounterProps = Pick<ViewTabProps, 'active' | 'customTextColour'> & RequiredPalette;\nexport type ViewButtonProps = Pick<ViewTabProps, 'customTextColour'>;\n\nconst CounterText = styled(Text)`\n line-height: 1;\n`;\n\nconst ThreeDotsIconStyling = styled(ThreeDotsIcon)``;\nconst CrossIconStyling = styled(CrossIcon)``;\n\nconst CounterContainer = styled
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../src/components/ViewTab/styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { CSSProperties } from 'react';\nimport { ColourPalette, colors } from '../../theme/modules/colors';\n\nimport { Text } from '../Text';\nimport { BaseContainer } from '../BaseContainer';\n\nimport { ViewTabProps } from './types';\nimport { sizes } from '../../theme/modules/sizes';\nimport { ThreeDotsIcon, CrossIcon } from '../../icons';\nimport { FlatButton } from '../Button/components/styled';\nimport { theme } from '../../theme';\n\ntype RequiredPalette = { colourPalette: ColourPalette };\nexport type ContourProps = Pick<ViewTabProps, 'active' | 'customTextColour'> & RequiredPalette;\nexport type CounterProps = Pick<ViewTabProps, 'active' | 'customTextColour'> & RequiredPalette;\nexport type ViewButtonProps = Pick<ViewTabProps, 'customTextColour'>;\n\nconst CounterText = styled(Text)`\n line-height: 1;\n`;\n\nconst ThreeDotsIconStyling = styled(ThreeDotsIcon)``;\nconst CrossIconStyling = styled(CrossIcon)``;\n\nconst CounterContainer = styled.div<CounterProps>`\n display: inline-flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n border-radius: 4px;\n padding: 2px 4px;\n min-width: 20px;\n height: 20px;\n margin-left: 8px;\n\n ${({ active, colourPalette }) =>\n active &&\n `\n background-color: ${colourPalette.dark};\n\n & ${CounterText} {\n color: ${colors.neutral.grey.lightest};\n }\n\n /* Force all text elements to be white when active, used when using slot */\n & ${Text} {\n color: ${colors.neutral.grey.lightest} !important;\n }\n\n /* Force all SVG icons to be white when active, used when using slot */\n & svg {\n fill: ${colors.neutral.grey.lightest};\n color: ${colors.neutral.grey.lightest};\n }\n `}\n`;\n\nconst Contour = styled(BaseContainer)<ContourProps>`\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 40px;\n border-radius: 4px;\n padding: ${theme.sizes.sm};\n border: 1px solid transparent;\n cursor: pointer;\n background-color: transparent;\n\n ${({ customTextColour }) => `\n\n &:hover {\n background-color: ${colors.neutral.grey.base};\n & > ${CounterContainer} {\n background-color: ${colors.neutral.grey.base};\n & > ${CounterText} {\n color: ${colors.neutral.ink.base};\n }\n & ${Text} {\n color: ${colors.neutral.ink.base} !important;\n }\n & svg {\n fill: ${colors.neutral.ink.base};\n color: ${colors.neutral.ink.base};\n }\n }\n & > ${Text} {\n color: ${customTextColour ?? colors.neutral.ink.dark};\n }\n & > ${ThreeDotsIconStyling} {\n color: ${colors.neutral.ink.dark};\n }\n & > ${CrossIconStyling} {\n color: ${colors.neutral.ink.dark};\n }\n }\n\n & > ${Text} {\n color: ${customTextColour ?? colors.neutral.ink.dark};\n }\n `}\n\n ${({ active, colourPalette, customTextColour }) =>\n active &&\n `\n background-color: ${colourPalette.lightest};\n\n & > ${ThreeDotsIconStyling} {\n color: ${colourPalette.dark};\n }\n & > ${CrossIconStyling} {\n color: ${colourPalette.dark};\n }\n\n & > ${Text} {\n color: ${customTextColour ?? colourPalette.dark};\n }\n `}\n`;\n\nconst ViewButton = styled(FlatButton)<ViewButtonProps>`\n padding: ${theme.sizes.sm};\n box-sizing: border-box;\n border-radius: 4px;\n border: none;\n position: relative;\n margin: 0;\n padding: 0;\n\n ${({ customTextColour }) => `\n &:focus-visible {\n ${Contour} {\n background-color: ${colors.neutral.grey.base};\n & > ${CounterContainer} {\n background-color: ${colors.neutral.grey.base};\n & > ${CounterText} {\n color: ${colors.neutral.ink.base};\n }\n & ${Text} {\n color: ${colors.neutral.ink.base} !important;\n }\n & svg {\n fill: ${colors.neutral.ink.base};\n color: ${colors.neutral.ink.base};\n }\n }\n & > ${Text} {\n color: ${customTextColour ?? colors.neutral.ink.dark};\n }\n & > ${ThreeDotsIconStyling} {\n color: ${colors.neutral.ink.dark};\n }\n & > ${CrossIconStyling} {\n color: ${colors.neutral.ink.dark};\n }\n }\n `}\n`;\n\nconst IconStyling = {\n style: {\n marginLeft: sizes.xs,\n padding: sizes.xs,\n height: sizes.base,\n width: sizes.base,\n } as CSSProperties,\n};\n\nexport const CustomIconWrapper = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${sizes.sm};\n\n svg {\n height: ${sizes.base};\n width: ${sizes.base};\n }\n`;\n\nexport {\n ViewButton,\n Contour,\n Text,\n CounterContainer,\n CounterText,\n IconStyling,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ributes, ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport enum ViewTabTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport type ViewTabProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'name' | 'id' | 'type'\n> & {\n /** Colour palette for the ViewTab */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the ViewTab */\n active?: boolean;\n\n /** ViewTab name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** ViewTab's unique identifier */\n id: string;\n\n /** ViewTab type */\n type?: keyof typeof ViewTabTypes;\n\n /** Number or string value to show near viewTab label */\n count?: number | string | null;\n\n /** Event handler for when ViewTab component is clicked (should get activated) */\n onClick: (id: string) => void;\n\n /** Event handler for when ViewTab component is clicked and isActive */\n subAction?: (id: string) => void;\n\n /** Context used to add to aria label, (orders or products based on page) */\n ariaContext
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/components/ViewTab/types.ts"],"sourcesContent":["import { ButtonHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport enum ViewTabTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport type ViewTabProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'name' | 'id' | 'type'\n> & {\n /** Colour palette for the ViewTab */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the ViewTab */\n active?: boolean;\n\n /** ViewTab name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** ViewTab's unique identifier */\n id: string;\n\n /** ViewTab type */\n type?: keyof typeof ViewTabTypes;\n\n /** Number or string value to show near viewTab label */\n count?: number | string | null;\n\n /** Slot for custom count element */\n /** If countSlot is provided, it will override the count prop */\n countSlot?: ReactNode;\n\n /** Event handler for when ViewTab component is clicked (should get activated) */\n onClick: (id: string) => void;\n\n /** Event handler for when ViewTab component is clicked and isActive */\n subAction?: (id: string) => void;\n\n /** Context used to add to aria label, (orders or products based on page) */\n ariaContext?: string;\n\n /** Used to pass additonal context when using countSlot */\n ariaDescribedBy?: string;\n};\n"],"names":["ViewTabTypes"],"mappings":";;AAGYA;AAAZ,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJWA,oBAAY,KAAZA,oBAAY,GAIvB,EAAA,CAAA,CAAA;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ColourPalette } from '../../theme/modules/colors';
|
|
3
3
|
export declare enum ViewTabTypes {
|
|
4
4
|
saved = "saved",
|
|
@@ -22,10 +22,15 @@ export type ViewTabProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClic
|
|
|
22
22
|
type?: keyof typeof ViewTabTypes;
|
|
23
23
|
/** Number or string value to show near viewTab label */
|
|
24
24
|
count?: number | string | null;
|
|
25
|
+
/** Slot for custom count element */
|
|
26
|
+
/** If countSlot is provided, it will override the count prop */
|
|
27
|
+
countSlot?: ReactNode;
|
|
25
28
|
/** Event handler for when ViewTab component is clicked (should get activated) */
|
|
26
29
|
onClick: (id: string) => void;
|
|
27
30
|
/** Event handler for when ViewTab component is clicked and isActive */
|
|
28
31
|
subAction?: (id: string) => void;
|
|
29
32
|
/** Context used to add to aria label, (orders or products based on page) */
|
|
30
|
-
ariaContext
|
|
33
|
+
ariaContext?: string;
|
|
34
|
+
/** Used to pass additonal context when using countSlot */
|
|
35
|
+
ariaDescribedBy?: string;
|
|
31
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/ViewTab/types.ts"],"sourcesContent":["import { ButtonHTMLAttributes, ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport enum ViewTabTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport type ViewTabProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'name' | 'id' | 'type'\n> & {\n /** Colour palette for the ViewTab */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the ViewTab */\n active?: boolean;\n\n /** ViewTab name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** ViewTab's unique identifier */\n id: string;\n\n /** ViewTab type */\n type?: keyof typeof ViewTabTypes;\n\n /** Number or string value to show near viewTab label */\n count?: number | string | null;\n\n /** Event handler for when ViewTab component is clicked (should get activated) */\n onClick: (id: string) => void;\n\n /** Event handler for when ViewTab component is clicked and isActive */\n subAction?: (id: string) => void;\n\n /** Context used to add to aria label, (orders or products based on page) */\n ariaContext
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/ViewTab/types.ts"],"sourcesContent":["import { ButtonHTMLAttributes, ReactElement, ReactNode } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport enum ViewTabTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport type ViewTabProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'name' | 'id' | 'type'\n> & {\n /** Colour palette for the ViewTab */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the ViewTab */\n active?: boolean;\n\n /** ViewTab name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** ViewTab's unique identifier */\n id: string;\n\n /** ViewTab type */\n type?: keyof typeof ViewTabTypes;\n\n /** Number or string value to show near viewTab label */\n count?: number | string | null;\n\n /** Slot for custom count element */\n /** If countSlot is provided, it will override the count prop */\n countSlot?: ReactNode;\n\n /** Event handler for when ViewTab component is clicked (should get activated) */\n onClick: (id: string) => void;\n\n /** Event handler for when ViewTab component is clicked and isActive */\n subAction?: (id: string) => void;\n\n /** Context used to add to aria label, (orders or products based on page) */\n ariaContext?: string;\n\n /** Used to pass additonal context when using countSlot */\n ariaDescribedBy?: string;\n};\n"],"names":[],"mappings":"IAGY;AAAZ,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,GAIvB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('../components/ThemeInjector/utils.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
7
|
+
* working with CSS modules.
|
|
8
|
+
*
|
|
9
|
+
* Property names are converted from camelCase to kebab-case.
|
|
10
|
+
*
|
|
11
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
12
|
+
* @returns A style object containing the CSS variables.
|
|
13
|
+
*/
|
|
14
|
+
const assignCssVars = (props) => {
|
|
15
|
+
const styleObject = {};
|
|
16
|
+
Object.entries(props).forEach(([propName, value]) => {
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
styleObject[`--${utils.camelToKebab(propName)}`] = value.toString();
|
|
21
|
+
});
|
|
22
|
+
return styleObject;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.assignCssVars = assignCssVars;
|
|
26
|
+
//# sourceMappingURL=assignCssVars.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignCssVars.cjs","sources":["../../src/utils/assignCssVars.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { camelToKebab } from '../components/ThemeInjector/utils';\n\ntype ValidCssVariableType = string | number | undefined;\n\n/**\n * Utility function which converts an object of properties into a style object with CSS variables, for use when\n * working with CSS modules.\n *\n * Property names are converted from camelCase to kebab-case.\n *\n * @param props An object containing props to pass though as CSS variables.\n * @returns A style object containing the CSS variables.\n */\nexport const assignCssVars = (props: Record<string, ValidCssVariableType>) => {\n const styleObject: Record<string, string> = {};\n\n Object.entries(props).forEach(([propName, value]) => {\n if (value === undefined) {\n return;\n }\n\n styleObject[`--${camelToKebab(propName)}`] = value.toString();\n });\n\n return styleObject as CSSProperties;\n};\n"],"names":["camelToKebab"],"mappings":";;;;AAKA;;;;;;;;AAQG;AACU,MAAA,aAAa,GAAG,CAAC,KAA2C,KAAI;IAC3E,MAAM,WAAW,GAA2B,EAAE;AAE9C,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAI;QAClD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB;AACD;AAED,QAAA,WAAW,CAAC,CAAA,EAAA,EAAKA,kBAAY,CAAC,QAAQ,CAAC,CAAE,CAAA,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE;AAC/D,KAAC,CAAC;AAEF,IAAA,OAAO,WAA4B;AACrC;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
type ValidCssVariableType = string | number | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
5
|
+
* working with CSS modules.
|
|
6
|
+
*
|
|
7
|
+
* Property names are converted from camelCase to kebab-case.
|
|
8
|
+
*
|
|
9
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
10
|
+
* @returns A style object containing the CSS variables.
|
|
11
|
+
*/
|
|
12
|
+
export declare const assignCssVars: (props: Record<string, ValidCssVariableType>) => CSSProperties;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { camelToKebab } from '../components/ThemeInjector/utils.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility function which converts an object of properties into a style object with CSS variables, for use when
|
|
5
|
+
* working with CSS modules.
|
|
6
|
+
*
|
|
7
|
+
* Property names are converted from camelCase to kebab-case.
|
|
8
|
+
*
|
|
9
|
+
* @param props An object containing props to pass though as CSS variables.
|
|
10
|
+
* @returns A style object containing the CSS variables.
|
|
11
|
+
*/
|
|
12
|
+
const assignCssVars = (props) => {
|
|
13
|
+
const styleObject = {};
|
|
14
|
+
Object.entries(props).forEach(([propName, value]) => {
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
styleObject[`--${camelToKebab(propName)}`] = value.toString();
|
|
19
|
+
});
|
|
20
|
+
return styleObject;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { assignCssVars };
|
|
24
|
+
//# sourceMappingURL=assignCssVars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignCssVars.js","sources":["../../src/utils/assignCssVars.ts"],"sourcesContent":["import { CSSProperties } from 'react';\nimport { camelToKebab } from '../components/ThemeInjector/utils';\n\ntype ValidCssVariableType = string | number | undefined;\n\n/**\n * Utility function which converts an object of properties into a style object with CSS variables, for use when\n * working with CSS modules.\n *\n * Property names are converted from camelCase to kebab-case.\n *\n * @param props An object containing props to pass though as CSS variables.\n * @returns A style object containing the CSS variables.\n */\nexport const assignCssVars = (props: Record<string, ValidCssVariableType>) => {\n const styleObject: Record<string, string> = {};\n\n Object.entries(props).forEach(([propName, value]) => {\n if (value === undefined) {\n return;\n }\n\n styleObject[`--${camelToKebab(propName)}`] = value.toString();\n });\n\n return styleObject as CSSProperties;\n};\n"],"names":[],"mappings":";;AAKA;;;;;;;;AAQG;AACU,MAAA,aAAa,GAAG,CAAC,KAA2C,KAAI;IAC3E,MAAM,WAAW,GAA2B,EAAE;AAE9C,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAI;QAClD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB;AACD;AAED,QAAA,WAAW,CAAC,CAAA,EAAA,EAAK,YAAY,CAAC,QAAQ,CAAC,CAAE,CAAA,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE;AAC/D,KAAC,CAAC;AAEF,IAAA,OAAO,WAA4B;AACrC;;;;"}
|