@frontify/fondue-components 18.1.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,39 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import * as m from "@radix-ui/react-separator";
3
- import { forwardRef as s } from "react";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import * as n from "@radix-ui/react-separator";
3
+ import { forwardRef as p } from "react";
4
4
  import { cn as f } from "./fondue-components36.js";
5
- import { dividerStyles as p } from "./fondue-components49.js";
6
- const n = s(
5
+ import { dividerStyles as l } from "./fondue-components49.js";
6
+ const c = p(
7
7
  ({
8
- "data-test-id": r = "fondue-divider",
9
- direction: o = "horizontal",
10
- className: t,
11
- variant: i,
12
- ...e
13
- }, a) => /* @__PURE__ */ d(
14
- m.Root,
15
- {
16
- ref: a,
17
- className: f(
18
- p({
19
- direction: o,
20
- variant: i,
21
- ...e
22
- }),
23
- t
24
- ),
25
- "data-test-id": r
26
- }
27
- )
8
+ "data-test-id": o = "fondue-divider",
9
+ direction: t = "horizontal",
10
+ className: i,
11
+ variant: e,
12
+ as: d = "div",
13
+ ...a
14
+ }, m) => {
15
+ const s = d;
16
+ return /* @__PURE__ */ r(
17
+ n.Root,
18
+ {
19
+ ref: m,
20
+ className: f(
21
+ l({
22
+ direction: t,
23
+ variant: e,
24
+ ...a
25
+ }),
26
+ i
27
+ ),
28
+ "data-test-id": o,
29
+ asChild: !0,
30
+ children: /* @__PURE__ */ r(s, {})
31
+ }
32
+ );
33
+ }
28
34
  );
29
- n.displayName = "Divider";
35
+ c.displayName = "Divider";
30
36
  export {
31
- n as Divider
37
+ c as Divider
32
38
  };
33
39
  //# sourceMappingURL=fondue-components10.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components10.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n />\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","props","ref","jsx","Separator","cn","dividerStyles"],"mappings":";;;;;AAuCO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAU;AAAA,IAAV;AAAA,MACG,KAAAF;AAAA,MACA,WAAWG;AAAA,QACPC,EAAc;AAAA,UACV,WAAAR;AAAA,UACA,SAAAE;AAAA,UACA,GAAGC;AAAA,QAAA,CACN;AAAA,QACDF;AAAA,MACJ;AAAA,MACA,gBAAcF;AAAA,IAAA;AAAA,EAClB;AAGZ;AAEAF,EAAQ,cAAc;"}
