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

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.
@@ -22,8 +22,8 @@ const TimelineHeading = React.forwardRef(function TimelineHeading2({ size = "lg"
22
22
  ref,
23
23
  className: clsx(className, {
24
24
  "ds-timeline__heading": true,
25
- "ds-timeline__heading--md": size === "md",
26
- "ds-timeline__heading--sm": size === "sm"
25
+ "ds-timeline__heading-md": size === "md",
26
+ "ds-timeline__heading-sm": size === "sm"
27
27
  }),
28
28
  ...props
29
29
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/TimelineHeading/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TimelineHeadingProps extends BaseProps<'h2'> {\n /**\n * size is optional. 'lg' is the default value.\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @default 'lg'\n */\n size?: 'lg' | 'md' | 'sm';\n /**\n * element is optional. 'h2' is the default value.\n * @value 'h2'\n * @value 'h3'\n * @value 'h4'\n */\n element?: 'h2' | 'h3' | 'h4';\n}\n\nconst getComponentBySize = (\n size: TimelineHeadingProps['size']\n): TimelineHeadingProps['element'] => {\n switch (size) {\n case 'lg':\n return 'h2';\n case 'md':\n return 'h3';\n case 'sm':\n return 'h4';\n default:\n return 'h2';\n }\n};\n\n/**\n * TimelineHeading component is used to place a title in a Timeline component.\n * TimelineHeading component must be wraped inside Timeline component.\n */\nexport const TimelineHeading = React.forwardRef<\n HTMLHeadingElement,\n TimelineHeadingProps\n>(function TimelineHeading(\n { size = 'lg', element, className, children, ...props },\n ref\n) {\n const Component = element ? element : getComponentBySize(size);\n return (\n <Base\n as={Component}\n ref={ref}\n className={clsx(className, {\n 'ds-timeline__heading': true,\n 'ds-timeline__heading--md': size === 'md',\n 'ds-timeline__heading--sm': size === 'sm',\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default TimelineHeading;\n"],
5
- "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAoBhC,MAAM,qBAAqB,CACzB,SACoC;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAMO,MAAM,kBAAkB,MAAM,WAGnC,SAASA,iBACT,EAAE,OAAO,MAAM,SAAS,WAAW,UAAU,GAAG,MAAM,GACtD,KACA;AACA,QAAM,YAAY,UAAU,UAAU,mBAAmB,IAAI;AAC7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,wBAAwB;AAAA,QACxB,4BAA4B,SAAS;AAAA,QACrC,4BAA4B,SAAS;AAAA,MACvC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TimelineHeadingProps extends BaseProps<'h2'> {\n /**\n * size is optional. 'lg' is the default value.\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @default 'lg'\n */\n size?: 'lg' | 'md' | 'sm';\n /**\n * element is optional. 'h2' is the default value.\n * @value 'h2'\n * @value 'h3'\n * @value 'h4'\n */\n element?: 'h2' | 'h3' | 'h4';\n}\n\nconst getComponentBySize = (\n size: TimelineHeadingProps['size']\n): TimelineHeadingProps['element'] => {\n switch (size) {\n case 'lg':\n return 'h2';\n case 'md':\n return 'h3';\n case 'sm':\n return 'h4';\n default:\n return 'h2';\n }\n};\n\n/**\n * TimelineHeading component is used to place a title in a Timeline component.\n * TimelineHeading component must be wraped inside Timeline component.\n */\nexport const TimelineHeading = React.forwardRef<\n HTMLHeadingElement,\n TimelineHeadingProps\n>(function TimelineHeading(\n { size = 'lg', element, className, children, ...props },\n ref\n) {\n const Component = element ? element : getComponentBySize(size);\n return (\n <Base\n as={Component}\n ref={ref}\n className={clsx(className, {\n 'ds-timeline__heading': true,\n 'ds-timeline__heading-md': size === 'md',\n 'ds-timeline__heading-sm': size === 'sm',\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default TimelineHeading;\n"],
5
+ "mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,OAAO,UAAyB;AAoBhC,MAAM,qBAAqB,CACzB,SACoC;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAMO,MAAM,kBAAkB,MAAM,WAGnC,SAASA,iBACT,EAAE,OAAO,MAAM,SAAS,WAAW,UAAU,GAAG,MAAM,GACtD,KACA;AACA,QAAM,YAAY,UAAU,UAAU,mBAAmB,IAAI;AAC7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA,WAAW,KAAK,WAAW;AAAA,QACzB,wBAAwB;AAAA,QACxB,2BAA2B,SAAS;AAAA,QACpC,2BAA2B,SAAS;AAAA,MACtC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,0BAAQ;",
6
6
  "names": ["TimelineHeading"]
7
7
  }
@@ -55,8 +55,8 @@ const TimelineHeading = import_react.default.forwardRef(function TimelineHeading
55
55
  ref,
56
56
  className: (0, import_clsx.default)(className, {
57
57
  "ds-timeline__heading": true,
58
- "ds-timeline__heading--md": size === "md",
59
- "ds-timeline__heading--sm": size === "sm"
58
+ "ds-timeline__heading-md": size === "md",
59
+ "ds-timeline__heading-sm": size === "sm"
60
60
  }),
61
61
  ...props
62
62
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/TimelineHeading/index.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TimelineHeadingProps extends BaseProps<'h2'> {\n /**\n * size is optional. 'lg' is the default value.\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @default 'lg'\n */\n size?: 'lg' | 'md' | 'sm';\n /**\n * element is optional. 'h2' is the default value.\n * @value 'h2'\n * @value 'h3'\n * @value 'h4'\n */\n element?: 'h2' | 'h3' | 'h4';\n}\n\nconst getComponentBySize = (\n size: TimelineHeadingProps['size']\n): TimelineHeadingProps['element'] => {\n switch (size) {\n case 'lg':\n return 'h2';\n case 'md':\n return 'h3';\n case 'sm':\n return 'h4';\n default:\n return 'h2';\n }\n};\n\n/**\n * TimelineHeading component is used to place a title in a Timeline component.\n * TimelineHeading component must be wraped inside Timeline component.\n */\nexport const TimelineHeading = React.forwardRef<\n HTMLHeadingElement,\n TimelineHeadingProps\n>(function TimelineHeading(\n { size = 'lg', element, className, children, ...props },\n ref\n) {\n const Component = element ? element : getComponentBySize(size);\n return (\n <Base\n as={Component}\n ref={ref}\n className={clsx(className, {\n 'ds-timeline__heading': true,\n 'ds-timeline__heading--md': size === 'md',\n 'ds-timeline__heading--sm': size === 'sm',\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default TimelineHeading;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAoBhC,MAAM,qBAAqB,CACzB,SACoC;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAMO,MAAM,kBAAkB,aAAAA,QAAM,WAGnC,SAASC,iBACT,EAAE,OAAO,MAAM,SAAS,WAAW,UAAU,GAAG,MAAM,GACtD,KACA;AACA,QAAM,YAAY,UAAU,UAAU,mBAAmB,IAAI;AAC7D,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,wBAAwB;AAAA,QACxB,4BAA4B,SAAS;AAAA,QACrC,4BAA4B,SAAS;AAAA,MACvC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface TimelineHeadingProps extends BaseProps<'h2'> {\n /**\n * size is optional. 'lg' is the default value.\n * @value 'lg'\n * @value 'md'\n * @value 'sm'\n * @default 'lg'\n */\n size?: 'lg' | 'md' | 'sm';\n /**\n * element is optional. 'h2' is the default value.\n * @value 'h2'\n * @value 'h3'\n * @value 'h4'\n */\n element?: 'h2' | 'h3' | 'h4';\n}\n\nconst getComponentBySize = (\n size: TimelineHeadingProps['size']\n): TimelineHeadingProps['element'] => {\n switch (size) {\n case 'lg':\n return 'h2';\n case 'md':\n return 'h3';\n case 'sm':\n return 'h4';\n default:\n return 'h2';\n }\n};\n\n/**\n * TimelineHeading component is used to place a title in a Timeline component.\n * TimelineHeading component must be wraped inside Timeline component.\n */\nexport const TimelineHeading = React.forwardRef<\n HTMLHeadingElement,\n TimelineHeadingProps\n>(function TimelineHeading(\n { size = 'lg', element, className, children, ...props },\n ref\n) {\n const Component = element ? element : getComponentBySize(size);\n return (\n <Base\n as={Component}\n ref={ref}\n className={clsx(className, {\n 'ds-timeline__heading': true,\n 'ds-timeline__heading-md': size === 'md',\n 'ds-timeline__heading-sm': size === 'sm',\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default TimelineHeading;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAoBhC,MAAM,qBAAqB,CACzB,SACoC;AACpC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAMO,MAAM,kBAAkB,aAAAA,QAAM,WAGnC,SAASC,iBACT,EAAE,OAAO,MAAM,SAAS,WAAW,UAAU,GAAG,MAAM,GACtD,KACA;AACA,QAAM,YAAY,UAAU,UAAU,mBAAmB,IAAI;AAC7D,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,wBAAwB;AAAA,QACxB,2BAA2B,SAAS;AAAA,QACpC,2BAA2B,SAAS;AAAA,MACtC,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,0BAAQ;",
6
6
  "names": ["React", "TimelineHeading", "Base", "clsx"]
7
7
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v2.0.0-rc.25
1
+ /** @license Digigov v2.0.0-rc.26
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@digigov/react-core",
3
- "version": "2.0.0-rc.25",
3
+ "version": "2.0.0-rc.26",
4
4
  "description": "@digigov react core components",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
7
7
  "main": "./cjs/index.js",
8
8
  "module": "./index.js",
9
9
  "peerDependencies": {
10
- "@digigov/css": "2.0.0-rc.25",
11
- "@digigov/react-icons": "2.0.0-rc.25",
10
+ "@digigov/css": "2.0.0-rc.26",
11
+ "@digigov/react-icons": "2.0.0-rc.26",
12
12
  "clsx": "1.1.1",
13
13
  "react": ">=16.8.0 <19.0.0",
14
14
  "react-dom": ">=16.8.0 <19.0.0",
@@ -16,7 +16,7 @@ exports[`renders the TimelineHeading with size = "md" prop 1`] = `
16
16
  <body>
17
17
  <div>
18
18
  <h3
19
- class="ds-timeline__heading ds-timeline__heading--md"
19
+ class="ds-timeline__heading ds-timeline__heading-md"
20
20
  >
21
21
  hello
22
22
  </h3>
@@ -28,7 +28,7 @@ exports[`renders the TimelineHeading with size = "sm" prop 1`] = `
28
28
  <body>
29
29
  <div>
30
30
  <h4
31
- class="ds-timeline__heading ds-timeline__heading--sm"
31
+ class="ds-timeline__heading ds-timeline__heading-sm"
32
32
  >
33
33
  hello
34
34
  </h4>
@@ -53,8 +53,8 @@ export const TimelineHeading = React.forwardRef<
53
53
  ref={ref}
54
54
  className={clsx(className, {
55
55
  'ds-timeline__heading': true,
56
- 'ds-timeline__heading--md': size === 'md',
57
- 'ds-timeline__heading--sm': size === 'sm',
56
+ 'ds-timeline__heading-md': size === 'md',
57
+ 'ds-timeline__heading-sm': size === 'sm',
58
58
  })}
59
59
  {...props}
60
60
  >