@digigov/react-core 2.0.0-rc.26 → 2.0.0-rc.28

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.
@@ -8,6 +8,15 @@ export interface ErrorSummaryProps extends BaseProps<'div'> {
8
8
  * @default false
9
9
  * */
10
10
  dense?: boolean;
11
+ /**
12
+ * variant is optional.
13
+ * variant error is used to change the color of the NotificationBannerContainer.
14
+ * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.
15
+ * @value 'error'
16
+ * @value 'error-group'
17
+ * @default 'error'.
18
+ */
19
+ variant?: 'error' | 'error-group';
11
20
  }
12
21
  /**
13
22
  * Use this component at the top of a page to summarize any errors a user has made.
@@ -2,17 +2,17 @@ import React from "react";
2
2
  import NotificationBannerContainer from "@digigov/react-core/NotificationBannerContainer";
3
3
  import NotificationBannerContent from "@digigov/react-core/NotificationBannerContent";
4
4
  const ErrorSummary = React.forwardRef(
5
- function ErrorSummary2({ className, dense, children, ...props }, ref) {
5
+ function ErrorSummary2({ className, dense, children, variant = "error", ...props }, ref) {
6
6
  return /* @__PURE__ */ React.createElement(
7
7
  NotificationBannerContainer,
8
8
  {
9
- variant: "error",
9
+ variant,
10
10
  className,
11
11
  ref,
12
12
  dense,
13
13
  ...props
14
14
  },
15
- /* @__PURE__ */ React.createElement(NotificationBannerContent, null, children)
15
+ /* @__PURE__ */ React.createElement(NotificationBannerContent, { variant }, children)
16
16
  );
17
17
  }
18
18
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ErrorSummary/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { BaseProps } from '@digigov/react-core/Base';\nimport NotificationBannerContainer from '@digigov/react-core/NotificationBannerContainer';\nimport NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';\n\nexport interface ErrorSummaryProps extends BaseProps<'div'> {\n /**\n * dense is optional.\n * @value true ErrorSummary will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Use this component at the top of a page to summarize any errors a user has made.\n */\nexport const ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(\n function ErrorSummary({ className, dense, children, ...props }, ref) {\n return (\n <NotificationBannerContainer\n variant={'error'}\n className={className}\n ref={ref}\n dense={dense}\n {...props}\n >\n <NotificationBannerContent>{children}</NotificationBannerContent>\n </NotificationBannerContainer>\n );\n }\n);\n\nexport default ErrorSummary;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAElB,OAAO,iCAAiC;AACxC,OAAO,+BAA+B;AAc/B,MAAM,eAAe,MAAM;AAAA,EAChC,SAASA,cAAa,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,KAAK;AACnE,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,MAEJ,oCAAC,iCAA2B,QAAS;AAAA,IACvC;AAAA,EAEJ;AACF;AAEA,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport { BaseProps } from '@digigov/react-core/Base';\nimport NotificationBannerContainer from '@digigov/react-core/NotificationBannerContainer';\nimport NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';\nexport interface ErrorSummaryProps extends BaseProps<'div'> {\n /**\n * dense is optional.\n * @value true ErrorSummary will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n /**\n * variant is optional.\n * variant error is used to change the color of the NotificationBannerContainer.\n * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n variant?: 'error' | 'error-group';\n}\n/**\n * Use this component at the top of a page to summarize any errors a user has made.\n */\nexport const ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(\n function ErrorSummary(\n { className, dense, children, variant = 'error', ...props },\n ref\n ) {\n return (\n <NotificationBannerContainer\n variant={variant}\n className={className}\n ref={ref}\n dense={dense}\n {...props}\n >\n <NotificationBannerContent variant={variant}>\n {children}\n </NotificationBannerContent>\n </NotificationBannerContainer>\n );\n }\n);\n\nexport default ErrorSummary;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAElB,OAAO,iCAAiC;AACxC,OAAO,+BAA+B;AAsB/B,MAAM,eAAe,MAAM;AAAA,EAChC,SAASA,cACP,EAAE,WAAW,OAAO,UAAU,UAAU,SAAS,GAAG,MAAM,GAC1D,KACA;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,MAEJ,oCAAC,6BAA0B,WACxB,QACH;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAO,uBAAQ;",
6
6
  "names": ["ErrorSummary"]
7
7
  }
