@frontify/fondue 12.9.8 → 12.10.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,25 +1,26 @@
1
- import { jsxs as l, Fragment as i, jsx as e } from "react/jsx-runtime";
2
- var w = /* @__PURE__ */ ((t) => (t.NoLine = "noline", t.Dashed = "dashed", t.Solid = "solid", t.Dotted = "dotted", t))(w || {}), m = /* @__PURE__ */ ((t) => (t.Small = "36px", t.Medium = "60px", t.Large = "96px", t))(m || {});
3
- const o = {
1
+ import { jsxs as w, Fragment as m, jsx as e } from "react/jsx-runtime";
2
+ var c = /* @__PURE__ */ ((t) => (t.NoLine = "noline", t.Dashed = "dashed", t.Solid = "solid", t.Dotted = "dotted", t))(c || {}), u = /* @__PURE__ */ ((t) => (t.Small = "36px", t.Medium = "60px", t.Large = "96px", t))(u || {});
3
+ const l = {
4
4
  noline: "tw-border-none",
5
5
  dashed: "tw-border-dashed",
6
6
  solid: "tw-border-solid",
7
7
  dotted: "tw-border-dotted"
8
- }, c = "fondue-divider", u = ({
9
- vertical: t = !1,
10
- style: r = "solid",
8
+ }, f = "fondue-divider", p = ({
9
+ as: t = "div",
10
+ vertical: r = !1,
11
+ style: s = "solid",
11
12
  height: d = "36px",
12
- "data-test-id": s = c,
13
- color: a = "#CCC"
13
+ "data-test-id": a = f,
14
+ color: o = "#CCC"
14
15
  }) => {
15
- const n = `tw-w-px tw-h-full tw-border-r tw-m-0 ${o[r]}`;
16
- return /* @__PURE__ */ l(i, { children: [
17
- t && /* @__PURE__ */ e(
18
- "div",
16
+ const i = `tw-w-px tw-h-full tw-border-r tw-m-0 ${l[s]}`, n = t;
17
+ return /* @__PURE__ */ w(m, { children: [
18
+ r && /* @__PURE__ */ e(
19
+ n,
19
20
  {
20
21
  "aria-hidden": "true",
21
22
  className: "tw-flex tw-self-stretch tw-mt-0 tw-mb-0 tw-items-center tw-justify-center",
22
- "data-test-id": s,
23
+ "data-test-id": a,
23
24
  style: {
24
25
  marginLeft: parseInt(d) / 2,
25
26
  marginRight: parseInt(d) / 2
@@ -27,25 +28,25 @@ const o = {
27
28
  children: /* @__PURE__ */ e(
28
29
  "div",
29
30
  {
30
- className: n,
31
- style: { borderRightColor: a },
31
+ className: i,
32
+ style: { borderRightColor: o },
32
33
  "data-test-id": "fondue-divider-line"
33
34
  }
34
35
  )
35
36
  }
36
37
  ),
37
- !t && /* @__PURE__ */ e(
38
- "div",
38
+ !r && /* @__PURE__ */ e(
39
+ n,
39
40
  {
40
41
  "aria-hidden": "true",
41
42
  className: "tw-flex tw-items-center tw-w-full",
42
43
  style: { height: d },
43
- "data-test-id": s,
44
+ "data-test-id": a,
44
45
  children: /* @__PURE__ */ e(
45
46
  "hr",
46
47
  {
47
- className: `tw-border-t tw-m-0 tw-w-full ${o[r]}`,
48
- style: { borderTopColor: a },
48
+ className: `tw-border-t tw-m-0 tw-w-full ${l[s]}`,
49
+ style: { borderTopColor: o },
49
50
  "data-test-id": "fondue-divider-line"
50
51
  }
51
52
  )
@@ -53,10 +54,10 @@ const o = {
53
54
  )
54
55
  ] });
55
56
  };
56
- u.displayName = "FondueDivider";
57
+ p.displayName = "FondueDivider";
57
58
  export {
58
- u as Divider,
59
- m as DividerHeight,
60
- w as DividerStyle
59
+ p as Divider,
60
+ u as DividerHeight,
61
+ c as DividerStyle
61
62
  };
62
63
  //# sourceMappingURL=Divider.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.es.js","sources":["../../../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactElement } from 'react';\n\nexport enum DividerStyle {\n NoLine = 'noline',\n Dashed = 'dashed',\n Solid = 'solid',\n Dotted = 'dotted',\n}\n\nexport enum DividerHeight {\n Small = '36px',\n Medium = '60px',\n Large = '96px',\n}\n\nexport type DividerProps = {\n style?: DividerStyle;\n height?: DividerHeight | string;\n color?: string;\n vertical?: boolean;\n 'data-test-id'?: string;\n};\n\nconst styleMap = {\n [DividerStyle.NoLine]: 'tw-border-none',\n [DividerStyle.Dashed]: 'tw-border-dashed',\n [DividerStyle.Solid]: 'tw-border-solid',\n [DividerStyle.Dotted]: 'tw-border-dotted',\n};\n\nconst DIVIDER_TEST_ID = 'fondue-divider';\n\n/**\n * @deprecated Please use updated Divider component from `@frontify/fondue/components` instead. Also check {@link https://github.com/Frontify/fondue/blob/main/packages/components/MIGRATING.md#divider the migration guide}.\n */\nexport const Divider = ({\n vertical = false,\n style = DividerStyle.Solid,\n height = DividerHeight.Small,\n 'data-test-id': dataTestId = DIVIDER_TEST_ID,\n color = '#CCC',\n}: DividerProps): ReactElement => {\n const verticalClassNames = `tw-w-px tw-h-full tw-border-r tw-m-0 ${styleMap[style]}`;\n return (\n <>\n {vertical && (\n <div\n aria-hidden=\"true\"\n className=\"tw-flex tw-self-stretch tw-mt-0 tw-mb-0 tw-items-center tw-justify-center\"\n data-test-id={dataTestId}\n style={{\n marginLeft: parseInt(height) / 2,\n marginRight: parseInt(height) / 2,\n }}\n >\n <div\n className={verticalClassNames}\n style={{ borderRightColor: color }}\n data-test-id=\"fondue-divider-line\"\n ></div>\n </div>\n )}\n {!vertical && (\n <div\n aria-hidden=\"true\"\n className=\"tw-flex tw-items-center tw-w-full\"\n style={{ height }}\n data-test-id={dataTestId}\n >\n <hr\n className={`tw-border-t tw-m-0 tw-w-full ${styleMap[style]}`}\n style={{ borderTopColor: color }}\n data-test-id=\"fondue-divider-line\"\n />\n </div>\n )}\n </>\n );\n};\nDivider.displayName = 'FondueDivider';\n"],"names":["DividerStyle","DividerHeight","styleMap","DIVIDER_TEST_ID","Divider","vertical","style","height","dataTestId","color","verticalClassNames","jsxs","Fragment","jsx"],"mappings":";AAIY,IAAAA,sBAAAA,OACRA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAJDA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACRA,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c;"}
1
+ {"version":3,"file":"Divider.es.js","sources":["../../../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type ReactElement } from 'react';\n\nexport enum DividerStyle {\n NoLine = 'noline',\n Dashed = 'dashed',\n Solid = 'solid',\n Dotted = 'dotted',\n}\n\nexport enum DividerHeight {\n Small = '36px',\n Medium = '60px',\n Large = '96px',\n}\n\nexport type DividerProps = {\n as?: 'div' | 'li';\n style?: DividerStyle;\n height?: DividerHeight | string;\n color?: string;\n vertical?: boolean;\n 'data-test-id'?: string;\n};\n\nconst styleMap = {\n [DividerStyle.NoLine]: 'tw-border-none',\n [DividerStyle.Dashed]: 'tw-border-dashed',\n [DividerStyle.Solid]: 'tw-border-solid',\n [DividerStyle.Dotted]: 'tw-border-dotted',\n};\n\nconst DIVIDER_TEST_ID = 'fondue-divider';\n\n/**\n * @deprecated Please use updated Divider component from `@frontify/fondue/components` instead. Also check {@link https://github.com/Frontify/fondue/blob/main/packages/components/MIGRATING.md#divider the migration guide}.\n */\nexport const Divider = ({\n as = 'div',\n vertical = false,\n style = DividerStyle.Solid,\n height = DividerHeight.Small,\n 'data-test-id': dataTestId = DIVIDER_TEST_ID,\n color = '#CCC',\n}: DividerProps): ReactElement => {\n const verticalClassNames = `tw-w-px tw-h-full tw-border-r tw-m-0 ${styleMap[style]}`;\n const Component = as;\n\n return (\n <>\n {vertical && (\n <Component\n aria-hidden=\"true\"\n className=\"tw-flex tw-self-stretch tw-mt-0 tw-mb-0 tw-items-center tw-justify-center\"\n data-test-id={dataTestId}\n style={{\n marginLeft: parseInt(height) / 2,\n marginRight: parseInt(height) / 2,\n }}\n >\n <div\n className={verticalClassNames}\n style={{ borderRightColor: color }}\n data-test-id=\"fondue-divider-line\"\n ></div>\n </Component>\n )}\n {!vertical && (\n <Component\n aria-hidden=\"true\"\n className=\"tw-flex tw-items-center tw-w-full\"\n style={{ height }}\n data-test-id={dataTestId}\n >\n <hr\n className={`tw-border-t tw-m-0 tw-w-full ${styleMap[style]}`}\n style={{ borderTopColor: color }}\n data-test-id=\"fondue-divider-line\"\n />\n </Component>\n )}\n </>\n );\n};\nDivider.displayName = 'FondueDivider';\n"],"names":["DividerStyle","DividerHeight","styleMap","DIVIDER_TEST_ID","Divider","as","vertical","style","height","dataTestId","color","verticalClassNames","Component","jsxs","Fragment","jsx"],"mappings":";AAIY,IAAAA,sBAAAA,OACRA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,SAAS,UAJDA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACRA,EAAA,QAAQ,QACRA,EAAA,SAAS,QACTA,EAAA,QAAQ,QAHAA,IAAAA,KAAA,CAAA,CAAA;AAeZ,MAAMC,IAAW;AAAA,EACZ,QAAsB;AAAA,EACtB,QAAsB;AAAA,EACtB,OAAqB;AAAA,EACrB,QAAsB;AAC3B,GAEMC,IAAkB,kBAKXC,IAAU,CAAC;AAAA,EACpB,IAAAC,IAAK;AAAA,EACL,UAAAC,IAAW;AAAA,EACX,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,gBAAgBC,IAAaN;AAAA,EAC7B,OAAAO,IAAQ;AACZ,MAAkC;AAC9B,QAAMC,IAAqB,wCAAwCT,EAASK,CAAK,CAAC,IAC5EK,IAAYP;AAElB,SAES,gBAAAQ,EAAAC,GAAA,EAAA,UAAA;AAAA,IACGR,KAAA,gBAAAS;AAAA,MAACH;AAAA,MAAA;AAAA,QACG,eAAY;AAAA,QACZ,WAAU;AAAA,QACV,gBAAcH;AAAA,QACd,OAAO;AAAA,UACH,YAAY,SAASD,CAAM,IAAI;AAAA,UAC/B,aAAa,SAASA,CAAM,IAAI;AAAA,QACpC;AAAA,QAEA,UAAA,gBAAAO;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAWJ;AAAA,YACX,OAAO,EAAE,kBAAkBD,EAAM;AAAA,YACjC,gBAAa;AAAA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