@uva-glass/component-library 1.17.1 → 1.19.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.
Files changed (31) hide show
  1. package/dist/assets/Backdrop.css +1 -0
  2. package/dist/assets/Backdrop2.css +1 -0
  3. package/dist/assets/Container.css +1 -1
  4. package/dist/assets/Tooltip.css +1 -0
  5. package/dist/components/Backdrop/Backdrop.d.ts +4 -0
  6. package/dist/components/Backdrop/Backdrop.js +8 -0
  7. package/dist/components/Backdrop/Backdrop.js.map +1 -0
  8. package/dist/components/Backdrop/Backdrop.stories.d.ts +8 -0
  9. package/dist/components/Backdrop/Backdrop.stories.js +25 -0
  10. package/dist/components/Backdrop/Backdrop.stories.js.map +1 -0
  11. package/dist/components/Backdrop/index.d.ts +1 -0
  12. package/dist/components/Backdrop/index.js +5 -0
  13. package/dist/components/Backdrop/index.js.map +1 -0
  14. package/dist/components/Tooltip/Tooltip.d.ts +10 -0
  15. package/dist/components/Tooltip/Tooltip.js +76 -0
  16. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  17. package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
  18. package/dist/components/Tooltip/Tooltip.stories.js +29 -0
  19. package/dist/components/Tooltip/Tooltip.stories.js.map +1 -0
  20. package/dist/components/Tooltip/index.d.ts +1 -0
  21. package/dist/components/Tooltip/index.js +5 -0
  22. package/dist/components/Tooltip/index.js.map +1 -0
  23. package/dist/components/index.d.ts +2 -0
  24. package/dist/components/index.js +39 -35
  25. package/dist/components/index.js.map +1 -1
  26. package/dist/components/storyComponents/Container/Container.d.ts +3 -1
  27. package/dist/components/storyComponents/Container/Container.js +22 -13
  28. package/dist/components/storyComponents/Container/Container.js.map +1 -1
  29. package/dist/index.js +39 -35
  30. package/dist/index.js.map +1 -1
  31. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ ._backdrop_k1x6d_1{bottom:0;left:0;position:fixed;right:0;top:0;z-index:100}@media (min-width: 28rem) and (min-height: 28rem){._backdrop_k1x6d_1{align-items:center;background:var(--color-black-transparent);display:flex;justify-content:center}}