1
+ {"version":3,"file":"fondue-components10.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n /**\n * The html element to be used\n * @default \"div\"\n */\n as?: 'div' | 'li';\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n as = 'div',\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n const Component = as;\n\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n asChild\n >\n <Component />\n </Separator.Root>\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","as","props","ref","Component","jsx","Separator","cn","dividerStyles"],"mappings":";;;;;AA4CO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,IAAAC,IAAK;AAAA,IACL,GAAGC;AAAA,KAEPC,MACe;AACf,UAAMC,IAAYH;AAGd,WAAA,gBAAAI;AAAA,MAACC,EAAU;AAAA,MAAV;AAAA,QACG,KAAAH;AAAA,QACA,WAAWI;AAAA,UACPC,EAAc;AAAA,YACV,WAAAV;AAAA,YACA,SAAAE;AAAA,YACA,GAAGE;AAAA,UAAA,CACN;AAAA,UACDH;AAAA,QACJ;AAAA,QACA,gBAAcF;AAAA,QACd,SAAO;AAAA,QAEP,4BAACO,GAAU,CAAA,CAAA;AAAA,MAAA;AAAA,IACf;AAAA,EAAA;AAGZ;AAEAT,EAAQ,cAAc;"}
@@ -1,18 +1,18 @@
1
- const o = "_root_xgv97_6", e = "_overlay_xgv97_51", _ = "_header_xgv97_67", t = "_body_xgv97_88", r = "_footer_xgv97_113", s = "_close_xgv97_134", c = {
1
+ const o = "_root_hstbt_6", t = "_overlay_hstbt_51", s = "_header_hstbt_68", e = "_body_hstbt_89", _ = "_footer_hstbt_114", r = "_close_hstbt_135", c = {
2
2
  root: o,
3
- overlay: e,
4
- header: _,
5
- body: t,
6
- footer: r,
7
- close: s
3
+ overlay: t,
4
+ header: s,
5
+ body: e,
6
+ footer: _,
7
+ close: r
8
8
  };
9
9
  export {
10
- t as body,
11
- s as close,
10
+ e as body,
11
+ r as close,
12
12
  c as default,
13
- r as footer,
14
- _ as header,
15
- e as overlay,
13
+ _ as footer,
14
+ s as header,
15
+ t as overlay,
16
16
  o as root
17
17
  };
18
18
  //# sourceMappingURL=fondue-components53.js.map
@@ -1,19 +1,22 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { IconCheckMark as l } from "@frontify/fondue-icons";
3
- import { forwardRef as c } from "react";
4
- import o from "./fondue-components66.js";
5
- const d = ({ "data-test-id": t = "fondue-select-item", ...e }, r) => /* @__PURE__ */ i("li", { "data-test-id": t, ref: r, ...e, children: [
6
- /* @__PURE__ */ a("div", { className: o.itemValue, children: e.children }),
7
- /* @__PURE__ */ a(l, { className: o.checkmarkIcon })
1
+ import { jsxs as d, jsx as r } from "react/jsx-runtime";
2
+ import { IconCheckMark as n } from "@frontify/fondue-icons";
3
+ import { forwardRef as l } from "react";
4
+ import a from "./fondue-components66.js";
5
+ const o = ({ "data-test-id": c = "fondue-select-item", ...e }, t) => /* @__PURE__ */ d("li", { "data-test-id": c, ref: t, ...e, children: [
6
+ /* @__PURE__ */ r("div", { className: a.itemValue, children: e.children }),
7
+ /* @__PURE__ */ r(n, { className: a.checkmarkIcon })
8
8
  ] });
9
- d.displayName = "Select.Item";
10
- const I = c(d), m = ({ children: t, groupId: e, "data-test-id": r = "fondue-select-item-group" }, s) => /* @__PURE__ */ a("div", { "data-test-id": r, className: o.group, ref: s, children: t }, e);
11
- m.displayName = "Select.Group";
12
- const S = c(m);
9
+ o.displayName = "Select.Item";
10
+ const I = l(o), s = ({ children: c, groupId: e, heading: t, "data-test-id": i = "fondue-select-item-group" }, m) => /* @__PURE__ */ d("div", { "data-test-id": i, className: a.group, ref: m, children: [
11
+ t ? /* @__PURE__ */ r("div", { className: a.groupHeading, children: /* @__PURE__ */ r("span", { children: t }) }) : null,
12
+ c
13
+ ] }, e);
14
+ s.displayName = "Select.Group";
15
+ const N = l(s);
13
16
  export {
14
17
  I as ForwardedRefSelectItem,
15
- S as ForwardedRefSelectItemGroup,
16
- d as SelectItem,
17
- m as SelectItemGroup
18
+ N as ForwardedRefSelectItemGroup,
19
+ o as SelectItem,
20
+ s as SelectItemGroup
18
21
  };
19
22
  //# sourceMappingURL=fondue-components63.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components63.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n <div className={styles.itemValue}>{props.children}</div>\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","styles","IconCheckMark","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCa,MAAAA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9DC,wBAGK,MAAG,EAAA,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAI,EAAA,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EACjD,gBAAAD,EAAAE,GAAA,EAAc,WAAWD,EAAO,cAAe,CAAA;AAAA,GACpD;AAGRL,EAAW,cAAc;AAEZ,MAAAO,IAAyBC,EAA2CR,CAAU,GAiB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,gBAAgBV,IAAa,2BAA2B,GAC7EE,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcH,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAAO,EAAA,GAD2EC,CAEhF;AAGRF,EAAgB,cAAc;AAEjB,MAAAG,IAA8BJ,EAAiDC,CAAe;"}
1
+ {"version":3,"file":"fondue-components63.js","sources":["../src/components/Select/SelectItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark } from '@frontify/fondue-icons';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport styles from './styles/select.module.scss';\n\nexport type SelectItemProps = {\n /**\n * The value of the select item.\n */\n value: string;\n /**\n * The data test id of the select item.\n */\n 'data-test-id'?: string;\n} & (\n | {\n /**\n * The label of the select item. Required when the child is not a string.\n */\n label: string;\n /**\n * The children of the select item. This can be a custom component or a string.\n */\n children?: ReactNode;\n }\n | {\n label?: string;\n children: string;\n }\n);\n\nexport const SelectItem = (\n { 'data-test-id': dataTestId = 'fondue-select-item', ...props }: SelectItemProps,\n forwardedRef?: ForwardedRef<HTMLLIElement>,\n) => {\n return (\n <li data-test-id={dataTestId} ref={forwardedRef} {...props}>\n <div className={styles.itemValue}>{props.children}</div>\n <IconCheckMark className={styles.checkmarkIcon} />\n </li>\n );\n};\nSelectItem.displayName = 'Select.Item';\n\nexport const ForwardedRefSelectItem = forwardRef<HTMLLIElement, SelectItemProps>(SelectItem);\n\nexport type SelectItemGroupProps = {\n /**\n * The children of the select item group. This can contain multiple `Select.Item` components.\n */\n children: ReactNode;\n /**\n * The internal group ID of the select item group.\n */\n groupId: string;\n /**\n * The groups heading\n */\n heading?: string;\n /**\n * The data test id of the select item group.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectItemGroup = (\n { children, groupId, heading, 'data-test-id': dataTestId = 'fondue-select-item-group' }: SelectItemGroupProps,\n forwardedRef?: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} className={styles.group} ref={forwardedRef} key={groupId}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span>{heading}</span>\n </div>\n ) : null}\n {children}\n </div>\n );\n};\nSelectItemGroup.displayName = 'Select.Group';\n\nexport const ForwardedRefSelectItemGroup = forwardRef<HTMLDivElement, SelectItemGroupProps>(SelectItemGroup);\n"],"names":["SelectItem","dataTestId","props","forwardedRef","jsx","styles","IconCheckMark","ForwardedRefSelectItem","forwardRef","SelectItemGroup","children","groupId","heading","jsxs","ForwardedRefSelectItemGroup"],"mappings":";;;;AAiCa,MAAAA,IAAa,CACtB,EAAE,gBAAgBC,IAAa,sBAAsB,GAAGC,EAAM,GAC9DC,wBAGK,MAAG,EAAA,gBAAcF,GAAY,KAAKE,GAAe,GAAGD,GACjD,UAAA;AAAA,EAAA,gBAAAE,EAAC,OAAI,EAAA,WAAWC,EAAO,WAAY,YAAM,UAAS;AAAA,EACjD,gBAAAD,EAAAE,GAAA,EAAc,WAAWD,EAAO,cAAe,CAAA;AAAA,GACpD;AAGRL,EAAW,cAAc;AAEZ,MAAAO,IAAyBC,EAA2CR,CAAU,GAqB9ES,IAAkB,CAC3B,EAAE,UAAAC,GAAU,SAAAC,GAAS,SAAAC,GAAS,gBAAgBX,IAAa,2BAA2B,GACtFE,MAGI,gBAAAU,EAAC,SAAI,gBAAcZ,GAAY,WAAWI,EAAO,OAAO,KAAKF,GACxD,UAAA;AAAA,EACGS,IAAA,gBAAAR,EAAC,SAAI,WAAWC,EAAO,cACnB,UAAC,gBAAAD,EAAA,QAAA,EAAM,UAAQQ,EAAA,CAAA,EAAA,CACnB,IACA;AAAA,EACHF;AAAA,EAAA,GAN2EC,CAOhF;AAGRF,EAAgB,cAAc;AAEjB,MAAAK,IAA8BN,EAAiDC,CAAe;"}
@@ -1,36 +1,38 @@
1
- const c = "_root_9n1pi_7", n = "_selectedValue_9n1pi_69", o = "_input_9n1pi_87", _ = "_slot_9n1pi_113", t = "_clear_9n1pi_165", e = "_icons_9n1pi_178", s = "_caret_9n1pi_184", i = "_iconSuccess_9n1pi_212", r = "_iconError_9n1pi_218", p = "_menu_9n1pi_224", a = "_portal_9n1pi_247", l = "_item_9n1pi_263", u = "_checkmarkIcon_9n1pi_304", m = "_itemValue_9n1pi_311", k = "_group_9n1pi_325", V = {
2
- root: c,
3
- selectedValue: n,
4
- input: o,
5
- slot: _,
6
- clear: t,
7
- icons: e,
1
+ const o = "_root_174md_7", c = "_selectedValue_174md_69", _ = "_input_174md_87", t = "_slot_174md_113", e = "_clear_174md_165", n = "_icons_174md_178", s = "_caret_174md_184", r = "_iconSuccess_174md_212", m = "_iconError_174md_218", a = "_menu_174md_224", d = "_portal_174md_247", u = "_item_174md_263", i = "_checkmarkIcon_174md_304", l = "_itemValue_174md_311", p = "_group_174md_325", g = "_groupHeading_174md_336", k = {
2
+ root: o,
3
+ selectedValue: c,
4
+ input: _,
5
+ slot: t,
6
+ clear: e,
7
+ icons: n,
8
8
  caret: s,
9
- iconSuccess: i,
10
- iconError: r,
11
- menu: p,
12
- portal: a,
13
- item: l,
14
- checkmarkIcon: u,
15
- itemValue: m,
16
- group: k
9
+ iconSuccess: r,
10
+ iconError: m,
11
+ menu: a,
12
+ portal: d,
13
+ item: u,
14
+ checkmarkIcon: i,
15
+ itemValue: l,
16
+ group: p,
17
+ groupHeading: g
17
18
  };
18
19
  export {
19
20
  s as caret,
20
- u as checkmarkIcon,
21
- t as clear,
22
- V as default,
23
- k as group,
24
- r as iconError,
25
- i as iconSuccess,
26
- e as icons,
27
- o as input,
28
- l as item,
29
- m as itemValue,
30
- p as menu,
31
- a as portal,
32
- c as root,
33
- n as selectedValue,
34
- _ as slot
21
+ i as checkmarkIcon,
22
+ e as clear,
23
+ k as default,
24
+ p as group,
25
+ g as groupHeading,
26
+ m as iconError,
27
+ r as iconSuccess,
28
+ n as icons,
29
+ _ as input,
30
+ u as item,
31
+ l as itemValue,
32
+ a as menu,
33
+ d as portal,
34
+ o as root,
35
+ c as selectedValue,
36
+ t as slot
35
37
  };
36
38
  //# sourceMappingURL=fondue-components66.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fondue-components66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -638,6 +638,11 @@ declare type DividerProps = {
638
638
  * @default "horizontal"
639
639
  */
640
640
  direction?: DividerDirection;
641
+ /**
642
+ * The html element to be used
643
+ * @default "div"
644
+ */
645
+ as?: 'div' | 'li';
641
646
  'data-test-id'?: string;
642
647
  className?: string;
643
648
  };
@@ -1494,6 +1499,10 @@ declare type SelectItemGroupProps = {
1494
1499
  * The internal group ID of the select item group.
1495
1500
  */
1496
1501
  groupId: string;
1502
+ /**
1503
+ * The groups heading
1504
+ */
1505
+ heading?: string;
1497
1506
  /**
1498
1507
  * The data test id of the select item group.
1499
1508
  */