@uva-glass/component-library 1.51.0 → 1.52.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.
- package/dist/assets/HorizontalList.css +1 -1
- package/dist/components/HorizontalList/HorizontalList.d.ts +3 -2
- package/dist/components/HorizontalList/HorizontalList.js +10 -9
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.stories.d.ts +1 -0
- package/dist/components/HorizontalList/HorizontalList.stories.js +35 -14
- package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
._horizontal-list-
|
|
1
|
+
._horizontal-list-wrapper_oivby_1{display:flex;margin:0}._horizontal-list-value_oivby_6{align-items:center;display:flex}._horizontal-list-separator_oivby_11{align-items:center;display:flex;margin:0 .5rem}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export interface HorizontalListProps {
|
|
2
3
|
/** The items to display. */
|
|
3
|
-
values:
|
|
4
|
+
values: ReactNode[];
|
|
4
5
|
/** The separator to use. */
|
|
5
|
-
separator?:
|
|
6
|
+
separator?: ReactNode;
|
|
6
7
|
}
|
|
7
8
|
/** Represents a component to show text separated by a given separator in a horizontal direction. */
|
|
8
9
|
export declare const HorizontalList: ({ values, separator }: HorizontalListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/HorizontalList.css';const
|
|
3
|
-
"horizontal-list-wrapper": "_horizontal-list-
|
|
4
|
-
"horizontal-list-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/HorizontalList.css';const t = {
|
|
3
|
+
"horizontal-list-wrapper": "_horizontal-list-wrapper_oivby_1",
|
|
4
|
+
"horizontal-list-value": "_horizontal-list-value_oivby_6",
|
|
5
|
+
"horizontal-list-separator": "_horizontal-list-separator_oivby_11"
|
|
6
|
+
}, p = ({ values: r, separator: a = "•" }) => /* @__PURE__ */ s("div", { className: t["horizontal-list-wrapper"], children: r.map((o, i) => /* @__PURE__ */ l("span", { className: t["horizontal-list-value"], children: [
|
|
7
|
+
o,
|
|
8
|
+
i < r.length - 1 && /* @__PURE__ */ s("span", { className: t["horizontal-list-separator"], children: a })
|
|
9
|
+
] }, `${o == null ? void 0 : o.toString()}-${i}`)) });
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
p as HorizontalList
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=HorizontalList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalList.js","sources":["../../../src/components/HorizontalList/HorizontalList.tsx"],"sourcesContent":["import styles from './HorizontalList.module.css';\n\nexport interface HorizontalListProps {\n /** The items to display. */\n values:
|
|
1
|
+
{"version":3,"file":"HorizontalList.js","sources":["../../../src/components/HorizontalList/HorizontalList.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport styles from './HorizontalList.module.css';\n\nexport interface HorizontalListProps {\n /** The items to display. */\n values: ReactNode[];\n /** The separator to use. */\n separator?: ReactNode;\n}\n\n/** Represents a component to show text separated by a given separator in a horizontal direction. */\nexport const HorizontalList = ({ values, separator = '•' }: HorizontalListProps) => {\n return (\n <div className={styles['horizontal-list-wrapper']}>\n {values.map((value, index) => (\n <span className={styles['horizontal-list-value']} key={`${value?.toString()}-${index}`}>\n {value}\n {index < values.length - 1 && <span className={styles['horizontal-list-separator']}>{separator}</span>}\n </span>\n ))}\n </div>\n );\n};\n"],"names":["HorizontalList","values","separator","styles","value","index","jsxs","jsx"],"mappings":";;;;;GAYaA,IAAiB,CAAC,EAAE,QAAAC,GAAQ,WAAAC,IAAY,4BAEhD,OAAI,EAAA,WAAWC,EAAO,yBAAyB,GAC7C,UAAOF,EAAA,IAAI,CAACG,GAAOC,MACjB,gBAAAC,EAAA,QAAA,EAAK,WAAWH,EAAO,uBAAuB,GAC5C,UAAA;AAAA,EAAAC;AAAA,EACAC,IAAQJ,EAAO,SAAS,KAAK,gBAAAM,EAAC,UAAK,WAAWJ,EAAO,2BAA2B,GAAI,UAAUD,EAAA,CAAA;AAAA,KAF1C,GAAGE,KAAA,gBAAAA,EAAO,UAAU,IAAIC,CAAK,EAGpF,CACD,EACH,CAAA;"}
|
|
@@ -3,3 +3,4 @@ import { HorizontalListProps } from './HorizontalList';
|
|
|
3
3
|
declare const _default: Meta<HorizontalListProps>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const HorizontalListExample: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, HorizontalListProps>;
|
|
6
|
+
export declare const WithComplexContent: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, HorizontalListProps>;
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { HorizontalList as
|
|
3
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { HorizontalList as o } from "./HorizontalList.js";
|
|
3
|
+
import { Button as i } from "../Buttons/Button.js";
|
|
4
|
+
import "../Buttons/LinkButton.js";
|
|
5
|
+
import "@react-aria/button";
|
|
6
|
+
import { Icon as r } from "../Icon/Icon.js";
|
|
7
|
+
const n = '<HorizontalList values={values} separator="•" />', g = {
|
|
4
8
|
title: "Atoms/HorizontalList",
|
|
5
|
-
component:
|
|
9
|
+
component: o,
|
|
6
10
|
argTypes: {
|
|
7
11
|
separator: {
|
|
8
12
|
control: "text"
|
|
9
13
|
}
|
|
10
14
|
},
|
|
11
15
|
parameters: {
|
|
12
|
-
inspectComponent:
|
|
13
|
-
codeString:
|
|
16
|
+
inspectComponent: o,
|
|
17
|
+
codeString: n
|
|
18
|
+
}
|
|
19
|
+
}, s = (a) => /* @__PURE__ */ t(o, { ...a }), l = s.bind({});
|
|
20
|
+
l.args = {
|
|
21
|
+
values: ["Curabitur consequat", "Lectus sit amet luctus vulputate", "Nisi semi mattis"]
|
|
22
|
+
};
|
|
23
|
+
const e = s.bind({});
|
|
24
|
+
e.args = {
|
|
25
|
+
values: [
|
|
26
|
+
/* @__PURE__ */ t("a", { href: "/?path=/story/atoms-horizontallist--with-complex-content", children: "Curabitur consequat" }, "1"),
|
|
27
|
+
/* @__PURE__ */ t(i, { type: "button", variant: "primary", children: "Lectus sit amet luctus vulputate" }, "2"),
|
|
28
|
+
/* @__PURE__ */ t(r, { name: "Sparkles" }, "3"),
|
|
29
|
+
/* @__PURE__ */ t("strong", { children: "Nisi semi mattis" }, "4")
|
|
30
|
+
],
|
|
31
|
+
separator: /* @__PURE__ */ t(r, { name: "CheveronRight", size: 12 })
|
|
32
|
+
};
|
|
33
|
+
e.argTypes = {
|
|
34
|
+
...e.argTypes,
|
|
35
|
+
separator: {
|
|
36
|
+
table: {
|
|
37
|
+
disable: !0
|
|
38
|
+
// Disable separator controls for this specific story
|
|
39
|
+
}
|
|
14
40
|
}
|
|
15
|
-
}, e = (o) => /* @__PURE__ */ s(t, { ...o }), r = {
|
|
16
|
-
values: ["Curabitur consequat", "Lectus sit amet luctus vulputate", "Nisi semi mattis"],
|
|
17
|
-
separator: "•"
|
|
18
|
-
}, i = e.bind({});
|
|
19
|
-
i.args = {
|
|
20
|
-
...r
|
|
21
41
|
};
|
|
22
42
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
l as HorizontalListExample,
|
|
44
|
+
e as WithComplexContent,
|
|
45
|
+
g as default
|
|
25
46
|
};
|
|
26
47
|
//# sourceMappingURL=HorizontalList.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HorizontalList.stories.js","sources":["../../../src/components/HorizontalList/HorizontalList.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { HorizontalListProps } from './HorizontalList';\n\nimport { HorizontalList } from './HorizontalList';\n\nconst codeString = '<HorizontalList values={values} separator=\"•\" />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/HorizontalList',\n component: HorizontalList,\n argTypes: {\n separator: {\n control: 'text',\n },\n },\n parameters: {\n inspectComponent: HorizontalList,\n codeString: codeString,\n },\n} as Meta<HorizontalListProps>;\n\nconst Template: StoryFn<HorizontalListProps> = (args) => <HorizontalList {...args} />;\n\
|
|
1
|
+
{"version":3,"file":"HorizontalList.stories.js","sources":["../../../src/components/HorizontalList/HorizontalList.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { HorizontalListProps } from './HorizontalList';\n\nimport { HorizontalList } from './HorizontalList';\n\nimport { Button } from 'components/Buttons';\nimport { Icon } from 'components/Icon';\n\nconst codeString = '<HorizontalList values={values} separator=\"•\" />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/HorizontalList',\n component: HorizontalList,\n argTypes: {\n separator: {\n control: 'text',\n },\n },\n parameters: {\n inspectComponent: HorizontalList,\n codeString: codeString,\n },\n} as Meta<HorizontalListProps>;\n\nconst Template: StoryFn<HorizontalListProps> = (args) => <HorizontalList {...args} />;\n\nexport const HorizontalListExample = Template.bind({});\nHorizontalListExample.args = {\n values: ['Curabitur consequat', 'Lectus sit amet luctus vulputate', 'Nisi semi mattis'],\n};\n\nexport const WithComplexContent = Template.bind({});\nWithComplexContent.args = {\n values: [\n <a href=\"/?path=/story/atoms-horizontallist--with-complex-content\" key=\"1\">\n Curabitur consequat\n </a>,\n <Button type=\"button\" variant=\"primary\" key=\"2\">\n Lectus sit amet luctus vulputate\n </Button>,\n <Icon name=\"Sparkles\" key=\"3\" />,\n <strong key=\"4\">Nisi semi mattis</strong>,\n ],\n separator: <Icon name=\"CheveronRight\" size={12} />,\n};\n\nWithComplexContent.argTypes = {\n ...WithComplexContent.argTypes,\n separator: {\n table: {\n disable: true, // Disable separator controls for this specific story\n },\n },\n};\n"],"names":["codeString","HorizontalList_stories","HorizontalList","Template","args","jsx","HorizontalListExample","WithComplexContent","Button","Icon"],"mappings":";;;;;;AAQA,MAAMA,IAAa,oDAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAyC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAgB,GAAGE,EAAM,CAAA,GAEtEE,IAAwBH,EAAS,KAAK,EAAE;AACrDG,EAAsB,OAAO;AAAA,EAC3B,QAAQ,CAAC,uBAAuB,oCAAoC,kBAAkB;AACxF;AAEO,MAAMC,IAAqBJ,EAAS,KAAK,EAAE;AAClDI,EAAmB,OAAO;AAAA,EACxB,QAAQ;AAAA,IACL,gBAAAF,EAAA,KAAA,EAAE,MAAK,4DAAmE,mCAAJ,GAEvE;AAAA,sBACCG,GAAO,EAAA,MAAK,UAAS,SAAQ,WAAkB,gDAAJ,GAE5C;AAAA,IACC,gBAAAH,EAAAI,GAAA,EAAK,MAAK,WAAA,GAAe,GAAI;AAAA,IAC9B,gBAAAJ,EAAC,UAAe,EAAA,UAAA,mBAAA,GAAJ,GAAoB;AAAA,EAClC;AAAA,EACA,WAAY,gBAAAA,EAAAI,GAAA,EAAK,MAAK,iBAAgB,MAAM,IAAI;AAClD;AAEAF,EAAmB,WAAW;AAAA,EAC5B,GAAGA,EAAmB;AAAA,EACtB,WAAW;AAAA,IACT,OAAO;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,EACF;AACF;"}
|
|
@@ -5,7 +5,7 @@ export interface IconProps extends Omit<SVGAttributes<SVGElement>, 'height' | 'w
|
|
|
5
5
|
/** The name of the icon to render. */
|
|
6
6
|
name: IconName;
|
|
7
7
|
/** The size (in pixels) of the icon to render. */
|
|
8
|
-
size?: 16 | 20 | 24 | 32 | 48 | 64 | 96 | 128;
|
|
8
|
+
size?: 12 | 16 | 20 | 24 | 32 | 48 | 64 | 96 | 128;
|
|
9
9
|
/** The title used for a tooltip. */
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { ReactNode, SVGAttributes } from 'react';\n\nimport { Icons } from './icons';\n\ntype IconName = keyof typeof Icons;\n\nexport interface IconProps extends Omit<SVGAttributes<SVGElement>, 'height' | 'width'> {\n /** The name of the icon to render. */\n name: IconName;\n /** The size (in pixels) of the icon to render. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n size?: 16 | 20 | 24 | 32 | 48 | 64 | 96 | 128;\n /** The title used for a tooltip. */\n title?: string;\n}\n\nconst defaultSize = 24;\n\n/** Represents a component to render an icon. */\nexport const Icon = ({ name, size = defaultSize, title, ...restProps }: IconProps): ReactNode => {\n const Icon = Icons[name];\n\n return <Icon aria-hidden={true} height={size} width={size} title={title} {...restProps} />;\n};\n"],"names":["defaultSize","Icon","name","size","title","restProps","Icons","jsx"],"mappings":";;AAgBA,MAAMA,IAAc,IAGPC,IAAO,CAAC,EAAE,MAAAC,GAAM,MAAAC,IAAOH,GAAa,OAAAI,GAAO,GAAGC,QAAsC;AACzFJ,QAAAA,IAAOK,EAAMJ,CAAI;AAEhB,SAAA,gBAAAK,EAACN,GAAA,EAAK,eAAa,IAAM,QAAQE,GAAM,OAAOA,GAAM,OAAAC,GAAe,GAAGC,EAAW,CAAA;AAC1F;"}
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { ReactNode, SVGAttributes } from 'react';\n\nimport { Icons } from './icons';\n\ntype IconName = keyof typeof Icons;\n\nexport interface IconProps extends Omit<SVGAttributes<SVGElement>, 'height' | 'width'> {\n /** The name of the icon to render. */\n name: IconName;\n /** The size (in pixels) of the icon to render. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n size?: 12 | 16 | 20 | 24 | 32 | 48 | 64 | 96 | 128;\n /** The title used for a tooltip. */\n title?: string;\n}\n\nconst defaultSize = 24;\n\n/** Represents a component to render an icon. */\nexport const Icon = ({ name, size = defaultSize, title, ...restProps }: IconProps): ReactNode => {\n const Icon = Icons[name];\n\n return <Icon aria-hidden={true} height={size} width={size} title={title} {...restProps} />;\n};\n"],"names":["defaultSize","Icon","name","size","title","restProps","Icons","jsx"],"mappings":";;AAgBA,MAAMA,IAAc,IAGPC,IAAO,CAAC,EAAE,MAAAC,GAAM,MAAAC,IAAOH,GAAa,OAAAI,GAAO,GAAGC,QAAsC;AACzFJ,QAAAA,IAAOK,EAAMJ,CAAI;AAEhB,SAAA,gBAAAK,EAACN,GAAA,EAAK,eAAa,IAAM,QAAQE,GAAM,OAAOA,GAAM,OAAAC,GAAe,GAAGC,EAAW,CAAA;AAC1F;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uva-glass/component-library",
|
|
3
3
|
"author": "Team Glass - Frontend vrienden",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.52.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"eslint": "^8.57.1",
|
|
68
68
|
"eslint-config-prettier": "^9.1.0",
|
|
69
69
|
"eslint-plugin-prettier": "^5.2.1",
|
|
70
|
-
"eslint-plugin-react": "^7.37.
|
|
70
|
+
"eslint-plugin-react": "^7.37.1",
|
|
71
71
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
72
72
|
"eslint-plugin-react-refresh": "^0.4.12",
|
|
73
73
|
"eslint-plugin-storybook": "^0.9.0",
|