@@ -7,9 +7,10 @@ export interface NotificationBannerContainerProps extends BaseProps<'div'> {
7
7
  * @value 'info'
8
8
  * @value 'success'
9
9
  * @value 'error'
10
+ * @value 'error-group'
10
11
  * @default 'info'.
11
12
  */
12
- variant?: 'info' | 'success' | 'error';
13
+ variant?: 'info' | 'success' | 'error' | 'error-group';
13
14
  /**
14
15
  * dense is optional.
15
16
  * @value true NotificationBannerContainer will be dense.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/NotificationBannerContainer/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContainerProps extends BaseProps<'div'> {\n /**\n * variant is optional.\n * variant is used to change the color of the NotificationBannerContainer.\n * @value 'info'\n * @value 'success'\n * @value 'error'\n * @default 'info'.\n */\n variant?: 'info' | 'success' | 'error';\n /**\n * dense is optional.\n * @value true NotificationBannerContainer will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Details for the NotificationBannerContainer.\n * NotificationBannerContainer component informs users about something they need to know about\n * NotificationBannerContainer component must be placed at the top of the page.\n * NotificationBannerContainer wraps NotificationBannerContainerHeader, NotificationBannerContainerContent,NotificationBannerContainerHeading\n * and NotificationBannerContainerLink components as children\n */\nexport const NotificationBannerContainer = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContainerProps\n>(function NotificationBannerContainer(\n { variant = 'info', className, dense, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n role=\"region\"\n aria-labelledby=\"ds-notification-banner-title\"\n data-module=\"ds-notification-banner\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner': true,\n [`ds-notification-banner--${variant}`]: variant !== undefined,\n 'ds-notification-banner--dense': dense,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContainer;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AA2BzB,MAAM,8BAA8B,MAAM,WAG/C,SAASA,6BACT,EAAE,UAAU,QAAQ,WAAW,OAAO,UAAU,GAAG,MAAM,GACzD,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,mBAAgB;AAAA,MAChB,eAAY;AAAA,MACZ;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,0BAA0B;AAAA,QAC1B,CAAC,2BAA2B,OAAO,EAAE,GAAG,YAAY;AAAA,QACpD,iCAAiC;AAAA,MACnC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,sCAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContainerProps extends BaseProps<'div'> {\n /**\n * variant is optional.\n * variant is used to change the color of the NotificationBannerContainer.\n * @value 'info'\n * @value 'success'\n * @value 'error'\n * @value 'error-group'\n * @default 'info'.\n */\n variant?: 'info' | 'success' | 'error' | 'error-group';\n /**\n * dense is optional.\n * @value true NotificationBannerContainer will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Details for the NotificationBannerContainer.\n * NotificationBannerContainer component informs users about something they need to know about\n * NotificationBannerContainer component must be placed at the top of the page.\n * NotificationBannerContainer wraps NotificationBannerContainerHeader, NotificationBannerContainerContent,NotificationBannerContainerHeading\n * and NotificationBannerContainerLink components as children\n */\nexport const NotificationBannerContainer = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContainerProps\n>(function NotificationBannerContainer(\n { variant = 'info', className, dense, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n role=\"region\"\n aria-labelledby=\"ds-notification-banner-title\"\n data-module=\"ds-notification-banner\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner': true,\n [`ds-notification-banner--${variant}`]: variant !== undefined,\n 'ds-notification-banner--dense': dense,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContainer;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AA4BzB,MAAM,8BAA8B,MAAM,WAG/C,SAASA,6BACT,EAAE,UAAU,QAAQ,WAAW,OAAO,UAAU,GAAG,MAAM,GACzD,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,mBAAgB;AAAA,MAChB,eAAY;AAAA,MACZ;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,0BAA0B;AAAA,QAC1B,CAAC,2BAA2B,OAAO,EAAE,GAAG,YAAY;AAAA,QACpD,iCAAiC;AAAA,MACnC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,sCAAQ;",
6
6
  "names": ["NotificationBannerContainer"]
7
7
  }
@@ -1,6 +1,28 @@
1
1
  import React from 'react';
2
2
  import { BaseProps } from '@digigov/react-core/Base';
3
3
  export interface NotificationBannerContentProps extends BaseProps<'div'> {
4
+ /**
5
+ * assistiveText is optional.
6
+ * Default value is "Προσοχή".
7
+ * assistiveText is used to provide a textual warning for assistive technologies like screen readers.
8
+ */
9
+ assistiveText?: string;
10
+ /**
11
+ * variant is optional.
12
+ * variant is used to display red line on the left side of the component and exclamation mark icon with light red as background.
13
+ * @value 'error'
14
+ * @value 'error-group'
15
+ * @default 'error'.
16
+ */
17
+ /**
18
+ * variant is optional.
19
+ * variant error is used to change the color of the NotificationBannerContainer.
20
+ * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.
21
+ * @value 'error'
22
+ * @value 'error-group'
23
+ * @default 'error'.
24
+ */
25
+ variant?: 'error' | 'error-group';
4
26
  }
5
27
  /**
6
28
  * Details for the NotificationBannerContent.
@@ -1,18 +1,29 @@
1
1
  import React from "react";
2
2
  import clsx from "clsx";
3
3
  import Base from "@digigov/react-core/Base";
4
- const NotificationBannerContent = React.forwardRef(function NotificationBannerContent2({ className, children, ...props }, ref) {
4
+ import { WarningTextAssistive } from "@digigov/react-core/WarningTextAssistive";
5
+ const NotificationBannerContent = React.forwardRef(function NotificationBannerContent2({ className, assistiveText, variant, children, ...props }, ref) {
5
6
  return /* @__PURE__ */ React.createElement(
6
7
  Base,
7
8
  {
8
9
  as: "div",
9
10
  ref,
10
11
  className: clsx(className, {
11
- "ds-notification-banner__content": true
12
+ "ds-notification-banner__content": variant !== "error-group",
13
+ "ds-notification-error-group-banner__content": variant === "error-group"
12
14
  }),
13
15
  ...props
14
16
  },
15
- children
17
+ variant === "error-group" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
18
+ Base,
19
+ {
20
+ as: "div",
21
+ className: clsx({
22
+ "ds-notification-banner__icon--error-group": true
23
+ })
24
+ },
25
+ "!"
26
+ ), /* @__PURE__ */ React.createElement(WarningTextAssistive, null, assistiveText), /* @__PURE__ */ React.createElement(Base, { as: "div", className: "ds-notification-banner__text-error-group" }, children)) : /* @__PURE__ */ React.createElement(React.Fragment, null, children)
16
27
  );
17
28
  });
