@gobolt/genesis 0.2.5 → 0.2.6
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/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/styles.cjs +15 -2
- package/dist/components/Select/styles.js +13 -0
- 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/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
|
@@ -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) => {
|
|
@@ -47,6 +47,19 @@
|
|
|
47
47
|
border-radius: ${r.BorderRadiusMd}px;
|
|
48
48
|
gap: ${o.Size2}px;
|
|
49
49
|
|
|
50
|
+
.ant-select-selector {
|
|
51
|
+
border-color: ${e.inputs.surface.border};
|
|
52
|
+
padding-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ant-select-selection-item {
|
|
56
|
+
padding-left: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ant-segmented-item-label span + span {
|
|
60
|
+
margin-inline-start: 4px !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
&:active {
|
|
51
64
|
background-color: ${e[n].pressed.backgroundColor};
|
|
52
65
|
border-color: ${e[n].pressed.borderColor};
|
|
@@ -124,6 +137,6 @@
|
|
|
124
137
|
&.ant-slide-up-leave {
|
|
125
138
|
animation-duration: ${({theme:e})=>`${e.motion.veryfast}s`} !important;
|
|
126
139
|
}
|
|
127
|
-
|
|
140
|
+
`,g=a(d)`
|
|
128
141
|
${({theme:e,type:o="primary",state:t="active",$variant:r="none"})=>u(e,o,t,r)}
|
|
129
|
-
`;exports.Select
|
|
142
|
+
`;exports.Select=g;exports.SelectDropdown=b;exports.SelectWrapper=c;exports.StyledMenuItem=m;
|
|
@@ -49,6 +49,19 @@ const b = a.div`
|
|
|
49
49
|
border-radius: ${r.BorderRadiusMd}px;
|
|
50
50
|
gap: ${o.Size2}px;
|
|
51
51
|
|
|
52
|
+
.ant-select-selector {
|
|
53
|
+
border-color: ${e.inputs.surface.border};
|
|
54
|
+
padding-left: 4px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ant-select-selection-item {
|
|
58
|
+
padding-left: 4px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ant-segmented-item-label span + span {
|
|
62
|
+
margin-inline-start: 4px !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
52
65
|
&:active {
|
|
53
66
|
background-color: ${e[n].pressed.backgroundColor};
|
|
54
67
|
border-color: ${e[n].pressed.borderColor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("../../providers/useGenesis.cjs"),o=s=>{const{theme:n}=l.useGenesis();return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...s,children:e.jsx("path",{fill:n.colors.inputs.onsurface.placeholder,fillRule:"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})})};module.exports=o;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useGenesis as n } from "../../providers/useGenesis.js";
|
|
3
|
+
const s = (l) => {
|
|
4
|
+
const { theme: o } = n();
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
width: 20,
|
|
10
|
+
height: 20,
|
|
11
|
+
fill: "none",
|
|
12
|
+
...l,
|
|
13
|
+
children: /* @__PURE__ */ e(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
fill: o.colors.inputs.onsurface.placeholder,
|
|
17
|
+
fillRule: "evenodd",
|
|
18
|
+
d: "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z",
|
|
19
|
+
clipRule: "evenodd"
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
s as default
|
|
27
|
+
};
|
package/dist/constants/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={primary:"primary",secondary:"secondary",tertiary:"tertiary",utility:"utility",icon:"icon"},i={wide:"wide",medium:"medium",narrow:"narrow"},s={active:"active",hover:"hover",pressed:"pressed",focussed:"focus",disabled:"disabled",error:"error",success:"success",warning:"warning",progress:"progress",info:"info",filled:"filled",generic:"generic",removed:"removed",hollow:"hollow"},r={display1:"display1",display2:"display2",display3:"display3",heading1:"heading1",heading2:"heading2",heading3:"heading3",subHeading1:"subHeading1",subHeading2:"subHeading2",subHeading3:"subHeading3",body1:"body1",body2:"body2",body3:"body3",body4:"body4",body5:"body5",message:"message",overline1:"overline1",overline2:"overline2",overline3:"overline3",label1:"label1",label2:"label2",label3:"label3",link1:"link1",link2:"link2",link3:"link3",digits1:"digits1",digits2:"digits2",digits3:"digits3"},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={primary:"primary",secondary:"secondary",tertiary:"tertiary",destructive:"destructive",utility:"utility",icon:"icon"},i={wide:"wide",medium:"medium",narrow:"narrow"},s={active:"active",hover:"hover",pressed:"pressed",focussed:"focus",disabled:"disabled",error:"error",success:"success",warning:"warning",progress:"progress",info:"info",filled:"filled",generic:"generic",removed:"removed",hollow:"hollow"},r={display1:"display1",display2:"display2",display3:"display3",heading1:"heading1",heading2:"heading2",heading3:"heading3",subHeading1:"subHeading1",subHeading2:"subHeading2",subHeading3:"subHeading3",body1:"body1",body2:"body2",body3:"body3",body4:"body4",body5:"body5",message:"message",overline1:"overline1",overline2:"overline2",overline3:"overline3",label1:"label1",label2:"label2",label3:"label3",link1:"link1",link2:"link2",link3:"link3",digits1:"digits1",digits2:"digits2",digits3:"digits3"},d={primary:"primary",secondary:"secondary",tertiary:"tertiary"},n={small:"small",medium:"medium",large:"large",standard:"standard"},a={appointment:"appointment",asn:"asn",inventory:"inventory",parcel:"parcel",product:"product",route:"route",shipment:"shipment",shoppingCart:"shopping cart",system:"system"},o={TYPE:e,BREAKPOINTS:i,STATE:s,TYPOGRAPHY_VARIANT:r,BUTTON_VARIANT:d,SIZE:n,BADGE:a};exports.BADGE=a;exports.BREAKPOINTS=i;exports.BUTTON_VARIANT=d;exports.SIZE=n;exports.STATE=s;exports.TYPE=e;exports.TYPOGRAPHY_VARIANT=r;exports.default=o;
|
|
@@ -2,6 +2,7 @@ export declare const TYPE: {
|
|
|
2
2
|
primary: string;
|
|
3
3
|
secondary: string;
|
|
4
4
|
tertiary: string;
|
|
5
|
+
destructive: string;
|
|
5
6
|
utility: string;
|
|
6
7
|
icon: string;
|
|
7
8
|
};
|
|
@@ -82,6 +83,7 @@ declare const _default: {
|
|
|
82
83
|
primary: string;
|
|
83
84
|
secondary: string;
|
|
84
85
|
tertiary: string;
|
|
86
|
+
destructive: string;
|
|
85
87
|
utility: string;
|
|
86
88
|
icon: string;
|
|
87
89
|
};
|
package/dist/constants/index.js
CHANGED
|
@@ -2,6 +2,7 @@ const e = {
|
|
|
2
2
|
primary: "primary",
|
|
3
3
|
secondary: "secondary",
|
|
4
4
|
tertiary: "tertiary",
|
|
5
|
+
destructive: "destructive",
|
|
5
6
|
utility: "utility",
|
|
6
7
|
icon: "icon"
|
|
7
8
|
}, i = {
|
|
@@ -23,7 +24,7 @@ const e = {
|
|
|
23
24
|
generic: "generic",
|
|
24
25
|
removed: "removed",
|
|
25
26
|
hollow: "hollow"
|
|
26
|
-
},
|
|
27
|
+
}, r = {
|
|
27
28
|
display1: "display1",
|
|
28
29
|
display2: "display2",
|
|
29
30
|
display3: "display3",
|
|
@@ -51,16 +52,16 @@ const e = {
|
|
|
51
52
|
digits1: "digits1",
|
|
52
53
|
digits2: "digits2",
|
|
53
54
|
digits3: "digits3"
|
|
54
|
-
},
|
|
55
|
+
}, d = {
|
|
55
56
|
primary: "primary",
|
|
56
57
|
secondary: "secondary",
|
|
57
58
|
tertiary: "tertiary"
|
|
58
|
-
},
|
|
59
|
+
}, n = {
|
|
59
60
|
small: "small",
|
|
60
61
|
medium: "medium",
|
|
61
62
|
large: "large",
|
|
62
63
|
standard: "standard"
|
|
63
|
-
},
|
|
64
|
+
}, a = {
|
|
64
65
|
appointment: "appointment",
|
|
65
66
|
asn: "asn",
|
|
66
67
|
inventory: "inventory",
|
|
@@ -74,18 +75,18 @@ const e = {
|
|
|
74
75
|
TYPE: e,
|
|
75
76
|
BREAKPOINTS: i,
|
|
76
77
|
STATE: s,
|
|
77
|
-
TYPOGRAPHY_VARIANT:
|
|
78
|
-
BUTTON_VARIANT:
|
|
79
|
-
SIZE:
|
|
80
|
-
BADGE:
|
|
78
|
+
TYPOGRAPHY_VARIANT: r,
|
|
79
|
+
BUTTON_VARIANT: d,
|
|
80
|
+
SIZE: n,
|
|
81
|
+
BADGE: a
|
|
81
82
|
};
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
a as BADGE,
|
|
84
85
|
i as BREAKPOINTS,
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
d as BUTTON_VARIANT,
|
|
87
|
+
n as SIZE,
|
|
87
88
|
s as STATE,
|
|
88
89
|
e as TYPE,
|
|
89
|
-
|
|
90
|
+
r as TYPOGRAPHY_VARIANT,
|
|
90
91
|
o as default
|
|
91
92
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./constants/index.cjs"),o=require("./styles/global-styles.cjs"),t=require("./components/Avatar/Avatar.cjs"),s=require("./components/Badge/Badge.cjs"),i=require("./components/Breadcrumb/Breadcrumb.cjs"),n=require("./components/Button/Button.cjs"),u=require("./components/Button/UtilityButton.cjs"),a=require("./components/Button/IconButton.cjs"),c=require("./components/Card/Card.cjs"),l=require("./components/Checkbox/Checkbox.cjs"),q=require("./components/DatePicker/DatePicker.cjs"),T=require("./components/DateRangePicker/DateRangePicker.cjs"),b=require("./components/ErrorBoundary/ErrorBoundary.cjs"),d=require("./components/ErrorBoundaryFallback/ErrorBoundaryFallback.cjs"),y=require("./components/Form/Form.cjs"),g=require("./components/Input/Input.cjs"),h=require("./components/Layout/Layout.cjs"),p=require("./components/Message/Message.cjs"),S=require("./components/Notification/Notification.cjs"),k=require("./components/Popover/Popover.cjs"),B=require("./components/Progress/Progress.cjs"),m=require("./components/Radio/RadioGroup.cjs"),P=require("./components/Row/Row.cjs"),C=require("./components/SegmentedControls/SegmentedControls.cjs"),G=require("./components/Select/Select.cjs"),v=require("./components/Shapes/Shapes.cjs"),E=require("./components/Switch/Switch.cjs"),R=require("./components/Table/Table.cjs"),f=require("./components/Table/TableWithControls/TableWithControls.cjs"),I=require("./components/Tabs/Tabs.cjs"),W=require("./components/Tile/Tile.cjs"),w=require("./components/Toast/Toast.cjs"),z=require("./components/Tooltip/Tooltip.cjs"),D=require("./components/Typography/Typography.cjs"),F=require("./providers/GenesisProvider.cjs"),x=require("./components/Table/useTable.cjs"),M=require("./components/Table/TableWithControls/useTableWithControls.cjs"),N=require("./providers/useGenesis.cjs"),e=require("./styles/theme/genesis-theme.cjs");exports.GENESIS=r.default;exports.GlobalStyles=o.GlobalStyles;exports.Avatar=t;exports.Badge=s;exports.Breadcrumb=i;exports.Button=n;exports.UtilityButton=u;exports.IconButton=a;exports.Card=c;exports.Checkbox=l;exports.DatePicker=q;exports.DateRangePicker=T;exports.ErrorBoundary=b;exports.ErrorBoundaryFallback=d;exports.Form=y.default;exports.Input=g;exports.Layout=h;exports.Message=p;exports.Notification=S;exports.Popover=k;exports.Progress=B;exports.RadioGroup=m;exports.Row=P;exports.SegmentedControls=C;exports.Select=G;exports.Shapes=v;exports.Switch=E;exports.Table=R;exports.TableWithControls=f;exports.Tabs=I;exports.Tile=W;exports.Toast=w;exports.Tooltip=z;exports.Typography=D;exports.GenesisProvider=F.GenesisProvider;exports.useTable=x.useTable;exports.useTableWithControls=M.useTableWithControls;exports.useGenesis=N.useGenesis;exports.TypographySizeKey=e.TypographySizeKey;exports.baseTokens=e.baseTokens;exports.breakpoints=e.breakpoints;exports.darkTheme=e.darkTheme;exports.lightTheme=e.lightTheme;exports.sizing=e.sizing;
|