@uva-glass/component-library 1.18.0 → 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.
- package/dist/assets/Container.css +1 -1
- package/dist/assets/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.js +76 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/components/Tooltip/Tooltip.stories.js +29 -0
- package/dist/components/Tooltip/Tooltip.stories.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +5 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +11 -9
- package/dist/components/index.js.map +1 -1
- package/dist/components/storyComponents/Container/Container.d.ts +2 -1
- package/dist/components/storyComponents/Container/Container.js +22 -15
- package/dist/components/storyComponents/Container/Container.js.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/components/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { AppStatusBar as t } from "./AppStatusBar/AppStatusBar.js";
|
|
|
2
2
|
import { Backdrop as p } from "./Backdrop/Backdrop.js";
|
|
3
3
|
import { Button as x } from "./Button/Button.js";
|
|
4
4
|
import { Card as n } from "./Card/Card.js";
|
|
5
|
-
import { FieldHint as
|
|
6
|
-
import { Icon as
|
|
5
|
+
import { FieldHint as a } from "./FieldHint/FieldHint.js";
|
|
6
|
+
import { Icon as u } from "./Icon/Icon.js";
|
|
7
7
|
import { IconButton as s } from "./IconButton/IconButton.js";
|
|
8
8
|
import { InfoMessage as B } from "./InfoMessage/InfoMessage.js";
|
|
9
9
|
import { Input as I } from "./Input/Input.js";
|
|
@@ -15,15 +15,16 @@ import { OverlayCloseButton as A } from "./OverlayCloseButton/OverlayCloseButton
|
|
|
15
15
|
import { RadioButton as H } from "./RadioButton/RadioButton.js";
|
|
16
16
|
import { SectionNotification as O } from "./SectionNotification/SectionNotification.js";
|
|
17
17
|
import { SelectListbox as R } from "./SelectListbox/SelectListbox.js";
|
|
18
|
-
import { SelectProvider as
|
|
19
|
-
import { Spinner as
|
|
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";
|
|
20
21
|
export {
|
|
21
22
|
t as AppStatusBar,
|
|
22
23
|
p as Backdrop,
|
|
23
24
|
x as Button,
|
|
24
25
|
n as Card,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
a as FieldHint,
|
|
27
|
+
u as Icon,
|
|
27
28
|
s as IconButton,
|
|
28
29
|
B as InfoMessage,
|
|
29
30
|
I as Input,
|
|
@@ -35,8 +36,9 @@ export {
|
|
|
35
36
|
H as RadioButton,
|
|
36
37
|
O as SectionNotification,
|
|
37
38
|
R as SelectListbox,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
h as SelectProvider,
|
|
40
|
+
w as Spinner,
|
|
41
|
+
E as Tooltip,
|
|
42
|
+
j as useSelect
|
|
41
43
|
};
|
|
42
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":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,6 +3,7 @@ import { PropsWithChildren } from 'react';
|
|
|
3
3
|
interface ContainerProps {
|
|
4
4
|
size?: 'small' | 'medium' | 'large';
|
|
5
5
|
visible?: boolean;
|
|
6
|
+
centerContent?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const Container: ({ children, size, visible }: 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;
|
|
8
9
|
export {};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c } from "../../../clsx-DB4S2d7J.js";
|
|
3
|
-
import '../../../assets/Container.css';const
|
|
4
|
-
container:
|
|
5
|
-
"container--small": "_container--
|
|
6
|
-
"container--medium": "_container--
|
|
7
|
-
"container--large": "_container--
|
|
8
|
-
"container--hidden": "_container--
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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(
|
|
12
18
|
"div",
|
|
13
19
|
{
|
|
14
20
|
id: "container",
|
|
15
|
-
className:
|
|
21
|
+
className: d(n.container, {
|
|
16
22
|
[n["container--small"]]: e === "small",
|
|
17
23
|
[n["container--medium"]]: e === "medium",
|
|
18
24
|
[n["container--large"]]: e === "large",
|
|
19
|
-
[n["container--
|
|
25
|
+
[n["container--centered-content"]]: a,
|
|
26
|
+
[n["container--hidden"]]: !o
|
|
20
27
|
}),
|
|
21
|
-
children:
|
|
28
|
+
children: r
|
|
22
29
|
}
|
|
23
30
|
)
|
|
24
31
|
] });
|
|
25
32
|
export {
|
|
26
|
-
|
|
33
|
+
s as Container
|
|
27
34
|
};
|
|
28
35
|
//# sourceMappingURL=Container.js.map
|
|
@@ -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 visible?: boolean;\n}\n\nexport const Container = ({
|
|
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
|
@@ -2,8 +2,8 @@ import { AppStatusBar as t } from "./components/AppStatusBar/AppStatusBar.js";
|
|
|
2
2
|
import { Backdrop as p } from "./components/Backdrop/Backdrop.js";
|
|
3
3
|
import { Button as x } from "./components/Button/Button.js";
|
|
4
4
|
import { Card as n } from "./components/Card/Card.js";
|
|
5
|
-
import { FieldHint as
|
|
6
|
-
import { Icon as
|
|
5
|
+
import { FieldHint as a } from "./components/FieldHint/FieldHint.js";
|
|
6
|
+
import { Icon as u } from "./components/Icon/Icon.js";
|
|
7
7
|
import { IconButton as s } from "./components/IconButton/IconButton.js";
|
|
8
8
|
import { InfoMessage as B } from "./components/InfoMessage/InfoMessage.js";
|
|
9
9
|
import { Input as I } from "./components/Input/Input.js";
|
|
@@ -15,15 +15,16 @@ import { OverlayCloseButton as A } from "./components/OverlayCloseButton/Overlay
|
|
|
15
15
|
import { RadioButton as H } from "./components/RadioButton/RadioButton.js";
|
|
16
16
|
import { SectionNotification as O } from "./components/SectionNotification/SectionNotification.js";
|
|
17
17
|
import { SelectListbox as R } from "./components/SelectListbox/SelectListbox.js";
|
|
18
|
-
import { SelectProvider as
|
|
19
|
-
import { Spinner as
|
|
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";
|
|
20
21
|
export {
|
|
21
22
|
t as AppStatusBar,
|
|
22
23
|
p as Backdrop,
|
|
23
24
|
x as Button,
|
|
24
25
|
n as Card,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
a as FieldHint,
|
|
27
|
+
u as Icon,
|
|
27
28
|
s as IconButton,
|
|
28
29
|
B as InfoMessage,
|
|
29
30
|
I as Input,
|
|
@@ -35,8 +36,9 @@ export {
|
|
|
35
36
|
H as RadioButton,
|
|
36
37
|
O as SectionNotification,
|
|
37
38
|
R as SelectListbox,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
h as SelectProvider,
|
|
40
|
+
w as Spinner,
|
|
41
|
+
E as Tooltip,
|
|
42
|
+
j as useSelect
|
|
41
43
|
};
|
|
42
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":";;;;;;;;;;;;;;;;;;;;"}
|