18
29
  var NotificationBannerContent_default = NotificationBannerContent;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/NotificationBannerContent/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContentProps extends BaseProps<'div'> {}\n/**\n * Details for the NotificationBannerContent.\n * NotificationBannerContent component is used as a content for\n * NotificationBannerHeading and NotificationBannerLink components.\n * NotificationBannerContent component must be used inside NotificationBanner component as children.\n */\nexport const NotificationBannerContent = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContentProps\n>(function NotificationBannerContent({ className, children, ...props }, ref) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner__content': true,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContent;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AASzB,MAAM,4BAA4B,MAAM,WAG7C,SAASA,2BAA0B,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,KAAK;AAC3E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,mCAAmC;AAAA,MACrC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,oCAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { WarningTextAssistive } from '@digigov/react-core/WarningTextAssistive';\n\nexport interface NotificationBannerContentProps extends BaseProps<'div'> {\n /**\n * assistiveText is optional.\n * Default value is \"\u03A0\u03C1\u03BF\u03C3\u03BF\u03C7\u03AE\".\n * assistiveText is used to provide a textual warning for assistive technologies like screen readers.\n */\n assistiveText?: string;\n /**\n * variant is optional.\n * variant is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n /**\n * variant is optional.\n * variant error is used to change the color of the NotificationBannerContainer.\n * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n variant?: 'error' | 'error-group';\n}\n/**\n * Details for the NotificationBannerContent.\n * NotificationBannerContent component is used as a content for\n * NotificationBannerHeading and NotificationBannerLink components.\n * NotificationBannerContent component must be used inside NotificationBanner component as children.\n */\nexport const NotificationBannerContent = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContentProps\n>(function NotificationBannerContent(\n { className, assistiveText, variant, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner__content': variant !== 'error-group',\n 'ds-notification-error-group-banner__content':\n variant === 'error-group',\n })}\n {...props}\n >\n {variant === 'error-group' ? (\n <>\n <Base\n as=\"div\"\n className={clsx({\n 'ds-notification-banner__icon--error-group': true,\n })}\n >\n !\n </Base>\n <WarningTextAssistive>{assistiveText}</WarningTextAssistive>\n <Base as=\"div\" className=\"ds-notification-banner__text-error-group\">\n {children}\n </Base>\n </>\n ) : (\n <>{children}</>\n )}\n </Base>\n );\n});\n\nexport default NotificationBannerContent;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAChC,SAAS,4BAA4B;AAgC9B,MAAM,4BAA4B,MAAM,WAG7C,SAASA,2BACT,EAAE,WAAW,eAAe,SAAS,UAAU,GAAG,MAAM,GACxD,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,mCAAmC,YAAY;AAAA,QAC/C,+CACE,YAAY;AAAA,MAChB,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH,YAAY,gBACX,0DACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH,WAAW,KAAK;AAAA,UACd,6CAA6C;AAAA,QAC/C,CAAC;AAAA;AAAA,MACF;AAAA,IAED,GACA,oCAAC,4BAAsB,aAAc,GACrC,oCAAC,QAAK,IAAG,OAAM,WAAU,8CACtB,QACH,CACF,IAEA,0DAAG,QAAS;AAAA,EAEhB;AAEJ,CAAC;AAED,IAAO,oCAAQ;",
6
6
  "names": ["NotificationBannerContent"]
7
7
  }
package/Skeleton/index.js CHANGED
@@ -34,8 +34,9 @@ const Skeleton = React.forwardRef(
34
34
  }
35
35
  },