@@ -0,0 +1 @@
1
+ .container{align-items:center;background-color:var(--color-white);border:2px dotted var(--color-black);display:flex;height:10rem;justify-content:center;padding:1rem;position:relative;width:10rem}
@@ -1 +1 @@
1
- ._container_13q1e_1{background-color:var(--color-white);border:2px dotted var(--color-black);padding:1rem;position:relative}._container--small_13q1e_8{height:10rem;width:10rem}._container--medium_13q1e_13{height:30rem;width:30rem}._container--large_13q1e_18{height:50rem;width:50rem}
1
+ ._container_dkfb2_1{background-color:var(--color-white);border:2px dotted var(--color-black);padding:1rem;position:relative}._container--small_dkfb2_8{height:10rem;width:10rem}._container--medium_dkfb2_13{height:30rem;width:30rem}._container--large_dkfb2_18{height:50rem;width:50rem}._container--hidden_dkfb2_23{display:none}._container--centered-content_dkfb2_27{display:flex;align-items:center;justify-content:center}
@@ -0,0 +1 @@
1
+ ._tooltip-container_g4g5w_1{align-items:flex-end;cursor:help;display:flex;position:relative}._tooltip_small_g4g5w_8,._tooltip_medium_g4g5w_9,._tooltip_large_g4g5w_10{background-color:var(--color-scarpa-flow);border-radius:.5rem;color:var(--color-white);font-weight:400;padding:.5rem;position:fixed;text-align:center;transform:translate(-50%,-50%);white-space:normal;z-index:10}._tooltip_small_g4g5w_8{height:4rem;width:14.5rem}._tooltip_medium_g4g5w_9{height:5.5rem;width:20rem}._tooltip_large_g4g5w_10{height:5.5rem;width:24.5rem}._tooltip_small_g4g5w_8:before,._tooltip_medium_g4g5w_9:before,._tooltip_large_g4g5w_10:before{border:.5rem solid transparent;border-top-color:var(--color-scarpa-flow);content:"";height:0;position:absolute;width:0}._tooltip_small_g4g5w_8:before{right:1rem;top:4rem}._tooltip_medium_g4g5w_9:before{right:3rem;top:5.5rem}._tooltip_large_g4g5w_10:before{right:4rem;top:5.5rem}._tooltip_under-trigger_g4g5w_64{background-color:var(--color-scarpa-flow);border-radius:.5rem;color:var(--color-white);font-weight:400;max-width:calc(100vw - 2rem);padding:.25rem 1rem;position:fixed;right:1rem;top:3.5rem}._tooltip_under-trigger_g4g5w_64:before{border-bottom:.5rem solid var(--color-scarpa-flow);border-left:.5rem solid transparent;border-right:.5rem solid transparent;content:"";height:0;position:absolute;right:3.5rem;top:-.5rem;width:0}@media (min-width: 50rem){._tooltip_under-trigger_g4g5w_64{right:.5rem}}
@@ -0,0 +1,4 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ export type BackdropProps = Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style'>;
4
+ export declare const Backdrop: ({ children, ...restProps }: BackdropProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import '../../assets/Backdrop.css';const s = "_backdrop_k1x6d_1", a = {
3
+ backdrop: s
4
+ }, p = ({ children: o, ...c }) => /* @__PURE__ */ r("div", { ...c, className: a.backdrop, children: o });
5
+ export {
6
+ p as Backdrop
7
+ };
8
+ //# sourceMappingURL=Backdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Backdrop.js","sources":["../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport styles from './Backdrop.module.css';\n\nexport type BackdropProps = Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style'>;\n\nexport const Backdrop = ({ children, ...restProps }: BackdropProps) => (\n <div {...restProps} className={styles['backdrop']}>\n {children}\n </div>\n);\n"],"names":["Backdrop","children","restProps","jsx","styles"],"mappings":";;;GAMaA,IAAW,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAU,MAC/C,gBAAAC,EAAA,OAAA,EAAK,GAAGD,GAAW,WAAWE,EAAO,UACnC,UAAAH,EACH,CAAA;"}
@@ -0,0 +1,8 @@
1
+ import { BackdropProps } from './Backdrop';
2
+
3
+ type BackdropStoryProps = BackdropProps & {
4
+ visible: boolean;
5
+ };
6
+ declare const _default: import('@storybook/types').ComponentAnnotations<import('@storybook/react').ReactRenderer, BackdropStoryProps>;
7
+ export default _default;
8
+ export declare const BackdropExample: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, BackdropStoryProps>;
@@ -0,0 +1,25 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Backdrop as r } from "./Backdrop.js";
3
+ import { Container as i } from "../storyComponents/Container/Container.js";
4
+ import '../../assets/Backdrop2.css';const s = {
5
+ title: "Atoms/Backdrop",
6
+ component: r,
7
+ argTypes: {
8
+ children: {
9
+ control: "text"
10
+ },
11
+ visible: {
12
+ control: "boolean",
13
+ name: "Show Backdrop"
14
+ }
15
+ }
16
+ }, t = (o) => /* @__PURE__ */ e(i, { visible: o.visible, children: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("div", { className: "container", children: o.children }) }) }), n = t.bind({});
17
+ n.args = {
18
+ visible: !0,
19
+ children: "Dummy Overlay"
20
+ };
21
+ export {
22
+ n as BackdropExample,
23
+ s as default
24
+ };
25
+ //# sourceMappingURL=Backdrop.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Backdrop.stories.js","sources":["../../../src/components/Backdrop/Backdrop.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { BackdropProps } from './Backdrop';\n\nimport { Backdrop } from './Backdrop';\n\nimport { Container } from 'components/storyComponents/Container';\n\nimport './Backdrop.stories.css';\n\ntype BackdropStoryProps = BackdropProps & { visible: boolean };\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Backdrop',\n component: Backdrop,\n argTypes: {\n children: {\n control: 'text',\n },\n visible: {\n control: 'boolean',\n name: 'Show Backdrop',\n },\n },\n} as Meta<BackdropStoryProps>;\n\nconst Template: StoryFn<BackdropStoryProps> = (args) => {\n return (\n <Container visible={args.visible}>\n <Backdrop>\n <div className=\"container\">{args.children}</div>\n </Backdrop>\n </Container>\n );\n};\n\nexport const BackdropExample = Template.bind({});\nBackdropExample.args = {\n visible: true,\n children: 'Dummy Overlay',\n};\n"],"names":["Backdrop_stories","Backdrop","Template","args","jsx","Container","BackdropExample"],"mappings":";;;AAYA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,IACA,SAAS;AAAA,MACP,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF,GAEMC,IAAwC,CAACC,MAE1C,gBAAAC,EAAAC,GAAA,EAAU,SAASF,EAAK,SACvB,UAAC,gBAAAC,EAAAH,GAAA,EACC,UAAC,gBAAAG,EAAA,OAAA,EAAI,WAAU,aAAa,UAAKD,EAAA,SAAS,CAAA,GAC5C,EACF,CAAA,GAISG,IAAkBJ,EAAS,KAAK,EAAE;AAC/CI,EAAgB,OAAO;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AACZ;"}
@@ -0,0 +1 @@
1
+ export * from './Backdrop';
@@ -0,0 +1,5 @@
1
+ import { Backdrop as p } from "./Backdrop.js";
2
+ export {
3
+ p as Backdrop
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface TooltipProps {
4
+ element: ReactNode;
5
+ id: string;
6
+ text: string;
7
+ size?: 'small' | 'medium' | 'large';
8
+ openUnderTrigger?: boolean;
9
+ }
10
+ export declare function Tooltip({ element, id, text, size, openUnderTrigger }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { jsxs as M, jsx as R } from "react/jsx-runtime";
2
+ import { useRef as y, useState as E, useCallback as b, useEffect as p } from "react";
3
+ import '../../assets/Tooltip.css';const j = "_tooltip_small_g4g5w_8", I = "_tooltip_medium_g4g5w_9", N = "_tooltip_large_g4g5w_10", f = {
4
+ "tooltip-container": "_tooltip-container_g4g5w_1",
5
+ tooltip_small: j,
6
+ tooltip_medium: I,
7
+ tooltip_large: N,
8
+ "tooltip_under-trigger": "_tooltip_under-trigger_g4g5w_64"
9
+ };
10
+ function Y({ element: L, id: _, text: k, size: n = "medium", openUnderTrigger: s = !1 }) {
11
+ const l = y(null), c = y(null), [i, o] = E(!1), [d, x] = E({ top: 0, left: 0 }), g = n === "small" && 20 || n === "large" && 35 || 27, m = n === "small" && 25 || n === "large" && 70 || 47, e = b(() => {
12
+ if (l.current && c.current) {
13
+ const t = l.current.getBoundingClientRect(), h = c.current.getBoundingClientRect(), a = window.scrollY, O = window.scrollX;
14
+ let r = t.top + a + g - h.height;
15
+ const B = t.left + O + m + (t.width - h.width) / 2;
16
+ r -= a, r < 0 && (r = t.bottom + a), x({ top: r, left: B });
17
+ }
18
+ }, [m, g]), u = b(
19
+ (t) => {
20
+ t.key === "Escape" && o(!1);
21
+ },
22
+ [o]
23
+ );
24
+ function w() {
25
+ o(!0);
26
+ }
27
+ function v() {
28
+ o(!1);
29
+ }
30
+ function C() {
31
+ o(!i);
32
+ }
33
+ return p(() => {
34
+ if (!l.current)
35
+ return;
36
+ const t = l.current;
37
+ return t.addEventListener("keyup", u, !0), () => {
38
+ t.removeEventListener("keyup", u, !0);
39
+ };
40
+ }, [u]), p(() => (e(), window.addEventListener("resize", e), () => {
41
+ window.removeEventListener("resize", e);
42
+ }), [e]), p(() => {
43
+ i && !s && e();
44
+ }, [i, s, e]), /* @__PURE__ */ M(
45
+ "div",
46
+ {
47
+ className: f["tooltip-container"],
48
+ onBlur: v,
49
+ onFocus: w,
50
+ onMouseEnter: w,
51
+ onMouseLeave: v,
52
+ onMouseUp: C,
53
+ ref: l,
54
+ role: "button",
55
+ tabIndex: -1,
56
+ children: [
57
+ /* @__PURE__ */ R("div", { "aria-describedby": i ? _ : void 0, children: L }),
58
+ i && /* @__PURE__ */ R(
59
+ "span",
60
+ {
61
+ ref: c,
62
+ className: s ? f["tooltip_under-trigger"] : f[`tooltip_${n}`],
63
+ id: _,
64
+ role: "tooltip",
65
+ style: s ? {} : { top: d.top, left: d.left },
66
+ children: k
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ export {
74
+ Y as Tooltip
75
+ };
76
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './Tooltip.module.css';\n\nexport interface TooltipProps {\n element: ReactNode;\n id: string;\n text: string;\n size?: 'small' | 'medium' | 'large';\n openUnderTrigger?: boolean;\n}\n\nexport function Tooltip({ element, id, text, size = 'medium', openUnderTrigger = false }: TooltipProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLSpanElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n\n /* eslint-disable @typescript-eslint/no-magic-numbers */\n const topOffset = (size === 'small' && 20) || (size === 'large' && 35) || 27;\n const leftOffset = (size === 'small' && 25) || (size === 'large' && 70) || 47;\n /* eslint-enable @typescript-eslint/no-magic-numbers */\n\n const calculatePosition = useCallback(() => {\n if (containerRef.current && tooltipRef.current) {\n const triggerRect = containerRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const scrollY = window.scrollY;\n const scrollX = window.scrollX;\n let top = triggerRect.top + scrollY + topOffset - tooltipRect.height;\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const left = triggerRect.left + scrollX + leftOffset + (triggerRect.width - tooltipRect.width) / 2;\n\n // Adjust top position to account for page scrolling\n top -= scrollY;\n\n // Position tooltip below if it would be above the viewport\n if (top < 0) {\n top = triggerRect.bottom + scrollY;\n }\n\n setPosition({ top, left });\n }\n }, [leftOffset, topOffset]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsOpen(false);\n }\n },\n [setIsOpen]\n );\n\n function show() {\n setIsOpen(true);\n }\n\n function hide() {\n setIsOpen(false);\n }\n\n function toggle() {\n if (isOpen) setIsOpen(false);\n else setIsOpen(true);\n }\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const tooltipContainerRef = containerRef.current;\n\n tooltipContainerRef.addEventListener('keyup', onKeyUp, true);\n\n return () => {\n tooltipContainerRef.removeEventListener('keyup', onKeyUp, true);\n };\n }, [onKeyUp]);\n\n useEffect(() => {\n calculatePosition();\n window.addEventListener('resize', calculatePosition);\n return () => {\n window.removeEventListener('resize', calculatePosition);\n };\n }, [calculatePosition]);\n\n useEffect(() => {\n // Recalculate position when isOpen changes\n if (isOpen && !openUnderTrigger) {\n calculatePosition();\n }\n }, [isOpen, openUnderTrigger, calculatePosition]);\n\n return (\n <div\n className={styles['tooltip-container']}\n onBlur={hide}\n onFocus={show}\n onMouseEnter={show}\n onMouseLeave={hide}\n onMouseUp={toggle}\n ref={containerRef}\n role=\"button\"\n tabIndex={-1}\n >\n <div aria-describedby={isOpen ? id : undefined}>{element}</div>\n {isOpen && (\n <span\n ref={tooltipRef}\n className={openUnderTrigger ? styles['tooltip_under-trigger'] : styles[`tooltip_${size}`]}\n id={id}\n role=\"tooltip\"\n style={openUnderTrigger ? {} : { top: position.top, left: position.left }}\n >\n {text}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Tooltip","element","id","text","size","openUnderTrigger","containerRef","useRef","tooltipRef","isOpen","setIsOpen","useState","position","setPosition","topOffset","leftOffset","calculatePosition","useCallback","triggerRect","tooltipRect","scrollY","scrollX","top","left","onKeyUp","event","show","hide","toggle","useEffect","tooltipContainerRef","jsxs","styles","jsx"],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import { TooltipProps } from './Tooltip';
2
+
3
+ declare const _default: import('@storybook/types').ComponentAnnotations<import('@storybook/react').ReactRenderer, TooltipProps>;
4
+ export default _default;
5
+ export declare const TooltipExample: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, TooltipProps>;
@@ -0,0 +1,29 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Tooltip as e } from "./Tooltip.js";
3
+ import { Container as r } from "../storyComponents/Container/Container.js";
4
+ const s = {
5
+ title: "Atoms/Tooltip",
6
+ component: e,
7
+ argTypes: {
8
+ element: {
9
+ control: "text"
10
+ },
11
+ // Disable openUnderTrigger controls as this as this is a Lens specific prop that we should not use in other places.
12
+ // This is still needed until Lens structure is reworked.
13
+ openUnderTrigger: {
14
+ table: {
15
+ disable: !0
16
+ }
17
+ }
18
+ }
19
+ }, i = (o) => /* @__PURE__ */ t(r, { centerContent: !0, children: /* @__PURE__ */ t(e, { ...o }) }), n = i.bind({});
20
+ n.args = {
21
+ element: "Tooltip Trigger",
22
+ id: "52fcc9e9",
23
+ text: "Here is your Tooltip"
24
+ };
25
+ export {
26
+ n as TooltipExample,
27
+ s as default
28
+ };
29
+ //# sourceMappingURL=Tooltip.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.stories.js","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { TooltipProps } from './Tooltip';\n\nimport { Tooltip } from './Tooltip';\n\nimport { Container } from 'components/storyComponents/Container';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Tooltip',\n component: Tooltip,\n argTypes: {\n element: {\n control: 'text',\n },\n // Disable openUnderTrigger controls as this as this is a Lens specific prop that we should not use in other places.\n // This is still needed until Lens structure is reworked.\n openUnderTrigger: {\n table: {\n disable: true,\n },\n },\n },\n} as Meta<TooltipProps>;\n\nconst Template: StoryFn<TooltipProps> = (args) => (\n <Container centerContent>\n <Tooltip {...args} />\n </Container>\n);\n\nexport const TooltipExample = Template.bind({});\nTooltipExample.args = {\n element: 'Tooltip Trigger',\n id: '52fcc9e9',\n text: 'Here is your Tooltip',\n};\n"],"names":["Tooltip_stories","Tooltip","Template","args","jsx","Container","TooltipExample"],"mappings":";;;AAQA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,kBAAkB;AAAA,MAChB,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAkC,CAACC,MACtC,gBAAAC,EAAAC,GAAA,EAAU,eAAa,IACtB,UAAC,gBAAAD,EAAAH,GAAA,EAAS,GAAGE,EAAM,CAAA,EACrB,CAAA,GAGWG,IAAiBJ,EAAS,KAAK,EAAE;AAC9CI,EAAe,OAAO;AAAA,EACpB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,MAAM;AACR;"}
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
@@ -0,0 +1,5 @@
1
+ import { Tooltip as r } from "./Tooltip.js";
2
+ export {
3
+ r as Tooltip
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,5 @@
1
1
  export * from './AppStatusBar';
2
+ export * from './Backdrop';
2
3
  export * from './Button';
3
4
  export * from './Card';
4
5
  export * from './FieldHint';
@@ -16,3 +17,4 @@ export * from './SectionNotification';
16
17
  export * from './SelectListbox';
17
18
  export * from './SelectListbox/SelectProvider';
18
19
  export * from './Spinner';
20
+ export * from './Tooltip';
@@ -1,40 +1,44 @@
1
1
  import { AppStatusBar as t } from "./AppStatusBar/AppStatusBar.js";
2
- import { Button as p } from "./Button/Button.js";
3
- import { Card as x } from "./Card/Card.js";
4
- import { FieldHint as n } from "./FieldHint/FieldHint.js";
5
- import { Icon as a } from "./Icon/Icon.js";
6
- import { IconButton as l } from "./IconButton/IconButton.js";
7
- import { InfoMessage as c } from "./InfoMessage/InfoMessage.js";
8
- import { Input as d } from "./Input/Input.js";
9
- import { InputField as I } from "./InputField/InputField.js";
10
- import { Label as M } from "./Label/Label.js";
11
- import { M as v } from "../MenuLink-DDAin3rf.js";
12
- import { MetaDataList as F } from "./MetaDataList/MetaDataList.js";
13
- import { OverlayCloseButton as k } from "./OverlayCloseButton/OverlayCloseButton.js";
14
- import { RadioButton as A } from "./RadioButton/RadioButton.js";
15
- import { SectionNotification as H } from "./SectionNotification/SectionNotification.js";
16
- import { SelectListbox as O } from "./SelectListbox/SelectListbox.js";
17
- import { SelectProvider as R, useSelect as h } from "./SelectListbox/SelectProvider.js";
18
- import { Spinner as q } from "./Spinner/Spinner.js";
2
+ import { Backdrop as p } from "./Backdrop/Backdrop.js";
3
+ import { Button as x } from "./Button/Button.js";
4
+ import { Card as n } from "./Card/Card.js";
5
+ import { FieldHint as a } from "./FieldHint/FieldHint.js";
6
+ import { Icon as u } from "./Icon/Icon.js";
7
+ import { IconButton as s } from "./IconButton/IconButton.js";
8
+ import { InfoMessage as B } from "./InfoMessage/InfoMessage.js";
9
+ import { Input as I } from "./Input/Input.js";
10
+ import { InputField as M } from "./InputField/InputField.js";
11
+ import { Label as k } from "./Label/Label.js";
12
+ import { M as C } from "../MenuLink-DDAin3rf.js";
13
+ import { MetaDataList as g } from "./MetaDataList/MetaDataList.js";
14
+ import { OverlayCloseButton as A } from "./OverlayCloseButton/OverlayCloseButton.js";
15
+ import { RadioButton as H } from "./RadioButton/RadioButton.js";
16
+ import { SectionNotification as O } from "./SectionNotification/SectionNotification.js";
17
+ import { SelectListbox as R } from "./SelectListbox/SelectListbox.js";
18
+ import { SelectProvider as h, useSelect as j } from "./SelectListbox/SelectProvider.js";
19
+ import { Spinner as w } from "./Spinner/Spinner.js";
20
+ import { Tooltip as E } from "./Tooltip/Tooltip.js";
19
21
  export {
20
22
  t as AppStatusBar,
21
- p as Button,
22
- x as Card,
23
- n as FieldHint,
24
- a as Icon,
25
- l as IconButton,
26
- c as InfoMessage,
27
- d as Input,
28
- I as InputField,
29
- M as Label,
30
- v as MenuLink,
31
- F as MetaDataList,
32
- k as OverlayCloseButton,
33
- A as RadioButton,
34
- H as SectionNotification,
35
- O as SelectListbox,
36
- R as SelectProvider,
37
- q as Spinner,
38
- h as useSelect
23
+ p as Backdrop,
24
+ x as Button,
25
+ n as Card,
26
+ a as FieldHint,
27
+ u as Icon,
28
+ s as IconButton,
29
+ B as InfoMessage,
30
+ I as Input,
31
+ M as InputField,
32
+ k as Label,
33
+ C as MenuLink,
34
+ g as MetaDataList,
35
+ A as OverlayCloseButton,
36
+ H as RadioButton,
37
+ O as SectionNotification,
38
+ R as SelectListbox,
39
+ h as SelectProvider,
40
+ w as Spinner,
41
+ E as Tooltip,
42
+ j as useSelect
39
43
  };
40
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -2,6 +2,8 @@ import { PropsWithChildren } from 'react';
2
2
 
3
3
  interface ContainerProps {
4
4
  size?: 'small' | 'medium' | 'large';
5
+ visible?: boolean;
6
+ centerContent?: boolean;
5
7
  }
6
- export declare const Container: ({ children, size }: PropsWithChildren<ContainerProps>) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Container: ({ children, size, centerContent, visible, }: PropsWithChildren<ContainerProps>) => import("react/jsx-runtime").JSX.Element;
7
9
  export {};
@@ -1,22 +1,31 @@
1
- import { jsxs as o, Fragment as t, jsx as r } from "react/jsx-runtime";
2
- import { c as i } from "../../../clsx-DB4S2d7J.js";
3
- import '../../../assets/Container.css';const c = "_container_13q1e_1", n = {
4
- container: c,
5
- "container--small": "_container--small_13q1e_8",
6
- "container--medium": "_container--medium_13q1e_13",
7
- "container--large": "_container--large_13q1e_18"
8
- }, s = ({ children: a, size: e = "medium" }) => /* @__PURE__ */ o(t, { children: [
9
- /* @__PURE__ */ r("label", { htmlFor: "container", children: "Storybook container with 1rem padding" }),
10
- /* @__PURE__ */ r(
1
+ import { jsxs as i, Fragment as c, jsx as t } from "react/jsx-runtime";
2
+ import { c as d } from "../../../clsx-DB4S2d7J.js";
3
+ import '../../../assets/Container.css';const m = "_container_dkfb2_1", n = {
4
+ container: m,
5
+ "container--small": "_container--small_dkfb2_8",
6
+ "container--medium": "_container--medium_dkfb2_13",
7
+ "container--large": "_container--large_dkfb2_18",
8
+ "container--hidden": "_container--hidden_dkfb2_23",
9
+ "container--centered-content": "_container--centered-content_dkfb2_27"
10
+ }, s = ({
11
+ children: r,
12
+ size: e = "medium",
13
+ centerContent: a = !1,
14
+ visible: o = !0
15
+ }) => /* @__PURE__ */ i(c, { children: [
16
+ /* @__PURE__ */ t("label", { htmlFor: "container", children: "Storybook container with 1rem padding" }),
17
+ /* @__PURE__ */ t(
11
18
  "div",
12
19
  {
13
20
  id: "container",
14
- className: i(n.container, {
21
+ className: d(n.container, {
15
22
  [n["container--small"]]: e === "small",
16
23
  [n["container--medium"]]: e === "medium",
17
- [n["container--large"]]: e === "large"
24
+ [n["container--large"]]: e === "large",
25
+ [n["container--centered-content"]]: a,
26
+ [n["container--hidden"]]: !o
18
27
  }),
19
- children: a
28
+ children: r
20
29
  }
21
30
  )
22
31
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"Container.js","sources":["../../../../src/components/storyComponents/Container/Container.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { PropsWithChildren } from 'react';\n\nimport styles from './Container.module.css';\n\ninterface ContainerProps {\n size?: 'small' | 'medium' | 'large';\n}\n\nexport const Container = ({ children, size = 'medium' }: PropsWithChildren<ContainerProps>) => {\n return (\n <>\n <label htmlFor=\"container\">Storybook container with 1rem padding</label>\n <div\n id=\"container\"\n className={clsx(styles['container'], {\n [styles['container--small']]: size === 'small',\n [styles['container--medium']]: size === 'medium',\n [styles['container--large']]: size === 'large',\n })}\n >\n {children}\n </div>\n </>\n );\n};\n"],"names":["Container","children","size","jsxs","Fragment","jsx","clsx","styles"],"mappings":";;;;;;;GAUaA,IAAY,CAAC,EAAE,UAAAC,GAAU,MAAAC,IAAO,eAGvC,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAC,gBAAAC,EAAA,SAAA,EAAM,SAAQ,aAAY,UAAqC,yCAAA;AAAA,EAChE,gBAAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,WAAWC,EAAKC,EAAO,WAAc;AAAA,QACnC,CAACA,EAAO,kBAAkB,CAAC,GAAGL,MAAS;AAAA,QACvC,CAACK,EAAO,mBAAmB,CAAC,GAAGL,MAAS;AAAA,QACxC,CAACK,EAAO,kBAAkB,CAAC,GAAGL,MAAS;AAAA,MAAA,CACxC;AAAA,MAEA,UAAAD;AAAA,IAAA;AAAA,EACH;AACF,EAAA,CAAA;"}
1
+ {"version":3,"file":"Container.js","sources":["../../../../src/components/storyComponents/Container/Container.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { PropsWithChildren } from 'react';\n\nimport styles from './Container.module.css';\n\ninterface ContainerProps {\n size?: 'small' | 'medium' | 'large';\n visible?: boolean;\n centerContent?: boolean;\n}\n\nexport const Container = ({\n children,\n size = 'medium',\n centerContent = false,\n visible = true,\n}: PropsWithChildren<ContainerProps>) => {\n return (\n <>\n <label htmlFor=\"container\">Storybook container with 1rem padding</label>\n <div\n id=\"container\"\n className={clsx(styles['container'], {\n [styles['container--small']]: size === 'small',\n [styles['container--medium']]: size === 'medium',\n [styles['container--large']]: size === 'large',\n [styles['container--centered-content']]: centerContent,\n [styles['container--hidden']]: !visible,\n })}\n >\n {children}\n </div>\n </>\n );\n};\n"],"names":["Container","children","size","centerContent","visible","jsxs","Fragment","jsx","clsx","styles"],"mappings":";;;;;;;;;GAYaA,IAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,eAAAC,IAAgB;AAAA,EAChB,SAAAC,IAAU;AACZ,MAGM,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,EAAC,gBAAAC,EAAA,SAAA,EAAM,SAAQ,aAAY,UAAqC,yCAAA;AAAA,EAChE,gBAAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,WAAWC,EAAKC,EAAO,WAAc;AAAA,QACnC,CAACA,EAAO,kBAAkB,CAAC,GAAGP,MAAS;AAAA,QACvC,CAACO,EAAO,mBAAmB,CAAC,GAAGP,MAAS;AAAA,QACxC,CAACO,EAAO,kBAAkB,CAAC,GAAGP,MAAS;AAAA,QACvC,CAACO,EAAO,6BAA6B,CAAC,GAAGN;AAAA,QACzC,CAACM,EAAO,mBAAmB,CAAC,GAAG,CAACL;AAAA,MAAA,CACjC;AAAA,MAEA,UAAAH;AAAA,IAAA;AAAA,EACH;AACF,EAAA,CAAA;"}
package/dist/index.js CHANGED
@@ -1,40 +1,44 @@
1
1
  import { AppStatusBar as t } from "./components/AppStatusBar/AppStatusBar.js";
2
- import { Button as p } from "./components/Button/Button.js";
3
- import { Card as x } from "./components/Card/Card.js";
4
- import { FieldHint as n } from "./components/FieldHint/FieldHint.js";
5
- import { Icon as a } from "./components/Icon/Icon.js";
6
- import { IconButton as l } from "./components/IconButton/IconButton.js";
7
- import { InfoMessage as c } from "./components/InfoMessage/InfoMessage.js";
8
- import { Input as d } from "./components/Input/Input.js";
9
- import { InputField as I } from "./components/InputField/InputField.js";
10
- import { Label as M } from "./components/Label/Label.js";
11
- import { M as v } from "./MenuLink-DDAin3rf.js";
12
- import { MetaDataList as F } from "./components/MetaDataList/MetaDataList.js";
13
- import { OverlayCloseButton as k } from "./components/OverlayCloseButton/OverlayCloseButton.js";
14
- import { RadioButton as A } from "./components/RadioButton/RadioButton.js";
15
- import { SectionNotification as H } from "./components/SectionNotification/SectionNotification.js";
16
- import { SelectListbox as O } from "./components/SelectListbox/SelectListbox.js";
17
- import { SelectProvider as R, useSelect as h } from "./components/SelectListbox/SelectProvider.js";
18
- import { Spinner as q } from "./components/Spinner/Spinner.js";
2
+ import { Backdrop as p } from "./components/Backdrop/Backdrop.js";
3
+ import { Button as x } from "./components/Button/Button.js";
4
+ import { Card as n } from "./components/Card/Card.js";
5
+ import { FieldHint as a } from "./components/FieldHint/FieldHint.js";
6
+ import { Icon as u } from "./components/Icon/Icon.js";
7
+ import { IconButton as s } from "./components/IconButton/IconButton.js";
8
+ import { InfoMessage as B } from "./components/InfoMessage/InfoMessage.js";
9
+ import { Input as I } from "./components/Input/Input.js";
10
+ import { InputField as M } from "./components/InputField/InputField.js";
11
+ import { Label as k } from "./components/Label/Label.js";
12
+ import { M as C } from "./MenuLink-DDAin3rf.js";
13
+ import { MetaDataList as g } from "./components/MetaDataList/MetaDataList.js";
14
+ import { OverlayCloseButton as A } from "./components/OverlayCloseButton/OverlayCloseButton.js";
15
+ import { RadioButton as H } from "./components/RadioButton/RadioButton.js";
16
+ import { SectionNotification as O } from "./components/SectionNotification/SectionNotification.js";
17
+ import { SelectListbox as R } from "./components/SelectListbox/SelectListbox.js";
18
+ import { SelectProvider as h, useSelect as j } from "./components/SelectListbox/SelectProvider.js";
19
+ import { Spinner as w } from "./components/Spinner/Spinner.js";
20
+ import { Tooltip as E } from "./components/Tooltip/Tooltip.js";
19
21
  export {
20
22
  t as AppStatusBar,
21
- p as Button,
22
- x as Card,
23
- n as FieldHint,
24
- a as Icon,
25
- l as IconButton,
26
- c as InfoMessage,
27
- d as Input,
28
- I as InputField,
29
- M as Label,
30
- v as MenuLink,
31
- F as MetaDataList,
32
- k as OverlayCloseButton,
33
- A as RadioButton,
34
- H as SectionNotification,
35
- O as SelectListbox,
36
- R as SelectProvider,
37
- q as Spinner,
38
- h as useSelect
23
+ p as Backdrop,
24
+ x as Button,
25
+ n as Card,
26
+ a as FieldHint,
27
+ u as Icon,
28
+ s as IconButton,
29
+ B as InfoMessage,
30
+ I as Input,
31
+ M as InputField,
32
+ k as Label,
33
+ C as MenuLink,
34
+ g as MetaDataList,
35
+ A as OverlayCloseButton,
36
+ H as RadioButton,
37
+ O as SectionNotification,
38
+ R as SelectListbox,
39
+ h as SelectProvider,
40
+ w as Spinner,
41
+ E as Tooltip,
42
+ j as useSelect
39
43
  };
40
44
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
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.17.1",
5
+ "version": "1.19.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -52,7 +52,7 @@
52
52
  "@storybook/react": "^8.1.5",
53
53
  "@storybook/react-vite": "^8.1.5",
54
54
  "@storybook/test": "^8.1.5",
55
- "@types/node": "^20.12.12",
55
+ "@types/node": "^20.12.13",
56
56
  "@types/react": "^18.3.3",
57
57
  "@types/react-dom": "^18.3.0",
58
58
  "@typescript-eslint/eslint-plugin": "^7.11.0",