@fluidattacks/design 11.7.1 → 11.9.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/components/checkbox/index.js +42 -49
- package/dist/components/checkbox/index.stories.d.ts +4 -1
- package/dist/components/checkbox/styles.d.ts +2 -1
- package/dist/components/checkbox/styles.js +32 -48
- package/dist/components/inputs/fields/month/panel.d.ts +3 -2
- package/dist/components/inputs/fields/month/styles.d.ts +2 -1
- package/dist/components/oauth-selector/index.d.ts +3 -3
- package/dist/components/oauth-selector/index.js +69 -43
- package/dist/components/oauth-selector/styles.d.ts +2 -1
- package/dist/components/oauth-selector/styles.js +20 -8
- package/dist/components/oauth-selector/types.d.ts +13 -1
- package/dist/components/radio-button/index.js +31 -31
- package/dist/components/radio-button/styles.d.ts +2 -1
- package/dist/components/radio-button/styles.js +21 -34
- package/package.json +2 -2
|
@@ -1,66 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { InputContainer as I } from "./styles.js";
|
|
1
|
+
import { jsxs as s, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h, useRef as k, useImperativeHandle as b, useEffect as g } from "react";
|
|
3
|
+
import { InputContainer as C, LabelText as I } from "./styles.js";
|
|
4
4
|
import { Icon as R } from "../icon/index.js";
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
const H =
|
|
7
|
-
checked:
|
|
8
|
-
disabled:
|
|
5
|
+
import { Tooltip as j } from "../tooltip/index.js";
|
|
6
|
+
const H = h(function({
|
|
7
|
+
checked: a,
|
|
8
|
+
disabled: o = !1,
|
|
9
9
|
indeterminate: i = !1,
|
|
10
|
-
label:
|
|
11
|
-
name:
|
|
10
|
+
label: t,
|
|
11
|
+
name: n,
|
|
12
12
|
onChange: p,
|
|
13
|
-
onClick:
|
|
14
|
-
onFocus:
|
|
15
|
-
onKeyDown:
|
|
16
|
-
tooltip:
|
|
17
|
-
value:
|
|
18
|
-
...
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}, [i]), /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
13
|
+
onClick: d,
|
|
14
|
+
onFocus: l,
|
|
15
|
+
onKeyDown: m,
|
|
16
|
+
tooltip: f,
|
|
17
|
+
value: r,
|
|
18
|
+
...u
|
|
19
|
+
}, x) {
|
|
20
|
+
const e = k(null);
|
|
21
|
+
return b(x, () => e.current, []), g(() => {
|
|
22
|
+
e.current !== null && (e.current.indeterminate = i);
|
|
23
|
+
}, [i]), /* @__PURE__ */ s("div", { className: "gap-1 inline-flex items-start parent-checkbox", children: [
|
|
24
|
+
/* @__PURE__ */ s(C, { "aria-disabled": o, children: [
|
|
25
|
+
/* @__PURE__ */ c(
|
|
26
26
|
"input",
|
|
27
27
|
{
|
|
28
|
-
"aria-checked": i ? "mixed" :
|
|
29
|
-
"aria-disabled":
|
|
28
|
+
"aria-checked": i ? "mixed" : a,
|
|
29
|
+
"aria-disabled": o,
|
|
30
30
|
"aria-hidden": !1,
|
|
31
|
-
"aria-label":
|
|
32
|
-
checked:
|
|
33
|
-
"data-testid": typeof
|
|
34
|
-
disabled:
|
|
35
|
-
id:
|
|
36
|
-
name:
|
|
31
|
+
"aria-label": n,
|
|
32
|
+
checked: a,
|
|
33
|
+
"data-testid": typeof t == "string" ? t ?? r : r,
|
|
34
|
+
disabled: o,
|
|
35
|
+
id: n,
|
|
36
|
+
name: n,
|
|
37
37
|
onChange: p,
|
|
38
|
-
onClick:
|
|
39
|
-
onFocus:
|
|
40
|
-
onKeyDown:
|
|
41
|
-
ref:
|
|
38
|
+
onClick: d,
|
|
39
|
+
onFocus: l,
|
|
40
|
+
onKeyDown: m,
|
|
41
|
+
ref: e,
|
|
42
42
|
type: "checkbox",
|
|
43
|
-
value:
|
|
44
|
-
...
|
|
43
|
+
value: r,
|
|
44
|
+
...u
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
disabled: r,
|
|
51
|
-
icon: i ? "minus" : "check",
|
|
52
|
-
iconSize: "xl"
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
c ?? e
|
|
47
|
+
/* @__PURE__ */ c(R, { icon: i ? "minus" : "check", iconSize: "xl" }),
|
|
48
|
+
/* @__PURE__ */ c(I, { children: t ?? r })
|
|
56
49
|
] }),
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
f === void 0 ? void 0 : /* @__PURE__ */ c(
|
|
51
|
+
j,
|
|
59
52
|
{
|
|
60
53
|
icon: "circle-info",
|
|
61
|
-
id:
|
|
54
|
+
id: f,
|
|
62
55
|
place: "right",
|
|
63
|
-
tip:
|
|
56
|
+
tip: f
|
|
64
57
|
}
|
|
65
58
|
)
|
|
66
59
|
] });
|
|
@@ -2,7 +2,10 @@ import { Meta } from '@storybook/react-vite';
|
|
|
2
2
|
import { ICheckboxProps } from './types';
|
|
3
3
|
declare const config: Meta;
|
|
4
4
|
declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
5
|
+
declare const Checked: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
5
6
|
declare const Disabled: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
6
7
|
declare const Indeterminate: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
7
|
-
|
|
8
|
+
declare const DisabledUnchecked: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
9
|
+
declare const DisabledIndeterminate: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ICheckboxProps>;
|
|
10
|
+
export { Checked, Default, Disabled, DisabledIndeterminate, DisabledUnchecked, Indeterminate, };
|
|
8
11
|
export default config;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
declare const LabelText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
1
2
|
declare const InputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>> & string;
|
|
2
|
-
export { InputContainer };
|
|
3
|
+
export { InputContainer, LabelText };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const t =
|
|
3
|
-
|
|
1
|
+
import { styled as a } from "styled-components";
|
|
2
|
+
const t = a.span`
|
|
3
|
+
flex: 1;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
`, n = a.label`
|
|
6
|
+
${({ theme: i }) => `
|
|
4
7
|
align-items: center;
|
|
5
|
-
color: ${
|
|
8
|
+
color: ${i.palette.gray[600]};
|
|
6
9
|
display: flex;
|
|
7
10
|
cursor: pointer;
|
|
8
|
-
font-family: ${
|
|
9
|
-
font-size: ${
|
|
10
|
-
font-weight: ${
|
|
11
|
-
line-height: ${
|
|
11
|
+
font-family: ${i.typography.type.primary};
|
|
12
|
+
font-size: ${i.typography.text.md};
|
|
13
|
+
font-weight: ${i.typography.weight.regular};
|
|
14
|
+
line-height: ${i.spacing[1.25]};
|
|
12
15
|
letter-spacing: 0;
|
|
13
16
|
position: relative;
|
|
14
17
|
text-align: left;
|
|
15
18
|
|
|
16
19
|
&[aria-disabled="true"] {
|
|
17
|
-
color: ${a.palette.gray[400]};
|
|
18
20
|
cursor: not-allowed;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -24,59 +26,41 @@ const t = i.label`
|
|
|
24
26
|
cursor: pointer;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
input
|
|
28
|
-
background-color: ${
|
|
29
|
-
border-radius: ${
|
|
30
|
-
border: 1px solid ${
|
|
29
|
+
input + span > svg {
|
|
30
|
+
background-color: ${i.palette.white};
|
|
31
|
+
border-radius: ${i.spacing[0.25]};
|
|
32
|
+
border: 1px solid ${i.palette.gray[700]};
|
|
31
33
|
top: 0;
|
|
32
34
|
left: 0;
|
|
33
|
-
height: ${
|
|
34
|
-
margin-right: ${
|
|
35
|
-
width: ${
|
|
36
|
-
padding: ${
|
|
35
|
+
height: ${i.spacing[0.5]};
|
|
36
|
+
margin-right: ${i.spacing[0.5]};
|
|
37
|
+
width: ${i.spacing[0.5]};
|
|
38
|
+
padding: ${i.spacing[0.25]};
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
input
|
|
40
|
-
fill: ${
|
|
41
|
+
input + span > svg > path {
|
|
42
|
+
fill: ${i.palette.white};
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
input:checked
|
|
44
|
-
input:indeterminate
|
|
45
|
-
background-color: ${
|
|
46
|
-
border: 1px solid ${a.palette.primary[500]};
|
|
45
|
+
input:checked + span > svg,
|
|
46
|
+
input:indeterminate + span > svg {
|
|
47
|
+
background-color: ${i.palette.gray[700]};
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
input:disabled
|
|
50
|
-
|
|
51
|
-
cursor: not-allowed;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
input:not(:disabled):hover ~ span > svg {
|
|
55
|
-
box-shadow: 0 0 0 4px ${a.palette.gray[100]};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
input:checked:disabled ~ span > svg,
|
|
59
|
-
input:indeterminate:disabled ~ span > svg {
|
|
60
|
-
background-color: ${a.palette.gray[300]};
|
|
61
|
-
border: 1px solid ${a.palette.gray[300]};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
input:not(:disabled):hover:checked ~ span > svg,
|
|
65
|
-
input:not(:disabled):hover:indeterminate ~ span > svg {
|
|
66
|
-
box-shadow: 0 0 0 4px ${a.palette.primary[50]};
|
|
50
|
+
input:not(:disabled):hover + span > svg {
|
|
51
|
+
box-shadow: 0 0 0 4px ${i.palette.gray[200]};
|
|
67
52
|
}
|
|
68
53
|
|
|
69
|
-
input:
|
|
70
|
-
|
|
71
|
-
fill: ${a.palette.white};
|
|
54
|
+
input:disabled + span {
|
|
55
|
+
opacity: 0.4;
|
|
72
56
|
}
|
|
73
57
|
|
|
74
|
-
input:
|
|
75
|
-
|
|
76
|
-
fill: ${a.palette.white};
|
|
58
|
+
input:disabled ~ ${t} {
|
|
59
|
+
opacity: 0.5;
|
|
77
60
|
}
|
|
78
61
|
`}
|
|
79
62
|
`;
|
|
80
63
|
export {
|
|
81
|
-
|
|
64
|
+
n as InputContainer,
|
|
65
|
+
t as LabelText
|
|
82
66
|
};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
interface IMonthPanelProps {
|
|
3
3
|
maxValue?: string;
|
|
4
4
|
minValue?: string;
|
|
5
|
+
onClose: () => void;
|
|
5
6
|
onSelect: (period: string) => void;
|
|
6
7
|
value: string;
|
|
7
8
|
}
|
|
8
|
-
/** The year bar
|
|
9
|
-
declare const MonthPanel: ({ maxValue, minValue, onSelect, value, }: Readonly<IMonthPanelProps>) => JSX.Element;
|
|
9
|
+
/** The year bar, the month grid and the Today and Cancel actions of a month picker. */
|
|
10
|
+
declare const MonthPanel: ({ maxValue, minValue, onClose, onSelect, value, }: Readonly<IMonthPanelProps>) => JSX.Element;
|
|
10
11
|
export { MonthPanel };
|
|
11
12
|
export type { IMonthPanelProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const YearBar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
2
2
|
declare const MonthGrid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
3
|
declare const MonthItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
4
|
-
|
|
4
|
+
declare const Footer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
5
|
+
export { Footer, MonthGrid, MonthItem, YearBar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IOAuthSelectorProps, IOptionRowProps, TOAuthProvider } from './types';
|
|
2
|
-
declare const OAuthSelector: ({ align, buttonLabel, fallbackOptions, header, id, options, }: Readonly<IOAuthSelectorProps>) => JSX.Element;
|
|
1
|
+
import { IOAuthSelectorProps, IOptionRowProps, ISelectorNote, TOAuthProvider } from './types';
|
|
2
|
+
declare const OAuthSelector: ({ align, buttonLabel, fallbackOptions, header, id, note, options, }: Readonly<IOAuthSelectorProps>) => JSX.Element;
|
|
3
3
|
export { OAuthSelector };
|
|
4
|
-
export type { IOAuthSelectorProps, IOptionRowProps, TOAuthProvider };
|
|
4
|
+
export type { IOAuthSelectorProps, IOptionRowProps, ISelectorNote, TOAuthProvider, };
|
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as O, useRef as b, useId as z, useCallback as r, createElement as S, Fragment as D } from "react";
|
|
3
3
|
import { useTheme as k } from "styled-components";
|
|
4
4
|
import { OptionRow as R } from "./option-row/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { SelectorNote as T } from "./styles.js";
|
|
6
|
+
import { Button as W } from "../button/index.js";
|
|
7
|
+
import { Container as d } from "../container/index.js";
|
|
8
|
+
import { Divider as j } from "../divider/index.js";
|
|
9
|
+
import { Icon as A } from "../icon/index.js";
|
|
8
10
|
import "../typography/heading/index.js";
|
|
9
11
|
import "../typography/span/index.js";
|
|
10
|
-
import { Text as
|
|
11
|
-
import { useClickOutside as
|
|
12
|
-
const
|
|
13
|
-
align:
|
|
12
|
+
import { Text as p } from "../typography/text/index.js";
|
|
13
|
+
import { useClickOutside as E } from "../../hooks/use-click-outside.js";
|
|
14
|
+
const V = ({
|
|
15
|
+
align: x = "end",
|
|
14
16
|
buttonLabel: a = "Add Credential",
|
|
15
|
-
fallbackOptions:
|
|
17
|
+
fallbackOptions: m = [],
|
|
16
18
|
header: n,
|
|
17
|
-
id:
|
|
18
|
-
|
|
19
|
+
id: y,
|
|
20
|
+
note: l,
|
|
21
|
+
options: v
|
|
19
22
|
}) => {
|
|
20
|
-
const o = k(), [
|
|
21
|
-
|
|
23
|
+
const o = k(), [f, s] = O(!1), h = b(null), w = z(), g = y ?? w, c = r(() => {
|
|
24
|
+
s(!1);
|
|
22
25
|
}, []);
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
}, []),
|
|
27
|
-
(
|
|
28
|
-
|
|
26
|
+
E(h, c);
|
|
27
|
+
const C = r(() => {
|
|
28
|
+
s((i) => !i);
|
|
29
|
+
}, []), I = r(
|
|
30
|
+
(i) => {
|
|
31
|
+
i.key === "Escape" && s(!1);
|
|
29
32
|
},
|
|
30
33
|
[]
|
|
31
|
-
),
|
|
32
|
-
(
|
|
33
|
-
[
|
|
34
|
+
), u = r(
|
|
35
|
+
(i) => /* @__PURE__ */ S(R, { ...i, key: i.id, onChoose: c }),
|
|
36
|
+
[c]
|
|
34
37
|
);
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
38
|
+
return /* @__PURE__ */ t(
|
|
39
|
+
d,
|
|
37
40
|
{
|
|
38
|
-
alignItems:
|
|
41
|
+
alignItems: x,
|
|
39
42
|
display: "flex",
|
|
40
43
|
flexDirection: "column",
|
|
41
|
-
onKeyDown:
|
|
44
|
+
onKeyDown: I,
|
|
42
45
|
position: "relative",
|
|
43
|
-
ref:
|
|
46
|
+
ref: h,
|
|
44
47
|
width: "max-content",
|
|
45
48
|
zIndex: 10,
|
|
46
49
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
W,
|
|
49
52
|
{
|
|
50
|
-
"aria-controls":
|
|
51
|
-
"aria-expanded":
|
|
53
|
+
"aria-controls": g,
|
|
54
|
+
"aria-expanded": f,
|
|
52
55
|
icon: "plus",
|
|
53
|
-
onClick:
|
|
56
|
+
onClick: C,
|
|
54
57
|
variant: "primary",
|
|
55
58
|
children: a
|
|
56
59
|
}
|
|
57
60
|
),
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
f ? /* @__PURE__ */ t(
|
|
62
|
+
d,
|
|
60
63
|
{
|
|
61
64
|
"aria-label": n ?? a,
|
|
62
65
|
bgColor: o.palette.white,
|
|
@@ -65,7 +68,7 @@ const M = ({
|
|
|
65
68
|
display: "flex",
|
|
66
69
|
flexDirection: "column",
|
|
67
70
|
gap: 0.25,
|
|
68
|
-
id:
|
|
71
|
+
id: g,
|
|
69
72
|
minWidth: "380px",
|
|
70
73
|
padding: [0.75, 0.75, 0.75, 0.75],
|
|
71
74
|
position: "absolute",
|
|
@@ -74,8 +77,8 @@ const M = ({
|
|
|
74
77
|
top: "44px",
|
|
75
78
|
zIndex: 10,
|
|
76
79
|
children: [
|
|
77
|
-
n === void 0 ? void 0 : /* @__PURE__ */
|
|
78
|
-
|
|
80
|
+
n === void 0 ? void 0 : /* @__PURE__ */ e(
|
|
81
|
+
p,
|
|
79
82
|
{
|
|
80
83
|
color: o.palette.gray[400],
|
|
81
84
|
fontWeight: "bold",
|
|
@@ -84,10 +87,33 @@ const M = ({
|
|
|
84
87
|
children: n
|
|
85
88
|
}
|
|
86
89
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
90
|
+
/* @__PURE__ */ e("span", { children: v.map(u) }),
|
|
91
|
+
l === void 0 ? void 0 : /* @__PURE__ */ t(T, { role: "note", children: [
|
|
92
|
+
/* @__PURE__ */ e(
|
|
93
|
+
A,
|
|
94
|
+
{
|
|
95
|
+
icon: "circle-info",
|
|
96
|
+
iconColor: o.palette.info[700],
|
|
97
|
+
iconSize: "lg",
|
|
98
|
+
iconType: "fa-light"
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ t(d, { children: [
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
p,
|
|
104
|
+
{
|
|
105
|
+
color: o.palette.info[700],
|
|
106
|
+
fontWeight: "bold",
|
|
107
|
+
size: "md",
|
|
108
|
+
children: l.title
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ e(p, { color: o.palette.info[700], size: "md", children: l.description })
|
|
112
|
+
] })
|
|
113
|
+
] }),
|
|
114
|
+
m.length === 0 ? void 0 : /* @__PURE__ */ t(D, { children: [
|
|
115
|
+
/* @__PURE__ */ e(j, { mb: 0.25, mt: 0.25 }),
|
|
116
|
+
m.map(u)
|
|
91
117
|
] })
|
|
92
118
|
]
|
|
93
119
|
}
|
|
@@ -97,5 +123,5 @@ const M = ({
|
|
|
97
123
|
);
|
|
98
124
|
};
|
|
99
125
|
export {
|
|
100
|
-
|
|
126
|
+
V as OAuthSelector
|
|
101
127
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
declare const OptionButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
|
|
2
|
-
|
|
2
|
+
declare const SelectorNote: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
3
|
+
export { OptionButton, SelectorNote };
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const
|
|
3
|
-
${({ theme:
|
|
1
|
+
import { styled as o } from "styled-components";
|
|
2
|
+
const r = o.button`
|
|
3
|
+
${({ theme: i }) => `
|
|
4
4
|
align-items: center;
|
|
5
5
|
background: none;
|
|
6
6
|
border: none;
|
|
7
|
-
border-radius: ${
|
|
7
|
+
border-radius: ${i.spacing[0.25]};
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: 9px;
|
|
11
|
-
padding: ${
|
|
11
|
+
padding: ${i.spacing[0.5]};
|
|
12
12
|
text-align: left;
|
|
13
13
|
width: 100%;
|
|
14
14
|
|
|
15
|
-
&:hover { background-color: ${
|
|
16
|
-
&:focus-visible { outline: 1px solid ${
|
|
15
|
+
&:hover { background-color: ${i.palette.gray[100]}; }
|
|
16
|
+
&:focus-visible { outline: 1px solid ${i.palette.primary[400]}; }
|
|
17
|
+
`}
|
|
18
|
+
`, a = o.div`
|
|
19
|
+
${({ theme: i }) => `
|
|
20
|
+
align-items: center;
|
|
21
|
+
background: ${i.palette.info[50]};
|
|
22
|
+
border: 1px solid ${i.palette.info[500]};
|
|
23
|
+
border-radius: ${i.spacing[0.25]};
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: ${i.spacing[0.5]};
|
|
26
|
+
margin-top: ${i.spacing[0.25]};
|
|
27
|
+
padding: ${i.spacing[0.75]};
|
|
17
28
|
`}
|
|
18
29
|
`;
|
|
19
30
|
export {
|
|
20
|
-
|
|
31
|
+
r as OptionButton,
|
|
32
|
+
a as SelectorNote
|
|
21
33
|
};
|
|
@@ -32,6 +32,16 @@ interface IOptionRowProps {
|
|
|
32
32
|
interface IOptionRowComponentProps extends IOptionRowProps {
|
|
33
33
|
onChoose: VoidFunction;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Info note shown inside the selector panel.
|
|
37
|
+
* @interface ISelectorNote
|
|
38
|
+
* @property {string} description - Regular line under the title.
|
|
39
|
+
* @property {string} title - Bold first line of the note.
|
|
40
|
+
*/
|
|
41
|
+
interface ISelectorNote {
|
|
42
|
+
description: string;
|
|
43
|
+
title: string;
|
|
44
|
+
}
|
|
35
45
|
/**
|
|
36
46
|
* Oauth selector component props.
|
|
37
47
|
* @interface IOAuthSelectorProps
|
|
@@ -40,6 +50,7 @@ interface IOptionRowComponentProps extends IOptionRowProps {
|
|
|
40
50
|
* @property {IOptionRowProps[]} [fallbackOptions] - Options shown under a divider.
|
|
41
51
|
* @property {string} [header] - Uppercase header shown above the options.
|
|
42
52
|
* @property {string} [id] - Id to be used on the panel.
|
|
53
|
+
* @property {ISelectorNote} [note] - Info note shown between the options and the fallback options.
|
|
43
54
|
* @property {IOptionRowProps[]} options - Ordered options the menu offers.
|
|
44
55
|
*/
|
|
45
56
|
interface IOAuthSelectorProps {
|
|
@@ -48,6 +59,7 @@ interface IOAuthSelectorProps {
|
|
|
48
59
|
fallbackOptions?: IOptionRowProps[];
|
|
49
60
|
header?: string;
|
|
50
61
|
id?: string;
|
|
62
|
+
note?: ISelectorNote;
|
|
51
63
|
options: IOptionRowProps[];
|
|
52
64
|
}
|
|
53
|
-
export type { IOAuthSelectorProps, IOptionRowComponentProps, IOptionRowProps, TOAuthProvider, };
|
|
65
|
+
export type { IOAuthSelectorProps, IOptionRowComponentProps, IOptionRowProps, ISelectorNote, TOAuthProvider, };
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { LabelContainer as s, CheckMark as
|
|
4
|
-
const
|
|
5
|
-
checked:
|
|
6
|
-
disabled:
|
|
7
|
-
label:
|
|
8
|
-
name:
|
|
9
|
-
onChange:
|
|
10
|
-
onClick:
|
|
11
|
-
value:
|
|
12
|
-
...
|
|
13
|
-
},
|
|
14
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { LabelContainer as s, CheckMark as l, LabelText as m } from "./styles.js";
|
|
4
|
+
const k = c(function({
|
|
5
|
+
checked: t,
|
|
6
|
+
disabled: o = !1,
|
|
7
|
+
label: r,
|
|
8
|
+
name: i,
|
|
9
|
+
onChange: e,
|
|
10
|
+
onClick: d,
|
|
11
|
+
value: n,
|
|
12
|
+
...f
|
|
13
|
+
}, p) {
|
|
14
|
+
return /* @__PURE__ */ u(
|
|
15
15
|
s,
|
|
16
16
|
{
|
|
17
|
-
"aria-disabled":
|
|
18
|
-
"aria-label":
|
|
17
|
+
"aria-disabled": o,
|
|
18
|
+
"aria-label": r ?? i,
|
|
19
19
|
role: "radiogroup",
|
|
20
20
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ a(
|
|
22
22
|
"input",
|
|
23
23
|
{
|
|
24
|
-
"aria-checked":
|
|
25
|
-
"aria-disabled":
|
|
26
|
-
"aria-label":
|
|
27
|
-
checked:
|
|
28
|
-
disabled:
|
|
29
|
-
name:
|
|
30
|
-
onChange:
|
|
31
|
-
onClick:
|
|
32
|
-
ref:
|
|
24
|
+
"aria-checked": t,
|
|
25
|
+
"aria-disabled": o,
|
|
26
|
+
"aria-label": r ?? i,
|
|
27
|
+
checked: t,
|
|
28
|
+
disabled: o,
|
|
29
|
+
name: i,
|
|
30
|
+
onChange: e,
|
|
31
|
+
onClick: d,
|
|
32
|
+
ref: p,
|
|
33
33
|
type: "radio",
|
|
34
|
-
value:
|
|
35
|
-
...
|
|
34
|
+
value: n,
|
|
35
|
+
...f
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
/* @__PURE__ */ a(l, {}),
|
|
39
|
+
r === void 0 ? void 0 : /* @__PURE__ */ a(m, { children: r })
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
});
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
k as RadioButton
|
|
46
46
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
declare const LabelText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
1
2
|
declare const LabelContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>> & string;
|
|
2
3
|
declare const CheckMark: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "ref" | keyof import('react').HTMLAttributes<HTMLSpanElement>> & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
3
4
|
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
4
5
|
}, "className"> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "ref" | keyof import('react').HTMLAttributes<HTMLSpanElement>> & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
5
6
|
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
6
7
|
}, "className">>> & string;
|
|
7
|
-
export { CheckMark, LabelContainer };
|
|
8
|
+
export { CheckMark, LabelContainer, LabelText };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const
|
|
3
|
-
${({ theme:
|
|
1
|
+
import { styled as a } from "styled-components";
|
|
2
|
+
const o = a.span``, r = a.label`
|
|
3
|
+
${({ theme: t }) => `
|
|
4
4
|
align-items: center;
|
|
5
5
|
display: flex;
|
|
6
|
-
color: ${
|
|
6
|
+
color: ${t.palette.gray[600]};
|
|
7
7
|
cursor: pointer;
|
|
8
|
-
font-family: ${
|
|
9
|
-
font-size: ${
|
|
10
|
-
font-weight: ${
|
|
11
|
-
gap: ${
|
|
12
|
-
line-height: ${
|
|
8
|
+
font-family: ${t.typography.type.primary};
|
|
9
|
+
font-size: ${t.typography.text.md};
|
|
10
|
+
font-weight: ${t.typography.weight.regular};
|
|
11
|
+
gap: ${t.spacing[0.5]};
|
|
12
|
+
line-height: ${t.spacing[1.25]};
|
|
13
13
|
text-align: left;
|
|
14
14
|
position: relative;
|
|
15
15
|
|
|
16
16
|
&[aria-disabled="true"] {
|
|
17
|
-
color: ${a.palette.gray[400]};
|
|
18
17
|
cursor: not-allowed;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -31,30 +30,21 @@ const t = r.label`
|
|
|
31
30
|
left: 0;
|
|
32
31
|
height: 16px;
|
|
33
32
|
width: 16px;
|
|
34
|
-
background-color: ${
|
|
33
|
+
background-color: ${t.palette.white};
|
|
35
34
|
border-radius: 50%;
|
|
36
|
-
border: 1px solid ${
|
|
35
|
+
border: 1px solid ${t.palette.gray[700]};
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
input:disabled ~ .checkmark {
|
|
40
|
-
|
|
41
|
-
background-color: ${a.palette.white};
|
|
42
|
-
cursor: not-allowed;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
input:not(:disabled):checked ~ .checkmark {
|
|
46
|
-
background-color: ${a.palette.white};
|
|
47
|
-
border: 1px solid ${a.palette.primary[500]};
|
|
38
|
+
input:not(:disabled):hover ~ .checkmark {
|
|
39
|
+
box-shadow: 0 0 0 4px ${t.palette.gray[200]};
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
input:
|
|
51
|
-
|
|
52
|
-
box-shadow: 0 0 0 4px ${a.palette.gray[100]};
|
|
42
|
+
input:disabled ~ .checkmark {
|
|
43
|
+
opacity: 0.4;
|
|
53
44
|
}
|
|
54
45
|
|
|
55
|
-
input:
|
|
56
|
-
|
|
57
|
-
box-shadow: 0 0 0 4px ${a.palette.primary[50]};
|
|
46
|
+
input:disabled ~ ${o} {
|
|
47
|
+
opacity: 0.5;
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
.checkmark::after {
|
|
@@ -66,20 +56,17 @@ const t = r.label`
|
|
|
66
56
|
width: 8px;
|
|
67
57
|
height: 8px;
|
|
68
58
|
border-radius: 50%;
|
|
69
|
-
background: ${
|
|
59
|
+
background: ${t.palette.gray[700]};
|
|
70
60
|
}
|
|
71
61
|
|
|
72
62
|
input:checked ~ .checkmark::after {
|
|
73
63
|
display: block;
|
|
74
64
|
}
|
|
75
65
|
|
|
76
|
-
input:disabled:checked ~ .checkmark::after {
|
|
77
|
-
background-color: ${a.palette.gray[300]};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
66
|
`}
|
|
81
|
-
`, e =
|
|
67
|
+
`, e = a.span.attrs({ className: "checkmark" })``;
|
|
82
68
|
export {
|
|
83
69
|
e as CheckMark,
|
|
84
|
-
|
|
70
|
+
r as LabelContainer,
|
|
71
|
+
o as LabelText
|
|
85
72
|
};
|
package/package.json
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
58
58
|
"eslint-plugin-storybook": "10.6.2",
|
|
59
59
|
"jsdom": "27.4.0",
|
|
60
|
-
"next": "16.4.
|
|
60
|
+
"next": "16.4.5",
|
|
61
61
|
"playwright": "1.60.0",
|
|
62
62
|
"postcss-styled-syntax": "0.7.1",
|
|
63
63
|
"prettier": "3.9.6",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"./dist/index.js"
|
|
136
136
|
],
|
|
137
137
|
"typings": "./dist/index.d.ts",
|
|
138
|
-
"version": "11.
|
|
138
|
+
"version": "11.9.0"
|
|
139
139
|
}
|