@bcgov/design-system-react-components 0.9.1-pr1008 → 0.9.1-pr1010
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 +35 -0
- package/dist/cjs/components/AlertDialog/AlertDialog2.cjs +1 -1
- package/dist/cjs/components/AlertDialog/AlertDialog2.cjs.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup2.cjs +1 -0
- package/dist/cjs/components/RadioGroup/RadioGroup2.cjs.map +1 -1
- package/dist/cjs/components/Tag/Tag2.cjs +0 -1
- package/dist/cjs/components/Tag/Tag2.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/AlertDialog/AlertDialog2.js +2 -2
- package/dist/esm/components/AlertDialog/AlertDialog2.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup2.js +1 -0
- package/dist/esm/components/RadioGroup/RadioGroup2.js.map +1 -1
- package/dist/esm/components/Tag/Tag2.js +0 -1
- package/dist/esm/components/Tag/Tag2.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +0 -1
- package/package.json +21 -24
package/README.md
CHANGED
|
@@ -198,6 +198,41 @@ oc tag ed91fb-tools/design-system-react-components-storybook:develop ed91fb-tool
|
|
|
198
198
|
|
|
199
199
|
With Storybook running locally, use the `npm run test-storybook` script to test Storybook with Vitest's browser mode. This script uses the configuration defined in `./vite.config.ts`. [Learn more about Storybook's Vitest addon.](https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon).
|
|
200
200
|
|
|
201
|
+
#### Visual regression testing
|
|
202
|
+
|
|
203
|
+
Every story is screenshotted and compared against a committed baseline using [Vitest's visual regression testing](https://vitest.dev/guide/browser/visual-regression-testing). Tests run in a pinned Playwright Docker image so screenshots are identical on every machine, so you need Docker (or Podman) installed.
|
|
204
|
+
|
|
205
|
+
If Docker runs in a VM (Podman, or Docker Desktop on macOS/Windows), give the VM at least 4 GB of memory. With less, the run can stall with no output. For Podman, run `podman machine stop`, `podman machine set --memory 4096` and `podman machine start`. For Docker Desktop, use Settings → Resources → Memory.
|
|
206
|
+
|
|
207
|
+
- `npm run test-visual` compares every story against its baseline in `src/stories/__screenshots__/`. When a story changes, the test fails and writes the reference, actual and diff images to `.vitest/attachments/`.
|
|
208
|
+
- `npm run test-visual:update` regenerates the baselines. Run this when a visual change is intentional, then commit the updated PNGs alongside your code. Reviewers approve the change by reviewing the image diffs in the PR.
|
|
209
|
+
- Pass a path to run a subset, for example `npm run test-visual -- src/stories/Button.stories.tsx`.
|
|
210
|
+
- When tests fail, a summary groups failures by stories file, with the most failures first. The component you changed is usually near the top, and files further down may simply contain it.
|
|
211
|
+
|
|
212
|
+
Don't generate baselines outside Docker. Font rendering differs between operating systems, so screenshots taken on your machine won't match.
|
|
213
|
+
|
|
214
|
+
To opt a story (or a whole stories file, via its `meta`) out of visual testing, add the `!visual` tag:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
export const Animated: Story = {
|
|
218
|
+
tags: ["!visual"],
|
|
219
|
+
};
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Stories are captured after their `play` function runs. Animations are disabled, and the date is frozen to 15 January 2025.
|
|
223
|
+
|
|
224
|
+
Overlays (dialogs, menus, popovers, tooltips) need to be open to be worth a screenshot. In overlay stories files, closed stories opt out with `!visual` on the `meta`, and hidden stories open the overlay with props such as `defaultOpen`:
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
export const DialogTemplateOpen: Story = {
|
|
228
|
+
...DialogTemplate,
|
|
229
|
+
tags: ["!dev", "!autodocs", "visual", "overlay"],
|
|
230
|
+
render: renderOpenDialog,
|
|
231
|
+
};
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`!dev` and `!autodocs` hide the story from the Storybook sidebar and docs. The `overlay` tag makes the test fail if nothing is open when the screenshot is taken. Each overlay file also has one hidden `…Closed` story (tagged `["!dev", "!autodocs", "visual"]`) so the closed trigger is still captured once. Tags must be written as array literals, because Storybook reads them statically. Don't put tags on a story that other stories spread (`...Template`), or they'll be inherited.
|
|
235
|
+
|
|
201
236
|
### Vite kitchen sink application
|
|
202
237
|
|
|
203
238
|
Vite uses the components code directly from `./src/components` in groups of content in `./src/pages`.
|
|
@@ -40,7 +40,7 @@ function AlertDialog({ children, variant = "info", role = "dialog", title, isClo
|
|
|
40
40
|
className: "bcds-react-aria-AlertDialog--Icon",
|
|
41
41
|
children: getIcon(variant)
|
|
42
42
|
}),
|
|
43
|
-
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
43
|
+
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Heading, {
|
|
44
44
|
className: "bcds-react-aria-AlertDialog--Title",
|
|
45
45
|
slot: "title",
|
|
46
46
|
children: title
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog2.cjs","names":["SvgInfoIcon","SvgCheckCircleIcon","SvgExclamationIcon","SvgExclamationCircleIcon","ReactAriaDialog","_Fragment","Button","SvgCloseIcon","ButtonGroup"],"sources":["../../../../src/components/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n Dialog as ReactAriaDialog,\n DialogTrigger,\n DialogProps as ReactAriaDialogProps,\n} from \"react-aria-components\";\n\nimport Button from \"../Button\";\nimport ButtonGroup from \"../ButtonGroup\";\nimport { DialogRenderProps } from \"../Dialog/Dialog\";\nimport SvgCheckCircleIcon from \"../Icons/SvgCheckCircleIcon\";\nimport SvgCloseIcon from \"../Icons/SvgCloseIcon\";\nimport SvgExclamationCircleIcon from \"../Icons/SvgExclamationCircleIcon\";\nimport SvgExclamationIcon from \"../Icons/SvgExclamationIcon\";\nimport SvgInfoIcon from \"../Icons/SvgInfoIcon\";\n\nimport \"./AlertDialog.css\";\n\nexport interface AlertDialogProps extends ReactAriaDialogProps {\n /* Dialog theme */\n variant?: \"info\" | \"confirmation\" | \"warning\" | \"error\" | \"destructive\";\n /* Dialog title */\n title?: string;\n /* Show or hide left icon */\n isIconHidden?: boolean;\n /* Show or hide close button */\n isCloseable?: boolean;\n /* Array of Button components */\n buttons?: React.ReactNode;\n}\n\n/* Sets correct left icon for selected variant */\nfunction getIcon(variant: string) {\n switch (variant) {\n case \"info\":\n return <SvgInfoIcon />;\n case \"confirmation\":\n return <SvgCheckCircleIcon />;\n case \"warning\":\n return <SvgExclamationIcon />;\n case \"error\":\n return <SvgExclamationCircleIcon />;\n case \"destructive\":\n return <SvgExclamationCircleIcon />;\n default:\n return;\n }\n}\n\nexport default function AlertDialog({\n children,\n variant = \"info\",\n role = \"dialog\",\n title,\n isCloseable = true,\n isIconHidden = false,\n buttons,\n ...props\n}: AlertDialogProps): JSX.Element {\n return (\n <ReactAriaDialog\n className={`bcds-react-aria-AlertDialog ${variant}`}\n role={role}\n {...props}\n >\n {({ close }: DialogRenderProps) => (\n <>\n <div className=\"bcds-react-aria-AlertDialog--Header\">\n {!isIconHidden && (\n <div className=\"bcds-react-aria-AlertDialog--Icon\">\n {getIcon(variant)}\n </div>\n )}\n {title && (\n <
|
|
1
|
+
{"version":3,"file":"AlertDialog2.cjs","names":["SvgInfoIcon","SvgCheckCircleIcon","SvgExclamationIcon","SvgExclamationCircleIcon","ReactAriaDialog","_Fragment","Heading","Button","SvgCloseIcon","ButtonGroup"],"sources":["../../../../src/components/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n Dialog as ReactAriaDialog,\n DialogTrigger,\n Heading,\n DialogProps as ReactAriaDialogProps,\n} from \"react-aria-components\";\n\nimport Button from \"../Button\";\nimport ButtonGroup from \"../ButtonGroup\";\nimport { DialogRenderProps } from \"../Dialog/Dialog\";\nimport SvgCheckCircleIcon from \"../Icons/SvgCheckCircleIcon\";\nimport SvgCloseIcon from \"../Icons/SvgCloseIcon\";\nimport SvgExclamationCircleIcon from \"../Icons/SvgExclamationCircleIcon\";\nimport SvgExclamationIcon from \"../Icons/SvgExclamationIcon\";\nimport SvgInfoIcon from \"../Icons/SvgInfoIcon\";\n\nimport \"./AlertDialog.css\";\n\nexport interface AlertDialogProps extends ReactAriaDialogProps {\n /* Dialog theme */\n variant?: \"info\" | \"confirmation\" | \"warning\" | \"error\" | \"destructive\";\n /* Dialog title */\n title?: string;\n /* Show or hide left icon */\n isIconHidden?: boolean;\n /* Show or hide close button */\n isCloseable?: boolean;\n /* Array of Button components */\n buttons?: React.ReactNode;\n}\n\n/* Sets correct left icon for selected variant */\nfunction getIcon(variant: string) {\n switch (variant) {\n case \"info\":\n return <SvgInfoIcon />;\n case \"confirmation\":\n return <SvgCheckCircleIcon />;\n case \"warning\":\n return <SvgExclamationIcon />;\n case \"error\":\n return <SvgExclamationCircleIcon />;\n case \"destructive\":\n return <SvgExclamationCircleIcon />;\n default:\n return;\n }\n}\n\nexport default function AlertDialog({\n children,\n variant = \"info\",\n role = \"dialog\",\n title,\n isCloseable = true,\n isIconHidden = false,\n buttons,\n ...props\n}: AlertDialogProps): JSX.Element {\n return (\n <ReactAriaDialog\n className={`bcds-react-aria-AlertDialog ${variant}`}\n role={role}\n {...props}\n >\n {({ close }: DialogRenderProps) => (\n <>\n <div className=\"bcds-react-aria-AlertDialog--Header\">\n {!isIconHidden && (\n <div className=\"bcds-react-aria-AlertDialog--Icon\">\n {getIcon(variant)}\n </div>\n )}\n {title && (\n <Heading\n className=\"bcds-react-aria-AlertDialog--Title\"\n slot=\"title\"\n >\n {title}\n </Heading>\n )}\n {isCloseable && (\n <div className=\"bcds-react-aria-AlertDialog--closeIcon\">\n <Button\n variant=\"tertiary\"\n isIconButton\n size=\"small\"\n aria-label=\"Close\"\n type=\"button\"\n onPress={close}\n >\n <SvgCloseIcon />\n </Button>\n </div>\n )}\n </div>\n {children && (\n <div\n className=\"bcds-react-aria-AlertDialog--children\"\n slot=\"children\"\n >\n <>{children}</>\n </div>\n )}\n {buttons && (\n <ButtonGroup alignment=\"end\" orientation=\"horizontal\">\n {buttons}\n </ButtonGroup>\n )}\n </>\n )}\n </ReactAriaDialog>\n );\n}\n\nexport { DialogTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,SAAS,QAAQ,SAAiB;CAChC,QAAQ,SAAR;EACE,KAAK,QACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,SAAD,CAAc,CAAA;EACvB,KAAK,gBACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAqB,CAAA;EAC9B,KAAK,WACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAqB,CAAA;EAC9B,KAAK,SACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,iCAAAA,SAAD,CAA2B,CAAA;EACpC,KAAK,eACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,iCAAAA,SAAD,CAA2B,CAAA;EACpC,SACE;CACJ;AACF;AAEA,SAAwB,YAAY,EAClC,UACA,UAAU,QACV,OAAO,UACP,OACA,cAAc,MACd,eAAe,OACf,SACA,GAAG,SAC6B;CAChC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,QAAD;EACE,WAAW,+BAA+B;EACpC;EACN,GAAI;EAEF,WAAA,EAAE,YACF,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA;GACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACG,CAAC,gBACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MACZ,UAAA,QAAQ,OAAO;KACb,CAAA;KAEN,SACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,SAAD;MACE,WAAU;MACV,MAAK;MAEJ,UAAA;KACM,CAAA;KAEV,eACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;MAAK,WAAU;MACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,SAAD;OACE,SAAQ;OACR,cAAA;OACA,MAAK;OACL,cAAW;OACX,MAAK;OACL,SAAS;OAET,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,SAAD,CAAe,CAAA;MACT,CAAA;KACL,CAAA;IAEJ;;GACJ,YACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAU;IACV,MAAK;IAEL,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAAH,kBAAAA,UAAA,EAAG,SAAW,CAAA;GACX,CAAA;GAEN,WACC,iBAAA,GAAA,kBAAA,IAAA,CAACI,oBAAAA,SAAD;IAAa,WAAU;IAAM,aAAY;IACtC,UAAA;GACU,CAAA;EAEf,EAAA,CAAA;CAEW,CAAA;AAErB"}
|
|
@@ -8,6 +8,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
function RadioGroup({ orientation = "vertical", label, description, children, errorMessage, flexWrap = "nowrap", ...props }) {
|
|
9
9
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.RadioGroup, {
|
|
10
10
|
className: "bcds-react-aria-RadioGroup",
|
|
11
|
+
orientation,
|
|
11
12
|
...props,
|
|
12
13
|
children: ({ isRequired, isInvalid }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
13
14
|
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components.Label, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup2.cjs","names":["ReactAriaRadioGroup","_Fragment","Label","Text","SvgExclamationIcon","FieldError"],"sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n RadioGroup as ReactAriaRadioGroup,\n RadioGroupProps as ReactAriaRadioGroupProps,\n RadioGroupRenderProps,\n FieldError,\n Label,\n Text,\n ValidationResult,\n} from \"react-aria-components\";\n\nimport SvgExclamationIcon from \"../Icons/SvgExclamationIcon\";\n\nimport \"./RadioGroup.css\";\n\nexport interface RadioGroupProps extends ReactAriaRadioGroupProps {\n children?: React.ReactNode;\n /* Group
|
|
1
|
+
{"version":3,"file":"RadioGroup2.cjs","names":["ReactAriaRadioGroup","_Fragment","Label","Text","SvgExclamationIcon","FieldError"],"sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n RadioGroup as ReactAriaRadioGroup,\n RadioGroupProps as ReactAriaRadioGroupProps,\n RadioGroupRenderProps,\n FieldError,\n Label,\n Text,\n ValidationResult,\n} from \"react-aria-components\";\n\nimport SvgExclamationIcon from \"../Icons/SvgExclamationIcon\";\n\nimport \"./RadioGroup.css\";\n\nexport interface RadioGroupProps extends ReactAriaRadioGroupProps {\n children?: React.ReactNode;\n /* Group label */\n label?: string;\n /* Group description */\n description?: string;\n /* Error message */\n errorMessage?: string | ((validation: ValidationResult) => string);\n /** `flex-wrap` style property, defaults to `nowrap` */\n flexWrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n}\n\nexport default function RadioGroup({\n orientation = \"vertical\",\n label,\n description,\n children,\n errorMessage,\n flexWrap = \"nowrap\",\n ...props\n}: RadioGroupProps): JSX.Element {\n return (\n <ReactAriaRadioGroup\n className=\"bcds-react-aria-RadioGroup\"\n orientation={orientation}\n {...props}\n >\n {({ isRequired, isInvalid }: RadioGroupRenderProps) => (\n <>\n {label && (\n <Label className=\"bcds-react-aria-RadioGroup--label\">\n {label} {isRequired && \"(required)\"}\n </Label>\n )}\n <div\n className={`bcds-react-aria-RadioGroup--options ${orientation} flex-wrap-${flexWrap}`}\n >\n {children}\n </div>\n {description && (\n <Text\n slot=\"description\"\n className=\"bcds-react-aria-RadioGroup--description\"\n >\n {description}\n </Text>\n )}\n {isInvalid && (\n <div className=\"bcds-react-aria-RadioGroup--error\">\n <SvgExclamationIcon />\n <FieldError>{errorMessage}</FieldError>\n </div>\n )}\n </>\n )}\n </ReactAriaRadioGroup>\n );\n}\n"],"mappings":";;;;;;;AA2BA,SAAwB,WAAW,EACjC,cAAc,YACd,OACA,aACA,UACA,cACA,WAAW,UACX,GAAG,SAC4B;CAC/B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,sBAAAA,YAAD;EACE,WAAU;EACG;EACb,GAAI;EAEF,WAAA,EAAE,YAAY,gBACd,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA;GACG,SACC,iBAAA,GAAA,kBAAA,KAAA,CAACC,sBAAAA,OAAD;IAAO,WAAU;IAAjB,UAAA;KACG;KAAM;KAAE,cAAc;IAClB;;GAET,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAW,uCAAuC,YAAY,aAAa;IAE1E;GACE,CAAA;GACJ,eACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,MAAD;IACE,MAAK;IACL,WAAU;IAET,UAAA;GACG,CAAA;GAEP,aACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,SAAD,CAAqB,CAAA,GACrB,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,YAAD,EAAA,UAAa,aAAyB,CAAA,CACnC;;EAEP,EAAA,CAAA;CAEe,CAAA;AAEzB"}
|
|
@@ -16,7 +16,6 @@ function Tag({ color = "blue", tagStyle = "rectangular", size = "small", icon, i
|
|
|
16
16
|
children: textValue
|
|
17
17
|
}),
|
|
18
18
|
!isDisabled && allowsRemoving && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
19
|
-
"aria-label": `Remove ${textValue}`,
|
|
20
19
|
slot: "remove",
|
|
21
20
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
22
21
|
width: "14",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag2.cjs","names":["ReactAriaTag","_Fragment","ReactAriaButton"],"sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n Button as ReactAriaButton,\n Tag as ReactAriaTag,\n TagProps as ReactAriaTagProps,\n TagRenderProps,\n} from \"react-aria-components\";\n\nimport \"./Tag.css\";\n\nexport interface TagProps extends ReactAriaTagProps {\n /**\n * Icon that appears to the left of the `textValue` field\n */\n icon?: React.ReactNode;\n /**\n * Background color\n */\n color?:\n | \"bc-blue\"\n | \"bc-gold\"\n | \"blue\"\n | \"dark\"\n | \"gray\"\n | \"grey\"\n | \"green\"\n | \"red\"\n | \"yellow\";\n /**\n * tagStyle\n */\n tagStyle?: \"rectangular\" | \"circular\";\n /**\n * size\n */\n size?: \"xsmall\" | \"small\" | \"medium\";\n}\n\nexport default function Tag({\n color = \"blue\",\n tagStyle = \"rectangular\",\n size = \"small\",\n icon,\n id,\n textValue,\n ...props\n}: TagProps): JSX.Element {\n return (\n <ReactAriaTag\n className={`bcds-react-aria-Tag ${color} ${tagStyle} ${size}`}\n id={id}\n textValue={textValue}\n {...props}\n >\n {({ allowsRemoving, isDisabled }: TagRenderProps) => (\n <>\n {icon}\n <span className=\"bcds-react-aria-Tag--Label\">{textValue}</span>\n {!isDisabled && allowsRemoving && (\n <ReactAriaButton
|
|
1
|
+
{"version":3,"file":"Tag2.cjs","names":["ReactAriaTag","_Fragment","ReactAriaButton"],"sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import type { JSX } from \"react\";\nimport {\n Button as ReactAriaButton,\n Tag as ReactAriaTag,\n TagProps as ReactAriaTagProps,\n TagRenderProps,\n} from \"react-aria-components\";\n\nimport \"./Tag.css\";\n\nexport interface TagProps extends ReactAriaTagProps {\n /**\n * Icon that appears to the left of the `textValue` field\n */\n icon?: React.ReactNode;\n /**\n * Background color\n */\n color?:\n | \"bc-blue\"\n | \"bc-gold\"\n | \"blue\"\n | \"dark\"\n | \"gray\"\n | \"grey\"\n | \"green\"\n | \"red\"\n | \"yellow\";\n /**\n * tagStyle\n */\n tagStyle?: \"rectangular\" | \"circular\";\n /**\n * size\n */\n size?: \"xsmall\" | \"small\" | \"medium\";\n}\n\nexport default function Tag({\n color = \"blue\",\n tagStyle = \"rectangular\",\n size = \"small\",\n icon,\n id,\n textValue,\n ...props\n}: TagProps): JSX.Element {\n return (\n <ReactAriaTag\n className={`bcds-react-aria-Tag ${color} ${tagStyle} ${size}`}\n id={id}\n textValue={textValue}\n {...props}\n >\n {({ allowsRemoving, isDisabled }: TagRenderProps) => (\n <>\n {icon}\n <span className=\"bcds-react-aria-Tag--Label\">{textValue}</span>\n {!isDisabled && allowsRemoving && (\n <ReactAriaButton slot=\"remove\">\n <svg\n width=\"14\"\n height=\"15\"\n viewBox=\"0 0 14 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Icons / Close\">\n <path\n id=\"Vector\"\n d=\"M12.6004 3.03239L11.4684 1.90039L7.00039 6.36839L2.53239 1.90039L1.40039 3.03239L5.86839 7.50039L1.40039 11.9684L2.53239 13.1004L7.00039 8.63239L11.4684 13.1004L12.6004 11.9684L8.13239 7.50039L12.6004 3.03239Z\"\n fill=\"currentColor\"\n />\n </g>\n </svg>\n </ReactAriaButton>\n )}\n </>\n )}\n </ReactAriaTag>\n );\n}\n"],"mappings":";;;;;AAsCA,SAAwB,IAAI,EAC1B,QAAQ,QACR,WAAW,eACX,OAAO,SACP,MACA,IACA,WACA,GAAG,SACqB;CACxB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,sBAAAA,KAAD;EACE,WAAW,uBAAuB,MAAM,GAAG,SAAS,GAAG;EACnD;EACO;EACX,GAAI;EAEF,WAAA,EAAE,gBAAgB,iBAClB,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA;GACG;GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAU;IAA8B,UAAA;GAAgB,CAAA;GAC7D,CAAC,cAAc,kBACd,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,QAAD;IAAiB,MAAK;IACpB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;KACE,OAAM;KACN,QAAO;KACP,SAAQ;KACR,MAAK;KACL,OAAM;KAEN,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;MAAG,IAAG;MACJ,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;OACE,IAAG;OACH,GAAE;OACF,MAAK;MACN,CAAA;KACA,CAAA;IACA,CAAA;GACU,CAAA;EAEnB,EAAA,CAAA;CAEQ,CAAA;AAElB"}
|