36
36
  variant === "button" && /* @__PURE__ */ React.createElement(
37
- "span",
37
+ Base,
38
38
  {
39
+ as: "span",
39
40
  className: clsx({
40
41
  "ds-skeleton__line": true,
41
42
  "ds-skeleton__line--size-default": width === void 0 && height === void 0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Skeleton/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface SkeletonProps extends BaseProps<'span'> {\n /**\n * variant prop determines the style of the skeleton element.\n * @value 'circular', it renders a circular skeleton.\n * @value 'rectangular', it renders a rectangular skeleton.\n * @value 'text', it renders a text skeleton.\n * @value 'button', it renders a button skeleton.\n * @default 'text'\n */\n variant?: 'circular' | 'rectangular' | 'text' | 'button';\n\n /**\n * width prop determines the width of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * For better responsive experience, avoid using px and use percentage instead.\n * @default undefined\n */\n width?: number | string;\n\n /**\n * height prop determines the height of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * @default undefined\n */\n height?: number | string;\n\n /**\n * fontSize is optional. 'sm' is the default value.\n * Use 'xl' when this Skeleton is for a main page title.\n * The fontSize works only for variant 'text'.\n * You don't need fontSize if you wrap Skeleton in a typography component.\n * @value 'xl'\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @value 'xs'\n * @default 'sm'\n */\n fontSize?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';\n /**\n * animation prop determines if the skeleton should animate or not.\n * @default true\n */\n animation?: boolean;\n}\n/**\n * Use Skeleton component while a page is loading.\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n width,\n height,\n fontSize,\n variant = 'text',\n animation = true,\n className,\n children,\n style,\n ...props\n },\n ref\n ) {\n return (\n <Base\n as=\"span\"\n ref={ref}\n className={clsx(className, {\n 'ds-skeleton': true,\n [`ds-skeleton--font-${fontSize}`]:\n fontSize !== undefined && variant === 'text',\n [`ds-skeleton--${variant}`]:\n !!variant && (!children || typeof children === 'string'),\n 'ds-skeleton--animate': !!animation,\n 'ds-skeleton--width-fit-content': !!children && !width,\n })}\n {...props}\n style={{\n width:\n typeof children === 'string'\n ? Math.ceil(children.length * 0.5) + 'em'\n : width,\n maxWidth: width ? '100%' : undefined,\n height: height,\n ...style,\n }}\n >\n {variant === 'button' && (\n <span\n className={clsx({\n 'ds-skeleton__line': true,\n 'ds-skeleton__line--size-default':\n width === undefined && height === undefined,\n })}\n ></span>\n )}\n {typeof children != 'string' && children}\n </Base>\n );\n }\n);\n\nexport default Skeleton;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAkDzB,MAAM,WAAW,MAAM;AAAA,EAC5B,SAASA,UACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,KACA;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,WAAW,KAAK,WAAW;AAAA,UACzB,eAAe;AAAA,UACf,CAAC,qBAAqB,QAAQ,EAAE,GAC9B,aAAa,UAAa,YAAY;AAAA,UACxC,CAAC,gBAAgB,OAAO,EAAE,GACxB,CAAC,CAAC,YAAY,CAAC,YAAY,OAAO,aAAa;AAAA,UACjD,wBAAwB,CAAC,CAAC;AAAA,UAC1B,kCAAkC,CAAC,CAAC,YAAY,CAAC;AAAA,QACnD,CAAC;AAAA,QACA,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,OACE,OAAO,aAAa,WAChB,KAAK,KAAK,SAAS,SAAS,GAAG,IAAI,OACnC;AAAA,UACN,UAAU,QAAQ,SAAS;AAAA,UAC3B;AAAA,UACA,GAAG;AAAA,QACL;AAAA;AAAA,MAEC,YAAY,YACX;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,KAAK;AAAA,YACd,qBAAqB;AAAA,YACrB,mCACE,UAAU,UAAa,WAAW;AAAA,UACtC,CAAC;AAAA;AAAA,MACF;AAAA,MAEF,OAAO,YAAY,YAAY;AAAA,IAClC;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface SkeletonProps extends BaseProps<'span'> {\n /**\n * variant prop determines the style of the skeleton element.\n * @value 'circular', it renders a circular skeleton.\n * @value 'rectangular', it renders a rectangular skeleton.\n * @value 'text', it renders a text skeleton.\n * @value 'button', it renders a button skeleton.\n * @default 'text'\n */\n variant?: 'circular' | 'rectangular' | 'text' | 'button';\n\n /**\n * width prop determines the width of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * For better responsive experience, avoid using px and use percentage instead.\n * @default undefined\n */\n width?: number | string;\n\n /**\n * height prop determines the height of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * @default undefined\n */\n height?: number | string;\n\n /**\n * fontSize is optional. 'sm' is the default value.\n * Use 'xl' when this Skeleton is for a main page title.\n * The fontSize works only for variant 'text'.\n * You don't need fontSize if you wrap Skeleton in a typography component.\n * @value 'xl'\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @value 'xs'\n * @default 'sm'\n */\n fontSize?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';\n /**\n * animation prop determines if the skeleton should animate or not.\n * @default true\n */\n animation?: boolean;\n}\n/**\n * Use Skeleton component while a page is loading.\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n width,\n height,\n fontSize,\n variant = 'text',\n animation = true,\n className,\n children,\n style,\n ...props\n },\n ref\n ) {\n return (\n <Base\n as=\"span\"\n ref={ref}\n className={clsx(className, {\n 'ds-skeleton': true,\n [`ds-skeleton--font-${fontSize}`]:\n fontSize !== undefined && variant === 'text',\n [`ds-skeleton--${variant}`]:\n !!variant && (!children || typeof children === 'string'),\n 'ds-skeleton--animate': !!animation,\n 'ds-skeleton--width-fit-content': !!children && !width,\n })}\n {...props}\n style={{\n width:\n typeof children === 'string'\n ? Math.ceil(children.length * 0.5) + 'em'\n : width,\n maxWidth: width ? '100%' : undefined,\n height: height,\n ...style,\n }}\n >\n {variant === 'button' && (\n <Base\n as=\"span\"\n className={clsx({\n 'ds-skeleton__line': true,\n 'ds-skeleton__line--size-default':\n width === undefined && height === undefined,\n })}\n ></Base>\n )}\n {typeof children != 'string' && children}\n </Base>\n );\n }\n);\n\nexport default Skeleton;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAkDzB,MAAM,WAAW,MAAM;AAAA,EAC5B,SAASA,UACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,KACA;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,WAAW,KAAK,WAAW;AAAA,UACzB,eAAe;AAAA,UACf,CAAC,qBAAqB,QAAQ,EAAE,GAC9B,aAAa,UAAa,YAAY;AAAA,UACxC,CAAC,gBAAgB,OAAO,EAAE,GACxB,CAAC,CAAC,YAAY,CAAC,YAAY,OAAO,aAAa;AAAA,UACjD,wBAAwB,CAAC,CAAC;AAAA,UAC1B,kCAAkC,CAAC,CAAC,YAAY,CAAC;AAAA,QACnD,CAAC;AAAA,QACA,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,OACE,OAAO,aAAa,WAChB,KAAK,KAAK,SAAS,SAAS,GAAG,IAAI,OACnC;AAAA,UACN,UAAU,QAAQ,SAAS;AAAA,UAC3B;AAAA,UACA,GAAG;AAAA,QACL;AAAA;AAAA,MAEC,YAAY,YACX;AAAA,QAAC;AAAA;AAAA,UACC,IAAG;AAAA,UACH,WAAW,KAAK;AAAA,YACd,qBAAqB;AAAA,YACrB,mCACE,UAAU,UAAa,WAAW;AAAA,UACtC,CAAC;AAAA;AAAA,MACF;AAAA,MAEF,OAAO,YAAY,YAAY;AAAA,IAClC;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ;",
6
6
  "names": ["Skeleton"]
7
7
  }
@@ -35,17 +35,17 @@ var import_react = __toESM(require("react"));
35
35
  var import_NotificationBannerContainer = __toESM(require("@digigov/react-core/NotificationBannerContainer"));
36
36
  var import_NotificationBannerContent = __toESM(require("@digigov/react-core/NotificationBannerContent"));
37
37
  const ErrorSummary = import_react.default.forwardRef(
38
- function ErrorSummary2({ className, dense, children, ...props }, ref) {
38
+ function ErrorSummary2({ className, dense, children, variant = "error", ...props }, ref) {
39
39
  return /* @__PURE__ */ import_react.default.createElement(
40
40
  import_NotificationBannerContainer.default,
41
41
  {
42
- variant: "error",
42
+ variant,
43
43
  className,
44
44
  ref,
45
45
  dense,
46
46
  ...props
47
47
  },
48
- /* @__PURE__ */ import_react.default.createElement(import_NotificationBannerContent.default, null, children)
48
+ /* @__PURE__ */ import_react.default.createElement(import_NotificationBannerContent.default, { variant }, children)
49
49
  );
50
50
  }
51
51
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ErrorSummary/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { BaseProps } from '@digigov/react-core/Base';\nimport NotificationBannerContainer from '@digigov/react-core/NotificationBannerContainer';\nimport NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';\n\nexport interface ErrorSummaryProps extends BaseProps<'div'> {\n /**\n * dense is optional.\n * @value true ErrorSummary will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Use this component at the top of a page to summarize any errors a user has made.\n */\nexport const ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(\n function ErrorSummary({ className, dense, children, ...props }, ref) {\n return (\n <NotificationBannerContainer\n variant={'error'}\n className={className}\n ref={ref}\n dense={dense}\n {...props}\n >\n <NotificationBannerContent>{children}</NotificationBannerContent>\n </NotificationBannerContainer>\n );\n }\n);\n\nexport default ErrorSummary;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,yCAAwC;AACxC,uCAAsC;AAc/B,MAAM,eAAe,aAAAA,QAAM;AAAA,EAChC,SAASC,cAAa,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,KAAK;AACnE,WACE,6BAAAD,QAAA;AAAA,MAAC,mCAAAE;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,MAEJ,6BAAAF,QAAA,cAAC,iCAAAG,SAAA,MAA2B,QAAS;AAAA,IACvC;AAAA,EAEJ;AACF;AAEA,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport { BaseProps } from '@digigov/react-core/Base';\nimport NotificationBannerContainer from '@digigov/react-core/NotificationBannerContainer';\nimport NotificationBannerContent from '@digigov/react-core/NotificationBannerContent';\nexport interface ErrorSummaryProps extends BaseProps<'div'> {\n /**\n * dense is optional.\n * @value true ErrorSummary will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n /**\n * variant is optional.\n * variant error is used to change the color of the NotificationBannerContainer.\n * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n variant?: 'error' | 'error-group';\n}\n/**\n * Use this component at the top of a page to summarize any errors a user has made.\n */\nexport const ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(\n function ErrorSummary(\n { className, dense, children, variant = 'error', ...props },\n ref\n ) {\n return (\n <NotificationBannerContainer\n variant={variant}\n className={className}\n ref={ref}\n dense={dense}\n {...props}\n >\n <NotificationBannerContent variant={variant}>\n {children}\n </NotificationBannerContent>\n </NotificationBannerContainer>\n );\n }\n);\n\nexport default ErrorSummary;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,yCAAwC;AACxC,uCAAsC;AAsB/B,MAAM,eAAe,aAAAA,QAAM;AAAA,EAChC,SAASC,cACP,EAAE,WAAW,OAAO,UAAU,UAAU,SAAS,GAAG,MAAM,GAC1D,KACA;AACA,WACE,6BAAAD,QAAA;AAAA,MAAC,mCAAAE;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,MAEJ,6BAAAF,QAAA,cAAC,iCAAAG,SAAA,EAA0B,WACxB,QACH;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,IAAO,uBAAQ;",
6
6
  "names": ["React", "ErrorSummary", "NotificationBannerContainer", "NotificationBannerContent"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/NotificationBannerContainer/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContainerProps extends BaseProps<'div'> {\n /**\n * variant is optional.\n * variant is used to change the color of the NotificationBannerContainer.\n * @value 'info'\n * @value 'success'\n * @value 'error'\n * @default 'info'.\n */\n variant?: 'info' | 'success' | 'error';\n /**\n * dense is optional.\n * @value true NotificationBannerContainer will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Details for the NotificationBannerContainer.\n * NotificationBannerContainer component informs users about something they need to know about\n * NotificationBannerContainer component must be placed at the top of the page.\n * NotificationBannerContainer wraps NotificationBannerContainerHeader, NotificationBannerContainerContent,NotificationBannerContainerHeading\n * and NotificationBannerContainerLink components as children\n */\nexport const NotificationBannerContainer = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContainerProps\n>(function NotificationBannerContainer(\n { variant = 'info', className, dense, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n role=\"region\"\n aria-labelledby=\"ds-notification-banner-title\"\n data-module=\"ds-notification-banner\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner': true,\n [`ds-notification-banner--${variant}`]: variant !== undefined,\n 'ds-notification-banner--dense': dense,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContainer;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AA2BzB,MAAM,8BAA8B,aAAAA,QAAM,WAG/C,SAASC,6BACT,EAAE,UAAU,QAAQ,WAAW,OAAO,UAAU,GAAG,MAAM,GACzD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,mBAAgB;AAAA,MAChB,eAAY;AAAA,MACZ;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,0BAA0B;AAAA,QAC1B,CAAC,2BAA2B,OAAO,EAAE,GAAG,YAAY;AAAA,QACpD,iCAAiC;AAAA,MACnC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,sCAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContainerProps extends BaseProps<'div'> {\n /**\n * variant is optional.\n * variant is used to change the color of the NotificationBannerContainer.\n * @value 'info'\n * @value 'success'\n * @value 'error'\n * @value 'error-group'\n * @default 'info'.\n */\n variant?: 'info' | 'success' | 'error' | 'error-group';\n /**\n * dense is optional.\n * @value true NotificationBannerContainer will be dense.\n * @value false\n * @default false\n * */\n dense?: boolean;\n}\n/**\n * Details for the NotificationBannerContainer.\n * NotificationBannerContainer component informs users about something they need to know about\n * NotificationBannerContainer component must be placed at the top of the page.\n * NotificationBannerContainer wraps NotificationBannerContainerHeader, NotificationBannerContainerContent,NotificationBannerContainerHeading\n * and NotificationBannerContainerLink components as children\n */\nexport const NotificationBannerContainer = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContainerProps\n>(function NotificationBannerContainer(\n { variant = 'info', className, dense, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n role=\"region\"\n aria-labelledby=\"ds-notification-banner-title\"\n data-module=\"ds-notification-banner\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner': true,\n [`ds-notification-banner--${variant}`]: variant !== undefined,\n 'ds-notification-banner--dense': dense,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AA4BzB,MAAM,8BAA8B,aAAAA,QAAM,WAG/C,SAASC,6BACT,EAAE,UAAU,QAAQ,WAAW,OAAO,UAAU,GAAG,MAAM,GACzD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,mBAAgB;AAAA,MAChB,eAAY;AAAA,MACZ;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,0BAA0B;AAAA,QAC1B,CAAC,2BAA2B,OAAO,EAAE,GAAG,YAAY;AAAA,QACpD,iCAAiC;AAAA,MACnC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,sCAAQ;",
6
6
  "names": ["React", "NotificationBannerContainer", "Base", "clsx"]
7
7
  }
@@ -34,18 +34,29 @@ module.exports = __toCommonJS(NotificationBannerContent_exports);
34
34
  var import_react = __toESM(require("react"));
35
35
  var import_clsx = __toESM(require("clsx"));
36
36
  var import_Base = __toESM(require("@digigov/react-core/Base"));
37
- const NotificationBannerContent = import_react.default.forwardRef(function NotificationBannerContent2({ className, children, ...props }, ref) {
37
+ var import_WarningTextAssistive = require("@digigov/react-core/WarningTextAssistive");
38
+ const NotificationBannerContent = import_react.default.forwardRef(function NotificationBannerContent2({ className, assistiveText, variant, children, ...props }, ref) {
38
39
  return /* @__PURE__ */ import_react.default.createElement(
39
40
  import_Base.default,
40
41
  {
41
42
  as: "div",
42
43
  ref,
43
44
  className: (0, import_clsx.default)(className, {
44
- "ds-notification-banner__content": true
45
+ "ds-notification-banner__content": variant !== "error-group",
46
+ "ds-notification-error-group-banner__content": variant === "error-group"
45
47
  }),
46
48
  ...props
47
49
  },
48
- children
50
+ variant === "error-group" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
51
+ import_Base.default,
52
+ {
53
+ as: "div",
54
+ className: (0, import_clsx.default)({
55
+ "ds-notification-banner__icon--error-group": true
56
+ })
57
+ },
58
+ "!"
59
+ ), /* @__PURE__ */ import_react.default.createElement(import_WarningTextAssistive.WarningTextAssistive, null, assistiveText), /* @__PURE__ */ import_react.default.createElement(import_Base.default, { as: "div", className: "ds-notification-banner__text-error-group" }, children)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children)
49
60
  );
50
61
  });
51
62
  var NotificationBannerContent_default = NotificationBannerContent;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/NotificationBannerContent/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface NotificationBannerContentProps extends BaseProps<'div'> {}\n/**\n * Details for the NotificationBannerContent.\n * NotificationBannerContent component is used as a content for\n * NotificationBannerHeading and NotificationBannerLink components.\n * NotificationBannerContent component must be used inside NotificationBanner component as children.\n */\nexport const NotificationBannerContent = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContentProps\n>(function NotificationBannerContent({ className, children, ...props }, ref) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner__content': true,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default NotificationBannerContent;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AASzB,MAAM,4BAA4B,aAAAA,QAAM,WAG7C,SAASC,2BAA0B,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,KAAK;AAC3E,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,mCAAmC;AAAA,MACrC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,oCAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\nimport { WarningTextAssistive } from '@digigov/react-core/WarningTextAssistive';\n\nexport interface NotificationBannerContentProps extends BaseProps<'div'> {\n /**\n * assistiveText is optional.\n * Default value is \"\u03A0\u03C1\u03BF\u03C3\u03BF\u03C7\u03AE\".\n * assistiveText is used to provide a textual warning for assistive technologies like screen readers.\n */\n assistiveText?: string;\n /**\n * variant is optional.\n * variant is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n /**\n * variant is optional.\n * variant error is used to change the color of the NotificationBannerContainer.\n * variant error-group is used to display red line on the left side of the component and exclamation mark icon with light red as background.\n * @value 'error'\n * @value 'error-group'\n * @default 'error'.\n */\n variant?: 'error' | 'error-group';\n}\n/**\n * Details for the NotificationBannerContent.\n * NotificationBannerContent component is used as a content for\n * NotificationBannerHeading and NotificationBannerLink components.\n * NotificationBannerContent component must be used inside NotificationBanner component as children.\n */\nexport const NotificationBannerContent = React.forwardRef<\n HTMLDivElement,\n NotificationBannerContentProps\n>(function NotificationBannerContent(\n { className, assistiveText, variant, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-notification-banner__content': variant !== 'error-group',\n 'ds-notification-error-group-banner__content':\n variant === 'error-group',\n })}\n {...props}\n >\n {variant === 'error-group' ? (\n <>\n <Base\n as=\"div\"\n className={clsx({\n 'ds-notification-banner__icon--error-group': true,\n })}\n >\n !\n </Base>\n <WarningTextAssistive>{assistiveText}</WarningTextAssistive>\n <Base as=\"div\" className=\"ds-notification-banner__text-error-group\">\n {children}\n </Base>\n </>\n ) : (\n <>{children}</>\n )}\n </Base>\n );\n});\n\nexport default NotificationBannerContent;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAChC,kCAAqC;AAgC9B,MAAM,4BAA4B,aAAAA,QAAM,WAG7C,SAASC,2BACT,EAAE,WAAW,eAAe,SAAS,UAAU,GAAG,MAAM,GACxD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,mCAAmC,YAAY;AAAA,QAC/C,+CACE,YAAY;AAAA,MAChB,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH,YAAY,gBACX,6BAAAH,QAAA,2BAAAA,QAAA,gBACE,6BAAAA,QAAA;AAAA,MAAC,YAAAE;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,eAAW,YAAAC,SAAK;AAAA,UACd,6CAA6C;AAAA,QAC/C,CAAC;AAAA;AAAA,MACF;AAAA,IAED,GACA,6BAAAH,QAAA,cAAC,wDAAsB,aAAc,GACrC,6BAAAA,QAAA,cAAC,YAAAE,SAAA,EAAK,IAAG,OAAM,WAAU,8CACtB,QACH,CACF,IAEA,6BAAAF,QAAA,2BAAAA,QAAA,gBAAG,QAAS;AAAA,EAEhB;AAEJ,CAAC;AAED,IAAO,oCAAQ;",
6
6
  "names": ["React", "NotificationBannerContent", "Base", "clsx"]
7
7
  }
@@ -67,8 +67,9 @@ const Skeleton = import_react.default.forwardRef(
67
67
  }
68
68
  },
69
69
  variant === "button" && /* @__PURE__ */ import_react.default.createElement(
70
- "span",
70
+ import_Base.default,
71
71
  {
72
+ as: "span",
72
73
  className: (0, import_clsx.default)({
73
74
  "ds-skeleton__line": true,
74
75
  "ds-skeleton__line--size-default": width === void 0 && height === void 0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/Skeleton/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface SkeletonProps extends BaseProps<'span'> {\n /**\n * variant prop determines the style of the skeleton element.\n * @value 'circular', it renders a circular skeleton.\n * @value 'rectangular', it renders a rectangular skeleton.\n * @value 'text', it renders a text skeleton.\n * @value 'button', it renders a button skeleton.\n * @default 'text'\n */\n variant?: 'circular' | 'rectangular' | 'text' | 'button';\n\n /**\n * width prop determines the width of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * For better responsive experience, avoid using px and use percentage instead.\n * @default undefined\n */\n width?: number | string;\n\n /**\n * height prop determines the height of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * @default undefined\n */\n height?: number | string;\n\n /**\n * fontSize is optional. 'sm' is the default value.\n * Use 'xl' when this Skeleton is for a main page title.\n * The fontSize works only for variant 'text'.\n * You don't need fontSize if you wrap Skeleton in a typography component.\n * @value 'xl'\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @value 'xs'\n * @default 'sm'\n */\n fontSize?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';\n /**\n * animation prop determines if the skeleton should animate or not.\n * @default true\n */\n animation?: boolean;\n}\n/**\n * Use Skeleton component while a page is loading.\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n width,\n height,\n fontSize,\n variant = 'text',\n animation = true,\n className,\n children,\n style,\n ...props\n },\n ref\n ) {\n return (\n <Base\n as=\"span\"\n ref={ref}\n className={clsx(className, {\n 'ds-skeleton': true,\n [`ds-skeleton--font-${fontSize}`]:\n fontSize !== undefined && variant === 'text',\n [`ds-skeleton--${variant}`]:\n !!variant && (!children || typeof children === 'string'),\n 'ds-skeleton--animate': !!animation,\n 'ds-skeleton--width-fit-content': !!children && !width,\n })}\n {...props}\n style={{\n width:\n typeof children === 'string'\n ? Math.ceil(children.length * 0.5) + 'em'\n : width,\n maxWidth: width ? '100%' : undefined,\n height: height,\n ...style,\n }}\n >\n {variant === 'button' && (\n <span\n className={clsx({\n 'ds-skeleton__line': true,\n 'ds-skeleton__line--size-default':\n width === undefined && height === undefined,\n })}\n ></span>\n )}\n {typeof children != 'string' && children}\n </Base>\n );\n }\n);\n\nexport default Skeleton;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAkDzB,MAAM,WAAW,aAAAA,QAAM;AAAA,EAC5B,SAASC,UACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,KACA;AACA,WACE,6BAAAD,QAAA;AAAA,MAAC,YAAAE;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,eAAW,YAAAC,SAAK,WAAW;AAAA,UACzB,eAAe;AAAA,UACf,CAAC,qBAAqB,QAAQ,EAAE,GAC9B,aAAa,UAAa,YAAY;AAAA,UACxC,CAAC,gBAAgB,OAAO,EAAE,GACxB,CAAC,CAAC,YAAY,CAAC,YAAY,OAAO,aAAa;AAAA,UACjD,wBAAwB,CAAC,CAAC;AAAA,UAC1B,kCAAkC,CAAC,CAAC,YAAY,CAAC;AAAA,QACnD,CAAC;AAAA,QACA,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,OACE,OAAO,aAAa,WAChB,KAAK,KAAK,SAAS,SAAS,GAAG,IAAI,OACnC;AAAA,UACN,UAAU,QAAQ,SAAS;AAAA,UAC3B;AAAA,UACA,GAAG;AAAA,QACL;AAAA;AAAA,MAEC,YAAY,YACX,6BAAAH,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,YAAAG,SAAK;AAAA,YACd,qBAAqB;AAAA,YACrB,mCACE,UAAU,UAAa,WAAW;AAAA,UACtC,CAAC;AAAA;AAAA,MACF;AAAA,MAEF,OAAO,YAAY,YAAY;AAAA,IAClC;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface SkeletonProps extends BaseProps<'span'> {\n /**\n * variant prop determines the style of the skeleton element.\n * @value 'circular', it renders a circular skeleton.\n * @value 'rectangular', it renders a rectangular skeleton.\n * @value 'text', it renders a text skeleton.\n * @value 'button', it renders a button skeleton.\n * @default 'text'\n */\n variant?: 'circular' | 'rectangular' | 'text' | 'button';\n\n /**\n * width prop determines the width of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * For better responsive experience, avoid using px and use percentage instead.\n * @default undefined\n */\n width?: number | string;\n\n /**\n * height prop determines the height of the skeleton element.\n * It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').\n * @default undefined\n */\n height?: number | string;\n\n /**\n * fontSize is optional. 'sm' is the default value.\n * Use 'xl' when this Skeleton is for a main page title.\n * The fontSize works only for variant 'text'.\n * You don't need fontSize if you wrap Skeleton in a typography component.\n * @value 'xl'\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @value 'xs'\n * @default 'sm'\n */\n fontSize?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';\n /**\n * animation prop determines if the skeleton should animate or not.\n * @default true\n */\n animation?: boolean;\n}\n/**\n * Use Skeleton component while a page is loading.\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n width,\n height,\n fontSize,\n variant = 'text',\n animation = true,\n className,\n children,\n style,\n ...props\n },\n ref\n ) {\n return (\n <Base\n as=\"span\"\n ref={ref}\n className={clsx(className, {\n 'ds-skeleton': true,\n [`ds-skeleton--font-${fontSize}`]:\n fontSize !== undefined && variant === 'text',\n [`ds-skeleton--${variant}`]:\n !!variant && (!children || typeof children === 'string'),\n 'ds-skeleton--animate': !!animation,\n 'ds-skeleton--width-fit-content': !!children && !width,\n })}\n {...props}\n style={{\n width:\n typeof children === 'string'\n ? Math.ceil(children.length * 0.5) + 'em'\n : width,\n maxWidth: width ? '100%' : undefined,\n height: height,\n ...style,\n }}\n >\n {variant === 'button' && (\n <Base\n as=\"span\"\n className={clsx({\n 'ds-skeleton__line': true,\n 'ds-skeleton__line--size-default':\n width === undefined && height === undefined,\n })}\n ></Base>\n )}\n {typeof children != 'string' && children}\n </Base>\n );\n }\n);\n\nexport default Skeleton;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAkDzB,MAAM,WAAW,aAAAA,QAAM;AAAA,EAC5B,SAASC,UACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,KACA;AACA,WACE,6BAAAD,QAAA;AAAA,MAAC,YAAAE;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH;AAAA,QACA,eAAW,YAAAC,SAAK,WAAW;AAAA,UACzB,eAAe;AAAA,UACf,CAAC,qBAAqB,QAAQ,EAAE,GAC9B,aAAa,UAAa,YAAY;AAAA,UACxC,CAAC,gBAAgB,OAAO,EAAE,GACxB,CAAC,CAAC,YAAY,CAAC,YAAY,OAAO,aAAa;AAAA,UACjD,wBAAwB,CAAC,CAAC;AAAA,UAC1B,kCAAkC,CAAC,CAAC,YAAY,CAAC;AAAA,QACnD,CAAC;AAAA,QACA,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,OACE,OAAO,aAAa,WAChB,KAAK,KAAK,SAAS,SAAS,GAAG,IAAI,OACnC;AAAA,UACN,UAAU,QAAQ,SAAS;AAAA,UAC3B;AAAA,UACA,GAAG;AAAA,QACL;AAAA;AAAA,MAEC,YAAY,YACX,6BAAAH,QAAA;AAAA,QAAC,YAAAE;AAAA,QAAA;AAAA,UACC,IAAG;AAAA,UACH,eAAW,YAAAC,SAAK;AAAA,YACd,qBAAqB;AAAA,YACrB,mCACE,UAAU,UAAa,WAAW;AAAA,UACtC,CAAC;AAAA;AAAA,MACF;AAAA,MAEF,OAAO,YAAY,YAAY;AAAA,IAClC;AAAA,EAEJ;AACF;AAEA,IAAO,mBAAQ;",
6
6
  "names": ["React", "Skeleton", "Base", "clsx"]
7
7
  }