@gobolt/genesis 0.2.5 → 0.2.7
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/_virtual/index5.cjs +1 -1
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index6.js +4 -4
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/__stories__/Button.stories.d.ts +1 -0
- package/dist/components/Button/icon-button-styles.d.ts +1 -1
- package/dist/components/Button/styles.cjs +12 -12
- package/dist/components/Button/styles.d.ts +1 -1
- package/dist/components/Button/styles.js +9 -9
- package/dist/components/Card/__stories__/Card.stories.d.ts +2 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +20 -14
- package/dist/components/Notification/NotificationBadge/styles.cjs +19 -5
- package/dist/components/Notification/NotificationBadge/styles.js +16 -2
- package/dist/components/SegmentedControls/styles.cjs +21 -7
- package/dist/components/SegmentedControls/styles.d.ts +1 -1
- package/dist/components/SegmentedControls/styles.js +24 -10
- package/dist/components/Select/Select.cjs +2 -2
- package/dist/components/Select/Select.js +16 -15
- package/dist/components/Select/__stories__/Select.stories.d.ts +1 -0
- package/dist/components/Select/styles.cjs +37 -10
- package/dist/components/Select/styles.js +39 -12
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.cjs +1 -1
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +1 -1
- package/dist/components/shared/DropdownChevron.cjs +1 -0
- package/dist/components/shared/DropdownChevron.js +27 -0
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +13 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +57 -50
- package/dist/node_modules/antd/es/typography/hooks/useCopyClick.cjs +1 -1
- package/dist/node_modules/antd/es/typography/hooks/useCopyClick.js +1 -1
- package/dist/node_modules/react-icons/pi/index.cjs +1 -0
- package/dist/node_modules/react-icons/pi/index.js +12 -0
- package/dist/node_modules/react-icons/tb/index.cjs +1 -1
- package/dist/node_modules/react-icons/tb/index.js +4 -8
- package/dist/styles/theme/genesis-theme.cjs +1 -1
- package/dist/styles/theme/genesis-theme.js +292 -223
- package/dist/styles/theme/genesis-theme.types.d.ts +1 -0
- package/dist/styles/theme/index.d.ts +1 -0
- package/dist/utils/icon-util.cjs +1 -1
- package/dist/utils/icon-util.js +24 -24
- package/package.json +1 -1
- package/dist/components/Select/DropdownChevron.cjs +0 -1
- package/dist/components/Select/DropdownChevron.js +0 -23
- /package/dist/components/{Select → shared}/DropdownChevron.d.ts +0 -0
package/dist/_virtual/index5.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("./_commonjsHelpers.cjs"),r=require("../node_modules/debounce/index.cjs");var o=r.__require();const s=e.getDefaultExportFromCjs(o);module.exports=s;
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as r } from "../node_modules/
|
|
3
|
-
var
|
|
4
|
-
const a = /* @__PURE__ */ o
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/debounce/index.js";
|
|
3
|
+
var o = /* @__PURE__ */ r();
|
|
4
|
+
const a = /* @__PURE__ */ e(o);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
package/dist/_virtual/index6.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("./_commonjsHelpers.cjs"),e=require("../node_modules/copy-to-clipboard/index.cjs");var o=e.__require();const s=r.getDefaultExportFromCjs(o);module.exports=s;
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as r } from "../node_modules/
|
|
3
|
-
var
|
|
4
|
-
const a = /* @__PURE__ */
|
|
1
|
+
import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/copy-to-clipboard/index.js";
|
|
3
|
+
var p = r();
|
|
4
|
+
const a = /* @__PURE__ */ o(p);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, MouseEvent } from 'react';
|
|
2
2
|
import { ButtonProps as AntButtonProps } from 'antd/es/button';
|
|
3
3
|
import { STATE } from '../../constants';
|
|
4
|
-
type ButtonThemeType = "primary" | "secondary" | "tertiary" | "utility" | "icon";
|
|
4
|
+
type ButtonThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
|
|
5
5
|
export interface ButtonProps extends Omit<AntButtonProps, "type" | "size"> {
|
|
6
6
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -10,6 +10,7 @@ export interface ButtonProps extends Omit<AntButtonProps, "type" | "size"> {
|
|
|
10
10
|
isIconButton?: boolean;
|
|
11
11
|
size?: "small" | "normal" | "large";
|
|
12
12
|
isSelected?: boolean;
|
|
13
|
+
icon?: React.ReactNode;
|
|
13
14
|
}
|
|
14
15
|
declare const Button: React.FC<ButtonProps>;
|
|
15
16
|
export default Button;
|
|
@@ -7,5 +7,6 @@ export declare const Focussed: Story;
|
|
|
7
7
|
export declare const Primary: Story;
|
|
8
8
|
export declare const Secondary: Story;
|
|
9
9
|
export declare const Tertiary: Story;
|
|
10
|
+
export declare const Destructive: Story;
|
|
10
11
|
export declare const LeftIcon: Story;
|
|
11
12
|
export declare const RightIcon: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GenesisTheme } from '../../styles/theme/genesis-theme.types';
|
|
2
2
|
interface StyledIconButtonProps {
|
|
3
3
|
theme?: GenesisTheme;
|
|
4
|
-
$themeType?: "primary" | "secondary" | "tertiary" | "utility" | "icon";
|
|
4
|
+
$themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
|
|
5
5
|
$state?: "active" | "hover" | "pressed" | "focus" | "disabled" | "selected";
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
$isIconButton?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("styled-components"),b=require("../../node_modules/antd/es/button/button.cjs"),x=(r,l,d,n)=>n&&(r==="normal"||r==="large")?`${d.Size2}px ${d.Size2}px`:n&&r==="small"?`${d.Size1}px ${d.Size1}px`:l==="utility"&&r==="small"?`${d.Size1_5}px ${d.Size2}px`:l==="utility"&&(r==="normal"||r==="large")?`${d.Size2_5}px ${d.Size3}px`:r==="small"?`${d.Size1_5}px ${d.Size4}px`:r==="normal"||r==="large"?`${d.Size2_5}px ${d.Size6}px`:`${d.Size2}px ${d.Size2}px`,i=r=>r==="normal"||r==="large"?"40px":r==="small"?"32px":"40px",c=(r,l)=>l?r==="normal"||r==="large"?"40px":r==="small"?"32px":"40px":"auto",f=({colors:r,sizing:l,borderRadius:d,components:n},o,t,a,u)=>(r[o][t].backgroundColor,`
|
|
2
2
|
&.ant-btn {
|
|
3
3
|
|
|
4
|
-
color: ${r[o][
|
|
4
|
+
color: ${r[o][t].color};
|
|
5
5
|
font-size: ${l.Size4}px;
|
|
6
6
|
line-height: ${l.Size6}px;
|
|
7
7
|
letter-spacing: 0;
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
border-width: 1px;
|
|
10
10
|
line-height: 1 !important;
|
|
11
11
|
|
|
12
|
-
width:
|
|
13
|
-
height: ${
|
|
12
|
+
width: ${c(a,u)}; !important;
|
|
13
|
+
height: ${i(a)}; !important;
|
|
14
14
|
|
|
15
|
-
background-color: ${r[o][
|
|
16
|
-
padding: ${
|
|
15
|
+
background-color: ${r[o][t].backgroundColor};
|
|
16
|
+
padding: ${x(a,o,l,u)};
|
|
17
17
|
|
|
18
18
|
box-shadow: ${o==="utility"?"0px 1px 2px 0px #00000026":"none"};
|
|
19
19
|
|
|
20
20
|
border-radius: ${d.BorderRadiusMd}px;
|
|
21
21
|
gap: ${n.button.gap}px;
|
|
22
22
|
border-style: solid;
|
|
23
|
-
border-color: ${r[o][
|
|
23
|
+
border-color: ${r[o][t].borderColor};
|
|
24
24
|
|
|
25
25
|
transition: all 0.2s ease-in-out;
|
|
26
26
|
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
`),
|
|
58
|
+
`),p=(r,l,d,n,o)=>`
|
|
59
59
|
&.ant-btn {
|
|
60
60
|
font-family: 'Inter', sans-serif;
|
|
61
61
|
|
|
62
|
-
${
|
|
62
|
+
${f(r,l,d,o,n)}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
65
|
-
${({theme:r,$themeType:l,$state:d,children:n,$isIconButton:o,size:
|
|
66
|
-
`;exports.Button=
|
|
64
|
+
`,g=e(b)`
|
|
65
|
+
${({theme:r,$themeType:l,$state:d,children:n,$isIconButton:o,size:t})=>p(r,l,d,o,t)}
|
|
66
|
+
`;exports.Button=g;
|
|
@@ -2,7 +2,7 @@ import { ButtonProps as AntButtonProps } from 'antd/es/button';
|
|
|
2
2
|
import { GenesisTheme } from '../../styles/theme/genesis-theme.types';
|
|
3
3
|
interface StyledButtonProps extends Omit<AntButtonProps, "type" | "size"> {
|
|
4
4
|
theme?: GenesisTheme;
|
|
5
|
-
$themeType?: "primary" | "secondary" | "tertiary" | "utility" | "icon";
|
|
5
|
+
$themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
|
|
6
6
|
$state?: "active" | "hover" | "pressed" | "focus" | "disabled" | "selected";
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
$isIconButton?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const i = (r, l, d, a) => a && (r === "normal" || r === "large") ? `${d.Size2}px ${d.Size2}px` : a && r === "small" ? `${d.Size1}px ${d.Size1}px` : l === "utility" && r === "small" ? `${d.Size1_5}px ${d.Size2}px` : l === "utility" && (r === "normal" || r === "large") ? `${d.Size2_5}px ${d.Size3}px` : r === "small" ? `${d.Size1_5}px ${d.Size4}px` : r === "normal" || r === "large" ? `${d.Size2_5}px ${d.Size6}px` : `${d.Size2}px ${d.Size2}px`, c = (r) => r === "normal" || r === "large" ? "40px" : r === "small" ? "32px" : "40px",
|
|
1
|
+
import x from "styled-components";
|
|
2
|
+
import b from "../../node_modules/antd/es/button/button.js";
|
|
3
|
+
const i = (r, l, d, a) => a && (r === "normal" || r === "large") ? `${d.Size2}px ${d.Size2}px` : a && r === "small" ? `${d.Size1}px ${d.Size1}px` : l === "utility" && r === "small" ? `${d.Size1_5}px ${d.Size2}px` : l === "utility" && (r === "normal" || r === "large") ? `${d.Size2_5}px ${d.Size3}px` : r === "small" ? `${d.Size1_5}px ${d.Size4}px` : r === "normal" || r === "large" ? `${d.Size2_5}px ${d.Size6}px` : `${d.Size2}px ${d.Size2}px`, e = (r) => r === "normal" || r === "large" ? "40px" : r === "small" ? "32px" : "40px", c = (r, l) => l ? r === "normal" || r === "large" ? "40px" : r === "small" ? "32px" : "40px" : "auto", f = ({ colors: r, sizing: l, borderRadius: d, components: a }, o, n, t, u) => (r[o][n].backgroundColor, `
|
|
4
4
|
&.ant-btn {
|
|
5
5
|
|
|
6
6
|
color: ${r[o][n].color};
|
|
@@ -11,8 +11,8 @@ const i = (r, l, d, a) => a && (r === "normal" || r === "large") ? `${d.Size2}px
|
|
|
11
11
|
border-width: 1px;
|
|
12
12
|
line-height: 1 !important;
|
|
13
13
|
|
|
14
|
-
width:
|
|
15
|
-
height: ${
|
|
14
|
+
width: ${c(t, u)}; !important;
|
|
15
|
+
height: ${e(t)}; !important;
|
|
16
16
|
|
|
17
17
|
background-color: ${r[o][n].backgroundColor};
|
|
18
18
|
padding: ${i(t, o, l, u)};
|
|
@@ -57,14 +57,14 @@ const i = (r, l, d, a) => a && (r === "normal" || r === "large") ? `${d.Size2}px
|
|
|
57
57
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
`),
|
|
60
|
+
`), p = (r, l, d, a, o) => `
|
|
61
61
|
&.ant-btn {
|
|
62
62
|
font-family: 'Inter', sans-serif;
|
|
63
63
|
|
|
64
|
-
${
|
|
64
|
+
${f(r, l, d, o, a)}
|
|
65
65
|
}
|
|
66
|
-
`, S = b
|
|
67
|
-
${({ theme: r, $themeType: l, $state: d, children: a, $isIconButton: o, size: n }) =>
|
|
66
|
+
`, S = x(b)`
|
|
67
|
+
${({ theme: r, $themeType: l, $state: d, children: a, $isIconButton: o, size: n }) => p(
|
|
68
68
|
r,
|
|
69
69
|
l,
|
|
70
70
|
d,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),t=require("react"),c=require("./styles.cjs"),a=require("../../constants/index.cjs"),l=require("../shared/DropdownChevron.cjs"),u=require("../../node_modules/antd/es/select/index.cjs"),f=({state:n=a.STATE.active,size:d="normal",...e})=>{const{type:x,...i}=e,r=d==="normal"?"middle":d,s=t.isValidElement(e.addonAfter)&&e.addonAfter.type===u?t.cloneElement(e.addonAfter,{suffixIcon:o.jsx(l,{})}):e.addonAfter;return o.jsx(c.Input,{size:r,state:n,disabled:n==="disabled"||e.disabled,...i,addonAfter:s})};module.exports=f;
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Input as m } from "./styles.js";
|
|
4
|
+
import { STATE as f } from "../../constants/index.js";
|
|
5
|
+
import l from "../shared/DropdownChevron.js";
|
|
6
|
+
import p from "../../node_modules/antd/es/select/index.js";
|
|
7
|
+
const x = ({
|
|
8
|
+
state: d = f.active,
|
|
9
|
+
size: t = "normal",
|
|
7
10
|
...o
|
|
8
11
|
}) => {
|
|
9
|
-
const { type:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const { type: c, ...r } = o, a = t === "normal" ? "middle" : t, i = n.isValidElement(o.addonAfter) && o.addonAfter.type === p ? n.cloneElement(o.addonAfter, {
|
|
13
|
+
suffixIcon: /* @__PURE__ */ e(l, {})
|
|
14
|
+
}) : o.addonAfter;
|
|
15
|
+
return /* @__PURE__ */ e(
|
|
16
|
+
m,
|
|
12
17
|
{
|
|
13
|
-
size:
|
|
14
|
-
state:
|
|
15
|
-
disabled:
|
|
16
|
-
...
|
|
18
|
+
size: a,
|
|
19
|
+
state: d,
|
|
20
|
+
disabled: d === "disabled" || o.disabled,
|
|
21
|
+
...r,
|
|
22
|
+
addonAfter: i
|
|
17
23
|
}
|
|
18
24
|
);
|
|
19
25
|
};
|
|
20
26
|
export {
|
|
21
|
-
|
|
27
|
+
x as default
|
|
22
28
|
};
|
|
@@ -4,18 +4,32 @@
|
|
|
4
4
|
position: absolute;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
align-items: center;
|
|
7
|
-
top: -
|
|
8
|
-
|
|
7
|
+
top: -16px;
|
|
8
|
+
right: -16px;
|
|
9
|
+
box-shadow: -2px 2px white;
|
|
9
10
|
width: 20px;
|
|
10
11
|
height: 20px;
|
|
11
12
|
border: 2px solid ${({color:e})=>e};
|
|
12
13
|
border-radius: 50%;
|
|
13
14
|
box-sizing: border-box;
|
|
14
15
|
background-color: white;
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
&::before {
|
|
18
|
+
content: "";
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0px;
|
|
21
|
+
left: 0px;
|
|
22
|
+
right: 0px;
|
|
23
|
+
bottom: 0px;
|
|
24
|
+
border: 2px solid white;
|
|
25
|
+
width: 12px;
|
|
26
|
+
height: 12px;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
}
|
|
29
|
+
`,i=t.div`
|
|
16
30
|
display: flex;
|
|
17
31
|
position: relative;
|
|
18
|
-
`,
|
|
32
|
+
`,r=t.div`
|
|
19
33
|
display: flex;
|
|
20
34
|
justify-content: center;
|
|
21
35
|
align-items: center;
|
|
@@ -25,4 +39,4 @@
|
|
|
25
39
|
border-radius: 50%;
|
|
26
40
|
border: 1px solid ${({theme:e})=>e.colors.surface.border};
|
|
27
41
|
background-color: ${({theme:e})=>e.colors.surface.default};
|
|
28
|
-
`;exports.Badge=
|
|
42
|
+
`;exports.Badge=i;exports.BadgeState=o;exports.BadgeWrapper=r;
|
|
@@ -5,14 +5,28 @@ const i = o.div`
|
|
|
5
5
|
position: absolute;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
align-items: center;
|
|
8
|
-
top: -
|
|
9
|
-
|
|
8
|
+
top: -16px;
|
|
9
|
+
right: -16px;
|
|
10
|
+
box-shadow: -2px 2px white;
|
|
10
11
|
width: 20px;
|
|
11
12
|
height: 20px;
|
|
12
13
|
border: 2px solid ${({ color: e }) => e};
|
|
13
14
|
border-radius: 50%;
|
|
14
15
|
box-sizing: border-box;
|
|
15
16
|
background-color: white;
|
|
17
|
+
|
|
18
|
+
&::before {
|
|
19
|
+
content: "";
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0px;
|
|
22
|
+
left: 0px;
|
|
23
|
+
right: 0px;
|
|
24
|
+
bottom: 0px;
|
|
25
|
+
border: 2px solid white;
|
|
26
|
+
width: 12px;
|
|
27
|
+
height: 12px;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
}
|
|
16
30
|
`, r = o.div`
|
|
17
31
|
display: flex;
|
|
18
32
|
position: relative;
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("styled-components"),d=require("../../node_modules/antd/es/segmented/index.cjs"),r=({colors:e,borderRadius:n,sizing:i,typography:o},t="primary",a="active")=>`
|
|
2
2
|
&.ant-segmented {
|
|
3
|
-
border-radius: ${
|
|
3
|
+
border-radius: ${n.BorderRadiusMd};
|
|
4
4
|
color: ${e.onsurface.copy};
|
|
5
|
-
|
|
5
|
+
font-family: ${o.fontFamily};
|
|
6
|
+
color: ${e.onsurface.copy};
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
:where(.css-dev-only-do-not-override-240cud).ant-segmented &.ant-segmented-item-icon + * {
|
|
10
|
+
margin-inline-start: 4px !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-segmented-item-label span + span {
|
|
14
|
+
margin-inline-start: 4px !important;
|
|
15
|
+
font-family: ${o.fontFamily};
|
|
16
|
+
color: ${e.onsurface.copy};
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
.ant-segmented-item {
|
|
7
20
|
color: ${e[t].text};
|
|
8
21
|
transition: all 0.3s;
|
|
9
22
|
|
|
10
23
|
&-selected {
|
|
11
|
-
background: ${e[t][
|
|
24
|
+
background: ${e[t][a]};
|
|
12
25
|
color: ${e[t].textContrast};
|
|
13
26
|
}
|
|
14
27
|
|
|
@@ -17,6 +30,7 @@
|
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
|
|
34
|
+
`,m=s(d)`
|
|
35
|
+
${({theme:e,type:n="primary",state:i="active"})=>r(e,n,i)}
|
|
36
|
+
`;exports.SegmentedControls=m;exports.getGenesisClass=r;
|
|
@@ -4,7 +4,7 @@ interface StyledSegmentedControlsProps {
|
|
|
4
4
|
type?: "primary" | "secondary";
|
|
5
5
|
state?: "active" | "disabled";
|
|
6
6
|
}
|
|
7
|
-
export declare const getGenesisClass: ({ colors, borderRadius, sizing }: GenesisTheme, type?: string, state?: string) => string;
|
|
7
|
+
export declare const getGenesisClass: ({ colors, borderRadius, sizing, typography }: GenesisTheme, type?: string, state?: string) => string;
|
|
8
8
|
export declare const SegmentedControls: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<Omit<import('antd').SegmentedProps<unknown> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
9
|
ref?: import('react').Ref<HTMLDivElement>;
|
|
10
10
|
}, StyledSegmentedControlsProps>> & string & Omit<(<ValueType>(props: import('antd').SegmentedProps<ValueType> & React.RefAttributes<HTMLDivElement>) => ReturnType<import('react').ForwardRefExoticComponent<Omit<import('antd').SegmentedProps<import('rc-segmented').SegmentedValue>, "ref"> & import('react').RefAttributes<HTMLDivElement>>>) & Pick<import('react').FC<{}>, "displayName">, keyof import('react').Component<any, {}, any>>;
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const s = ({ colors: e, borderRadius:
|
|
1
|
+
import i from "styled-components";
|
|
2
|
+
import m from "../../node_modules/antd/es/segmented/index.js";
|
|
3
|
+
const s = ({ colors: e, borderRadius: n, sizing: o, typography: a }, t = "primary", r = "active") => `
|
|
4
4
|
&.ant-segmented {
|
|
5
|
-
border-radius: ${
|
|
5
|
+
border-radius: ${n.BorderRadiusMd};
|
|
6
6
|
color: ${e.onsurface.copy};
|
|
7
|
-
|
|
7
|
+
font-family: ${a.fontFamily};
|
|
8
|
+
color: ${e.onsurface.copy};
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
:where(.css-dev-only-do-not-override-240cud).ant-segmented &.ant-segmented-item-icon + * {
|
|
12
|
+
margin-inline-start: 4px !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ant-segmented-item-label span + span {
|
|
16
|
+
margin-inline-start: 4px !important;
|
|
17
|
+
font-family: ${a.fontFamily};
|
|
18
|
+
color: ${e.onsurface.copy};
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
.ant-segmented-item {
|
|
9
22
|
color: ${e[t].text};
|
|
10
23
|
transition: all 0.3s;
|
|
11
24
|
|
|
12
25
|
&-selected {
|
|
13
|
-
background: ${e[t][
|
|
26
|
+
background: ${e[t][r]};
|
|
14
27
|
color: ${e[t].textContrast};
|
|
15
28
|
}
|
|
16
29
|
|
|
@@ -19,12 +32,13 @@ const s = ({ colors: e, borderRadius: r, sizing: o }, t = "primary", n = "active
|
|
|
19
32
|
}
|
|
20
33
|
}
|
|
21
34
|
}
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
|
|
36
|
+
`, l = i(
|
|
37
|
+
m
|
|
24
38
|
)`
|
|
25
|
-
${({ theme: e, type:
|
|
39
|
+
${({ theme: e, type: n = "primary", state: o = "active" }) => s(e, n, o)}
|
|
26
40
|
`;
|
|
27
41
|
export {
|
|
28
|
-
|
|
42
|
+
l as SegmentedControls,
|
|
29
43
|
s as getGenesisClass
|
|
30
44
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),d=require("react"),x=require("../../constants/index.cjs"),m=require("../shared/DropdownChevron.cjs"),t=require("./styles.cjs"),f=require("../../providers/useGenesis.cjs"),j=({type:r=x.TYPE.primary,state:c,variant:u="none",defaultValue:i,onChange:n,...l})=>{const{breakpoint:q}=f.useGenesis(),[a,o]=d.useState(!1);d.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
|
|
2
2
|
.ant-select-dropdown {
|
|
3
3
|
padding: 0px !important;
|
|
4
4
|
border-radius: 0px !important;
|
|
5
5
|
}
|
|
6
|
-
`,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]);const
|
|
6
|
+
`,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]);const p=e=>s.jsx(t.SelectDropdown,{type:r,state:c,children:s.jsx(t.StyledMenuItem,{type:r,state:c,children:e})});return s.jsx(t.SelectWrapper,{$isFocused:a,type:r,children:s.jsx(t.Select,{...l,defaultValue:i,$variant:u,suffixIcon:s.jsx(m,{}),dropdownRender:p,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:e=>{o(!1),n==null||n(e)}})})};module.exports=j;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { TYPE as
|
|
4
|
-
import
|
|
5
|
-
import { SelectWrapper as
|
|
6
|
-
import { useGenesis as
|
|
2
|
+
import p, { useEffect as l } from "react";
|
|
3
|
+
import { TYPE as u } from "../../constants/index.js";
|
|
4
|
+
import a from "../shared/DropdownChevron.js";
|
|
5
|
+
import { SelectWrapper as f, Select as S, SelectDropdown as w, StyledMenuItem as x } from "./styles.js";
|
|
6
|
+
import { useGenesis as h } from "../../providers/useGenesis.js";
|
|
7
7
|
const y = ({
|
|
8
|
-
type: t =
|
|
8
|
+
type: t = u.primary,
|
|
9
9
|
state: d,
|
|
10
10
|
variant: s = "none",
|
|
11
|
-
defaultValue:
|
|
11
|
+
defaultValue: c,
|
|
12
12
|
onChange: r,
|
|
13
|
-
...
|
|
13
|
+
...m
|
|
14
14
|
}) => {
|
|
15
|
-
const { breakpoint: D } =
|
|
16
|
-
return
|
|
15
|
+
const { breakpoint: D } = h(), [i, n] = p.useState(!1);
|
|
16
|
+
return l(() => {
|
|
17
17
|
const e = document.createElement("style");
|
|
18
18
|
return e.textContent = `
|
|
19
19
|
.ant-select-dropdown {
|
|
@@ -23,13 +23,14 @@ const y = ({
|
|
|
23
23
|
`, document.head.appendChild(e), () => {
|
|
24
24
|
document.head.removeChild(e);
|
|
25
25
|
};
|
|
26
|
-
}, []), /* @__PURE__ */ o(
|
|
27
|
-
|
|
26
|
+
}, []), /* @__PURE__ */ o(f, { $isFocused: i, type: t, children: /* @__PURE__ */ o(
|
|
27
|
+
S,
|
|
28
28
|
{
|
|
29
|
-
...
|
|
29
|
+
...m,
|
|
30
|
+
defaultValue: c,
|
|
30
31
|
$variant: s,
|
|
31
|
-
suffixIcon: /* @__PURE__ */ o(
|
|
32
|
-
dropdownRender: (e) => /* @__PURE__ */ o(
|
|
32
|
+
suffixIcon: /* @__PURE__ */ o(a, {}),
|
|
33
|
+
dropdownRender: (e) => /* @__PURE__ */ o(w, { type: t, state: d, children: /* @__PURE__ */ o(x, { type: t, state: d, children: e }) }),
|
|
33
34
|
onFocus: () => n(!0),
|
|
34
35
|
onBlur: () => n(!1),
|
|
35
36
|
onChange: (e) => {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
padding: 1px;
|
|
7
7
|
width: auto;
|
|
8
8
|
|
|
9
|
-
${({$isFocused:e,theme:o,type:
|
|
10
|
-
border: 2px solid ${o.colors[
|
|
9
|
+
${({$isFocused:e,theme:o,type:r="primary"})=>e&&`
|
|
10
|
+
border: 2px solid ${o.colors[r].focussed.ringColor};
|
|
11
11
|
background-color: transparent;
|
|
12
12
|
border-radius: 8px;
|
|
13
13
|
padding: 1px;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.ant-select-dropdown {
|
|
17
17
|
animation-duration: ${({theme:e})=>`${e.motion.veryfast}s`} !important;
|
|
18
18
|
}
|
|
19
|
-
`,l=e=>`all ${e.motion.veryfast}s ease-in-out`,p=(e,o,t
|
|
19
|
+
`,l=e=>`all ${e.motion.veryfast}s ease-in-out`,p=(e,o,r,t)=>`
|
|
20
20
|
&.ant-select {
|
|
21
21
|
background-color: ${e.surface.secondary};
|
|
22
22
|
border-color: ${e.surface.secondary};
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
.ant-select-selector {
|
|
26
26
|
background-color: ${e.surface.secondary};
|
|
27
27
|
border-color: ${e.surface.secondary};
|
|
28
|
-
border-radius: ${
|
|
28
|
+
border-radius: ${t.BorderRadiusSm}px;
|
|
29
29
|
margin: 0px;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`,u=({colors:e,sizing:o,typography:
|
|
32
|
+
`,u=({colors:e,sizing:o,typography:r,borderRadius:t},n,i,s)=>s==="simple"?p(e,n,i,t):`
|
|
33
33
|
&.ant-select {
|
|
34
34
|
color: ${e.input};
|
|
35
35
|
font-size: ${o.Size4}px;
|
|
@@ -40,13 +40,40 @@
|
|
|
40
40
|
|
|
41
41
|
width: 100%;
|
|
42
42
|
min-width: 250px;
|
|
43
|
-
height:
|
|
43
|
+
height: auto;
|
|
44
|
+
min-height: 32px;
|
|
44
45
|
|
|
45
46
|
background-color: ${e[n][i].backgroundColor}
|
|
46
47
|
|
|
47
|
-
border-radius: ${
|
|
48
|
+
border-radius: ${t.BorderRadiusMd}px;
|
|
48
49
|
gap: ${o.Size2}px;
|
|
49
50
|
|
|
51
|
+
.ant-select-selector {
|
|
52
|
+
border-color: ${e.inputs.surface.border};
|
|
53
|
+
padding-left: 4px;
|
|
54
|
+
height: auto !important;
|
|
55
|
+
min-height: 32px !important;
|
|
56
|
+
|
|
57
|
+
.ant-select-selection-overflow {
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
gap: 4px;
|
|
60
|
+
padding: 4px 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ant-select-selection-item {
|
|
64
|
+
margin-top: 0;
|
|
65
|
+
margin-bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ant-select-selection-item {
|
|
70
|
+
padding-left: 4px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ant-segmented-item-label span + span {
|
|
74
|
+
margin-inline-start: 4px !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
50
77
|
&:active {
|
|
51
78
|
background-color: ${e[n].pressed.backgroundColor};
|
|
52
79
|
border-color: ${e[n].pressed.borderColor};
|
|
@@ -124,6 +151,6 @@
|
|
|
124
151
|
&.ant-slide-up-leave {
|
|
125
152
|
animation-duration: ${({theme:e})=>`${e.motion.veryfast}s`} !important;
|
|
126
153
|
}
|
|
127
|
-
|
|
128
|
-
${({theme:e,type:o="primary",state:
|
|
129
|
-
`;exports.Select
|
|
154
|
+
`,g=a(d)`
|
|
155
|
+
${({theme:e,type:o="primary",state:r="active",$variant:t="none"})=>u(e,o,r,t)}
|
|
156
|
+
`;exports.Select=g;exports.SelectDropdown=b;exports.SelectWrapper=c;exports.StyledMenuItem=m;
|