@veeqo/ui 15.15.3 → 15.15.4
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/README.md +40 -29
- package/dist/components/PhoneInput/types.d.ts +16 -0
- package/dist/components/PriceInput/types.d.ts +10 -0
- package/dist/components/Search/types.d.ts +5 -0
- package/dist/hoc/withLabels/withLabels.cjs.map +1 -1
- package/dist/hoc/withLabels/withLabels.d.ts +7 -0
- package/dist/hoc/withLabels/withLabels.js.map +1 -1
- package/dist/hoc/withLabels/withLabels.module.scss.cjs +2 -2
- package/dist/hoc/withLabels/withLabels.module.scss.cjs.map +1 -1
- package/dist/hoc/withLabels/withLabels.module.scss.js +2 -2
- package/dist/hoc/withLabels/withLabels.module.scss.js.map +1 -1
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -118,8 +118,7 @@ src/icons/
|
|
|
118
118
|
2. Run the following commands to update the icon library:
|
|
119
119
|
|
|
120
120
|
```terminal
|
|
121
|
-
npm run figma:export # Export SVGs from Figma
|
|
122
|
-
npm run build:icons # Convert SVGs to React components
|
|
121
|
+
npm run figma:export-icons # Export icon SVGs from Figma & build React components
|
|
123
122
|
```
|
|
124
123
|
|
|
125
124
|
These scripts:
|
|
@@ -147,7 +146,7 @@ For more detailed information about the icon system, see our [Icon System Figma
|
|
|
147
146
|
|
|
148
147
|
### Adding additional SVG icon sets
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
Each icon set has its own build script that calls the shared `buildSvgSet` pipeline. To add a new set:
|
|
151
150
|
|
|
152
151
|
#### Create a new directory structure for your icons
|
|
153
152
|
|
|
@@ -158,33 +157,42 @@ src/icons/
|
|
|
158
157
|
└── imports/ # Raw SVGs
|
|
159
158
|
```
|
|
160
159
|
|
|
161
|
-
####
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
160
|
+
#### Create a build script
|
|
161
|
+
|
|
162
|
+
Create `scripts/build-your-icons.js` that imports `buildSvgSet` from the shared module:
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
import { buildSvgSet } from './shared/build-svg-set.js';
|
|
166
|
+
|
|
167
|
+
buildSvgSet({
|
|
168
|
+
importDir: './src/icons/your-icon-set/imports',
|
|
169
|
+
outputDir: './src/icons/your-icon-set/components',
|
|
170
|
+
indexPath: './src/icons/your-icon-set/components/index.ts',
|
|
171
|
+
importPrefix: './',
|
|
172
|
+
buildMode: 'parallel',
|
|
173
|
+
label: 'icons',
|
|
174
|
+
logNoun: 'icon',
|
|
175
|
+
lintGlob: './src/icons/your-icon-set/**/*.tsx',
|
|
176
|
+
svgrConfig: {
|
|
177
|
+
plugins: ['@svgr/plugin-jsx', '@svgr/plugin-prettier'],
|
|
178
|
+
typescript: true,
|
|
179
|
+
exportType: 'named',
|
|
180
|
+
ref: false,
|
|
181
|
+
prettierConfig: './.prettierrc',
|
|
182
|
+
// Additional SVGR options: https://react-svgr.com/docs/options/
|
|
183
|
+
replaceAttrValues: { '#000000': 'currentColor' },
|
|
184
|
+
icon: 24,
|
|
181
185
|
},
|
|
182
|
-
};
|
|
186
|
+
});
|
|
183
187
|
```
|
|
184
188
|
|
|
185
|
-
|
|
189
|
+
#### Add a package.json script
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
"build:your-icons": "node scripts/build-your-icons.js"
|
|
193
|
+
```
|
|
186
194
|
|
|
187
|
-
The
|
|
195
|
+
The `buildSvgSet` pipeline will automatically:
|
|
188
196
|
|
|
189
197
|
- Clean the output directory
|
|
190
198
|
- Generate React components from SVGs
|
|
@@ -198,9 +206,12 @@ The UI library includes automated scripts to export assets from Figma files. For
|
|
|
198
206
|
### Quick Start
|
|
199
207
|
|
|
200
208
|
```bash
|
|
201
|
-
# Export
|
|
209
|
+
# Export all icons and logos
|
|
202
210
|
npm run figma:export
|
|
203
211
|
|
|
204
|
-
# Export
|
|
205
|
-
npm run figma:export-
|
|
212
|
+
# Export icons only
|
|
213
|
+
npm run figma:export-icons
|
|
214
|
+
|
|
215
|
+
# Export logos (formerly "integration marks")
|
|
216
|
+
npm run figma:export-logos
|
|
206
217
|
```
|
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TextFieldProps } from '../TextField';
|
|
3
3
|
export type PhoneOption = {
|
|
4
|
+
/** Unique identifier for the phone option */
|
|
4
5
|
id: string;
|
|
6
|
+
/** Display label for the phone option */
|
|
5
7
|
label: string;
|
|
8
|
+
/** Additional info slot element */
|
|
6
9
|
itemInfoSlot: ReactElement;
|
|
10
|
+
/** Whether to disable selection rendering */
|
|
7
11
|
shouldDisableSelectionRender: boolean;
|
|
12
|
+
/** Media slot element (typically flag icon) */
|
|
8
13
|
mediaSlot: ReactElement;
|
|
9
14
|
};
|
|
10
15
|
export type InternationalCode = {
|
|
16
|
+
/** Country code (e.g., "US", "GB", "FR") */
|
|
11
17
|
countryCode: string;
|
|
18
|
+
/** Full country name */
|
|
12
19
|
country: string;
|
|
20
|
+
/** Country flag asset identifier used to resolve the flag SVG URL */
|
|
13
21
|
countryFlag: string;
|
|
22
|
+
/** Expected phone number length for this country */
|
|
14
23
|
length: number;
|
|
15
24
|
};
|
|
25
|
+
/** Props for the PhoneInput component */
|
|
16
26
|
export type PhoneInputProps = TextFieldProps & {
|
|
27
|
+
/** Phone number value including country code */
|
|
17
28
|
value?: string;
|
|
29
|
+
/** Callback fired when phone number changes */
|
|
18
30
|
onChange?: (value: string) => void;
|
|
31
|
+
/** Whether the input has validation errors */
|
|
19
32
|
hasError?: boolean;
|
|
33
|
+
/** Whether the input is disabled */
|
|
20
34
|
disabled?: boolean;
|
|
35
|
+
/** Error message to display */
|
|
21
36
|
error?: string;
|
|
37
|
+
/** Additional CSS class name */
|
|
22
38
|
className?: string;
|
|
23
39
|
};
|
|
24
40
|
export type PhoneOptions = PhoneOption[];
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { ComponentSizeType } from '../types';
|
|
2
|
+
/** Base props for the PriceInput component */
|
|
2
3
|
export interface PriceInputProps {
|
|
4
|
+
/** Additional CSS class name */
|
|
3
5
|
className?: string;
|
|
6
|
+
/** Whether the input is disabled and non-interactive */
|
|
4
7
|
disabled?: boolean;
|
|
8
|
+
/** Size of the input field */
|
|
5
9
|
size?: ComponentSizeType;
|
|
10
|
+
/** Currency symbol displayed as prefix */
|
|
6
11
|
currency: string;
|
|
12
|
+
/** Step value for increment/decrement buttons */
|
|
7
13
|
step?: string;
|
|
14
|
+
/** Whether the input has validation errors */
|
|
8
15
|
hasError?: boolean;
|
|
16
|
+
/** Current price value as string */
|
|
9
17
|
priceValue: string;
|
|
18
|
+
/** Callback fired when the input value changes */
|
|
10
19
|
onChange: (value: string) => void;
|
|
20
|
+
/** Callback fired when the price value changes */
|
|
11
21
|
onPriceChange: (value: string) => void;
|
|
12
22
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { TextFieldProps } from '../TextField/types';
|
|
3
|
+
/** Props for the Search component */
|
|
3
4
|
export type SearchProps = TextFieldProps & {
|
|
5
|
+
/** Whether to show loading spinner instead of search icon */
|
|
4
6
|
isLoading?: boolean;
|
|
7
|
+
/** Fill color for the search/clear icon and loading spinner */
|
|
5
8
|
fill?: string;
|
|
9
|
+
/** Callback fired when the clear button is clicked */
|
|
6
10
|
onClearClick?: (event: SyntheticEvent) => void;
|
|
11
|
+
/** Whether to position the search icon on the left side */
|
|
7
12
|
reversed?: boolean;
|
|
8
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["forwardRef","useId","React","FlexCol","styles","FlexRow","Text","BlockTooltip","HelpIcon","theme","MiniAlert"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n /** Unique identifier for the component */\n id?: string;\n /** Label text displayed above the component */\n label?: ReactNode;\n /** Hint text displayed below the component for additional context */\n hint?: ReactNode;\n /** Error message displayed when validation fails */\n error?: ReactNode;\n /** Message displayed when the component is disabled */\n disabledMessage?: ReactNode;\n /** Tooltip text displayed on hover via help icon */\n tooltip?: string;\n /** Custom rich content for tooltip (ReactNode) */\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["forwardRef","useId","React","FlexCol","styles","FlexRow","Text","BlockTooltip","HelpIcon","theme","MiniAlert"],"mappings":";;;;;;;;;;;;;;;;;AA8BA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAGA,gBAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAGC,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,KAAK;AACR,YAAA,QACEC,sBAAA,CAAA,aAAA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EAAE,CAAC,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,CAAC,eAAe,EAC3B,eAAe,EAAE,eAAe,EAAA,GAC3B,UAAgB,EAAA,CACrB;YACD,KAAK,KACJA,sBAAA,CAAA,aAAA,CAACQ,mBAAS,EAAA,EACR,EAAE,EAAE,CAAA,EAAG,WAAW,CAAA,MAAA,CAAQ,EAC1B,OAAO,EAAC,OAAO,EACf,MAAM,EAAE,KAAK,EACb,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EAAA,CACZ,CACH;YACA,eAAe,KACdR,sBAAA,CAAA,aAAA,CAACQ,mBAAS,IACR,EAAE,EAAE,CAAA,EAAG,WAAW,CAAA,SAAA,CAAW,EAC7B,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,eAAe,EAAA,CACtB,CACH,CACO;AAEd,IAAA,CAAC,CACF;AAED,IAAA,mBAAmB,CAAC,WAAW,GAAG,CAAA,WAAA,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React, { ComponentType, ReactNode } from 'react';
|
|
2
2
|
export interface WithLabelsProps {
|
|
3
|
+
/** Unique identifier for the component */
|
|
3
4
|
id?: string;
|
|
5
|
+
/** Label text displayed above the component */
|
|
4
6
|
label?: ReactNode;
|
|
7
|
+
/** Hint text displayed below the component for additional context */
|
|
5
8
|
hint?: ReactNode;
|
|
9
|
+
/** Error message displayed when validation fails */
|
|
6
10
|
error?: ReactNode;
|
|
11
|
+
/** Message displayed when the component is disabled */
|
|
7
12
|
disabledMessage?: ReactNode;
|
|
13
|
+
/** Tooltip text displayed on hover via help icon */
|
|
8
14
|
tooltip?: string;
|
|
15
|
+
/** Custom rich content for tooltip (ReactNode) */
|
|
9
16
|
tooltipContent?: ReactNode;
|
|
10
17
|
}
|
|
11
18
|
export declare const withLabels: <P, R = unknown>(Component: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P & WithLabelsProps> & React.RefAttributes<R>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n /** Unique identifier for the component */\n id?: string;\n /** Label text displayed above the component */\n label?: ReactNode;\n /** Hint text displayed below the component for additional context */\n hint?: ReactNode;\n /** Error message displayed when validation fails */\n error?: ReactNode;\n /** Message displayed when the component is disabled */\n disabledMessage?: ReactNode;\n /** Tooltip text displayed on hover via help icon */\n tooltip?: string;\n /** Custom rich content for tooltip (ReactNode) */\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;AA8BA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAG,UAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QA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AG,EACR,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,CAAC,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,CAAC,eAAe,EAC3B,eAAe,EAAE,eAAe,EAAA,GAC3B,UAAgB,EAAA,CACrB;YACD,KAAK,KACJA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,EAAE,EAAE,CAAA,EAAG,WAAW,CAAA,MAAA,CAAQ,EAC1B,OAAO,EAAC,OAAO,EACf,MAAM,EAAE,KAAK,EACb,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EAAA,CACZ,CACH;YACA,eAAe,KACdA,cAAA,CAAA,aAAA,CAAC,SAAS,IACR,EAAE,EAAE,CAAA,EAAG,WAAW,CAAA,SAAA,CAAW,EAC7B,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,eAAe,EAAA,CACtB,CACH,CACO;AAEd,IAAA,CAAC,CACF;AAED,IAAA,mBAAmB,CAAC,WAAW,GAAG,CAAA,WAAA,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
4
|
|
|
5
|
-
___$insertStyle(".
|
|
6
|
-
var labelStyles = {"rootStack":"
|
|
5
|
+
___$insertStyle("._rootStack_idlam_1 {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n._hint_idlam_6 {\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n}\n\n/* Error token uses font-weight: 600, but form errors render at normal weight */\n._error_idlam_12 {\n font-weight: normal;\n}");
|
|
6
|
+
var labelStyles = {"rootStack":"_rootStack_idlam_1","hint":"_hint_idlam_6","error":"_error_idlam_12"};
|
|
7
7
|
|
|
8
8
|
module.exports = labelStyles;
|
|
9
9
|
//# sourceMappingURL=withLabels.module.scss.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.module.scss.cjs","sources":["../../../src/hoc/withLabels/withLabels.module.scss"],"sourcesContent":[".rootStack {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n.hint {\n
|
|
1
|
+
{"version":3,"file":"withLabels.module.scss.cjs","sources":["../../../src/hoc/withLabels/withLabels.module.scss"],"sourcesContent":[".rootStack {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n.hint {\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n}\n\n/* Error token uses font-weight: 600, but form errors render at normal weight */\n.error {\n font-weight: normal;\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,iXAAA;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
2
|
|
|
3
|
-
insertStyle(".
|
|
4
|
-
var labelStyles = {"rootStack":"
|
|
3
|
+
insertStyle("._rootStack_idlam_1 {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n._hint_idlam_6 {\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n}\n\n/* Error token uses font-weight: 600, but form errors render at normal weight */\n._error_idlam_12 {\n font-weight: normal;\n}");
|
|
4
|
+
var labelStyles = {"rootStack":"_rootStack_idlam_1","hint":"_hint_idlam_6","error":"_error_idlam_12"};
|
|
5
5
|
|
|
6
6
|
export { labelStyles as default };
|
|
7
7
|
//# sourceMappingURL=withLabels.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.module.scss.js","sources":["../../../src/hoc/withLabels/withLabels.module.scss"],"sourcesContent":[".rootStack {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n.hint {\n
|
|
1
|
+
{"version":3,"file":"withLabels.module.scss.js","sources":["../../../src/hoc/withLabels/withLabels.module.scss"],"sourcesContent":[".rootStack {\n position: relative;\n}\n\n/* Overrides hintText token's 12px/16px to use body font-size/line-height */\n.hint {\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n}\n\n/* Error token uses font-weight: 600, but form errors render at normal weight */\n.error {\n font-weight: normal;\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,iXAAA;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veeqo/ui",
|
|
3
|
-
"version": "15.15.
|
|
3
|
+
"version": "15.15.4",
|
|
4
4
|
"description": "New optimised component library for Veeqo.",
|
|
5
5
|
"author": "Robert Wealthall",
|
|
6
6
|
"license": "ISC",
|
|
@@ -42,13 +42,16 @@
|
|
|
42
42
|
"tags:remove": "node scripts/remove-tag.cjs",
|
|
43
43
|
"tags:update": "git fetch --tags && git push --follow-tags",
|
|
44
44
|
"changelog:update": "npm run tags:update && auto-changelog -p && bash ./scripts/ai-changelog.sh && git add CHANGELOG.md NEW_CHANGELOG.md && (git diff --cached --quiet || git commit -m \"Update CHANGELOG and NEW_CHANGELOG\")",
|
|
45
|
-
"figma:export": "
|
|
45
|
+
"figma:export": "npm run figma:export-icons && npm run figma:export-logos",
|
|
46
|
+
"figma:export-icons": "rimraf ./src/icons/design-system/imports && dotenv figma-export use-config scripts/figma-export/.figmaexportrc.icons.js && npm run build:icons",
|
|
46
47
|
"figma:publish": "if [ ! -f ./.env ]; then echo 'Error: .env not found — copy .env.sample to .env and set FIGMA_TOKEN' >&2; exit 1; fi; set -a && . ./.env && set +a; if [ -z \"$FIGMA_TOKEN\" ]; then echo 'Error: FIGMA_TOKEN is empty — set it in .env' >&2; exit 1; fi; FIGMA_ACCESS_TOKEN=\"$FIGMA_TOKEN\" npx figma connect publish --force",
|
|
47
48
|
"icons:code-connect": "node scripts/figma-export/generate-icon-code-connect.js",
|
|
48
|
-
"
|
|
49
|
-
"figma:export-
|
|
50
|
-
"figma:export-
|
|
51
|
-
"figma:export-
|
|
49
|
+
"logos:code-connect": "node scripts/figma-export/generate-logo-code-connect.js",
|
|
50
|
+
"figma:export-code-connect": "npm run icons:code-connect && npm run logos:code-connect",
|
|
51
|
+
"figma:export-logos": "rimraf ./src/logos/imports && dotenv figma-export use-config scripts/figma-export/.figmaexportrc.logos.js -- --type=all && npm run build:logos",
|
|
52
|
+
"figma:export-logos:channels": "dotenv figma-export use-config scripts/figma-export/.figmaexportrc.logos.js -- --type=channels && npm run build:logos",
|
|
53
|
+
"figma:export-logos:carriers": "dotenv figma-export use-config scripts/figma-export/.figmaexportrc.logos.js -- --type=carriers && npm run build:logos",
|
|
54
|
+
"figma:export-logos:accounting": "dotenv figma-export use-config scripts/figma-export/.figmaexportrc.logos.js -- --type=accounting && npm run build:logos"
|
|
52
55
|
},
|
|
53
56
|
"auto-changelog": {
|
|
54
57
|
"issueUrl": "https://sim.amazon.com/issues/{id}",
|