@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.
Files changed (40) hide show
  1. package/dist/components/Button/Button.d.ts +2 -1
  2. package/dist/components/Button/__stories__/Button.stories.d.ts +1 -0
  3. package/dist/components/Button/icon-button-styles.d.ts +1 -1
  4. package/dist/components/Button/styles.cjs +12 -12
  5. package/dist/components/Button/styles.d.ts +1 -1
  6. package/dist/components/Button/styles.js +9 -9
  7. package/dist/components/Card/__stories__/Card.stories.d.ts +2 -0
  8. package/dist/components/Input/Input.cjs +1 -1
  9. package/dist/components/Input/Input.js +20 -14
  10. package/dist/components/Notification/NotificationBadge/styles.cjs +19 -5
  11. package/dist/components/Notification/NotificationBadge/styles.js +16 -2
  12. package/dist/components/SegmentedControls/styles.cjs +21 -7
  13. package/dist/components/SegmentedControls/styles.d.ts +1 -1
  14. package/dist/components/SegmentedControls/styles.js +24 -10
  15. package/dist/components/Select/Select.cjs +2 -2
  16. package/dist/components/Select/Select.js +16 -15
  17. package/dist/components/Select/styles.cjs +15 -2
  18. package/dist/components/Select/styles.js +13 -0
  19. package/dist/components/shared/DropdownChevron.cjs +1 -0
  20. package/dist/components/shared/DropdownChevron.js +27 -0
  21. package/dist/constants/index.cjs +1 -1
  22. package/dist/constants/index.d.ts +2 -0
  23. package/dist/constants/index.js +13 -12
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +57 -50
  27. package/dist/node_modules/react-icons/pi/index.cjs +1 -0
  28. package/dist/node_modules/react-icons/pi/index.js +12 -0
  29. package/dist/node_modules/react-icons/tb/index.cjs +1 -1
  30. package/dist/node_modules/react-icons/tb/index.js +4 -8
  31. package/dist/styles/theme/genesis-theme.cjs +1 -1
  32. package/dist/styles/theme/genesis-theme.js +292 -223
  33. package/dist/styles/theme/genesis-theme.types.d.ts +1 -0
  34. package/dist/styles/theme/index.d.ts +1 -0
  35. package/dist/utils/icon-util.cjs +1 -1
  36. package/dist/utils/icon-util.js +24 -24
  37. package/package.json +1 -1
  38. package/dist/components/Select/DropdownChevron.cjs +0 -1
  39. package/dist/components/Select/DropdownChevron.js +0 -23
  40. /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 b=require("styled-components"),e=require("../../node_modules/antd/es/button/button.cjs"),i=(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`,c=r=>r==="normal"||r==="large"?"40px":r==="small"?"32px":"40px",x=({colors:r,sizing:l,borderRadius:d,components:n},o,a,t,u)=>(r[o][a].backgroundColor,`
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][a].color};
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: auto; !important;
13
- height: ${c(t)}; !important;
12
+ width: ${c(a,u)}; !important;
13
+ height: ${i(a)}; !important;
14
14
 
15
- background-color: ${r[o][a].backgroundColor};
16
- padding: ${i(t,o,l,u)};
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][a].borderColor};
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
- `),f=(r,l,d,n,o)=>`
58
+ `),p=(r,l,d,n,o)=>`
59
59
  &.ant-btn {
60
60
  font-family: 'Inter', sans-serif;
61
61
 
62
- ${x(r,l,d,o,n)}
62
+ ${f(r,l,d,o,n)}
63
63
  }
64
- `,p=b(e)`
65
- ${({theme:r,$themeType:l,$state:d,children:n,$isIconButton:o,size:a})=>f(r,l,d,o,a)}
66
- `;exports.Button=p;
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 b from "styled-components";
2
- import x 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`, c = (r) => r === "normal" || r === "large" ? "40px" : r === "small" ? "32px" : "40px", e = ({ colors: r, sizing: l, borderRadius: d, components: a }, o, n, t, u) => (r[o][n].backgroundColor, `
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: auto; !important;
15
- height: ${c(t)}; !important;
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
- `), f = (r, l, d, a, o) => `
60
+ `), p = (r, l, d, a, o) => `
61
61
  &.ant-btn {
62
62
  font-family: 'Inter', sans-serif;
63
63
 
64
- ${e(r, l, d, o, a)}
64
+ ${f(r, l, d, o, a)}
65
65
  }
66
- `, S = b(x)`
67
- ${({ theme: r, $themeType: l, $state: d, children: a, $isIconButton: o, size: n }) => f(
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,
@@ -4,3 +4,5 @@ declare const meta: Meta<typeof Card>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Card>;
6
6
  export declare const CardStory: Story;
7
+ export declare const SalesVersion2: Story;
8
+ export declare const SalesCardStory: Story;
@@ -1 +1 @@
1
- "use strict";const d=require("react/jsx-runtime"),r=require("./styles.cjs"),l=require("../../constants/index.cjs"),o=({state:e=l.STATE.active,size:s="normal",...i})=>{const{type:c,...t}=i,n=s==="normal"?"middle":s;return d.jsx(r.Input,{size:n,state:e,disabled:e==="disabled"||i.disabled,...t})};module.exports=o;
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 a } from "react/jsx-runtime";
2
- import { Input as e } from "./styles.js";
3
- import { STATE as l } from "../../constants/index.js";
4
- const u = ({
5
- state: i = l.active,
6
- size: d = "normal",
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: r, ...t } = o;
10
- return /* @__PURE__ */ a(
11
- e,
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: d === "normal" ? "middle" : d,
14
- state: i,
15
- disabled: i === "disabled" || o.disabled,
16
- ...t
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
- u as default
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: -10px;
8
- left: 16px;
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
- `,r=t.div`
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
- `,i=t.div`
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=r;exports.BadgeState=o;exports.BadgeWrapper=i;
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: -10px;
9
- left: 16px;
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 i=require("styled-components"),a=require("../../node_modules/antd/es/segmented/index.cjs"),s=({colors:e,borderRadius:r,sizing:n},t="primary",o="active")=>`
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: ${r.BorderRadiusMd};
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][o]};
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
- `,d=i(a)`
21
- ${({theme:e,type:r="primary",state:n="active"})=>s(e,r,n)}
22
- `;exports.SegmentedControls=d;exports.getGenesisClass=s;
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 a from "styled-components";
2
- import i from "../../node_modules/antd/es/segmented/index.js";
3
- const s = ({ colors: e, borderRadius: r, sizing: o }, t = "primary", n = "active") => `
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: ${r.BorderRadiusMd};
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][n]};
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
- `, c = a(
23
- i
35
+
36
+ `, l = i(
37
+ m
24
38
  )`
25
- ${({ theme: e, type: r = "primary", state: o = "active" }) => s(e, r, o)}
39
+ ${({ theme: e, type: n = "primary", state: o = "active" }) => s(e, n, o)}
26
40
  `;
27
41
  export {
28
- c as SegmentedControls,
42
+ l as SegmentedControls,
29
43
  s as getGenesisClass
30
44
  };
@@ -1,6 +1,6 @@
1
- "use strict";const t=require("react/jsx-runtime"),d=require("react"),p=require("../../constants/index.cjs"),x=require("./DropdownChevron.cjs"),s=require("./styles.cjs"),m=require("../../providers/useGenesis.cjs"),f=({type:r=p.TYPE.primary,state:c,variant:u="none",defaultValue:j,onChange:n,...i})=>{const{breakpoint:q}=m.useGenesis(),[l,o]=d.useState(!1);d.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
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 a=e=>t.jsx(s.SelectDropdown,{type:r,state:c,children:t.jsx(s.StyledMenuItem,{type:r,state:c,children:e})});return t.jsx(s.SelectWrapper,{$isFocused:l,type:r,children:t.jsx(s.Select,{...i,$variant:u,suffixIcon:t.jsx(x,{}),dropdownRender:a,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:e=>{o(!1),n==null||n(e)}})})};module.exports=f;
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 m, { useEffect as u } from "react";
3
- import { TYPE as i } from "../../constants/index.js";
4
- import p from "./DropdownChevron.js";
5
- import { SelectWrapper as a, Select as f, SelectDropdown as S, StyledMenuItem as w } from "./styles.js";
6
- import { useGenesis as x } from "../../providers/useGenesis.js";
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 = i.primary,
8
+ type: t = u.primary,
9
9
  state: d,
10
10
  variant: s = "none",
11
- defaultValue: h,
11
+ defaultValue: c,
12
12
  onChange: r,
13
- ...c
13
+ ...m
14
14
  }) => {
15
- const { breakpoint: D } = x(), [l, n] = m.useState(!1);
16
- return u(() => {
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(a, { $isFocused: l, type: t, children: /* @__PURE__ */ o(
27
- f,
26
+ }, []), /* @__PURE__ */ o(f, { $isFocused: i, type: t, children: /* @__PURE__ */ o(
27
+ S,
28
28
  {
29
- ...c,
29
+ ...m,
30
+ defaultValue: c,
30
31
  $variant: s,
31
- suffixIcon: /* @__PURE__ */ o(p, {}),
32
- dropdownRender: (e) => /* @__PURE__ */ o(S, { type: t, state: d, children: /* @__PURE__ */ o(w, { type: t, state: d, children: e }) }),
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
- `,$=a(d)`
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=$;exports.SelectDropdown=b;exports.SelectWrapper=c;exports.StyledMenuItem=m;
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
+ };
@@ -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"},n={primary:"primary",secondary:"secondary",tertiary:"tertiary"},a={small:"small",medium:"medium",large:"large",standard:"standard"},d={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:n,SIZE:a,BADGE:d};exports.BADGE=d;exports.BREAKPOINTS=i;exports.BUTTON_VARIANT=n;exports.SIZE=a;exports.STATE=s;exports.TYPE=e;exports.TYPOGRAPHY_VARIANT=r;exports.default=o;
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
  };
@@ -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
- }, n = {
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
- }, r = {
55
+ }, d = {
55
56
  primary: "primary",
56
57
  secondary: "secondary",
57
58
  tertiary: "tertiary"
58
- }, a = {
59
+ }, n = {
59
60
  small: "small",
60
61
  medium: "medium",
61
62
  large: "large",
62
63
  standard: "standard"
63
- }, d = {
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: n,
78
- BUTTON_VARIANT: r,
79
- SIZE: a,
80
- BADGE: d
78
+ TYPOGRAPHY_VARIANT: r,
79
+ BUTTON_VARIANT: d,
80
+ SIZE: n,
81
+ BADGE: a
81
82
  };
82
83
  export {
83
- d as BADGE,
84
+ a as BADGE,
84
85
  i as BREAKPOINTS,
85
- r as BUTTON_VARIANT,
86
- a as SIZE,
86
+ d as BUTTON_VARIANT,
87
+ n as SIZE,
87
88
  s as STATE,
88
89
  e as TYPE,
89
- n as TYPOGRAPHY_VARIANT,
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 e=require("./constants/index.cjs"),r=require("./styles/global-styles.cjs"),o=require("./components/Avatar/Avatar.cjs"),t=require("./components/Badge/Badge.cjs"),s=require("./components/Breadcrumb/Breadcrumb.cjs"),i=require("./components/Button/Button.cjs"),n=require("./components/Button/UtilityButton.cjs"),u=require("./components/Button/IconButton.cjs"),c=require("./components/Card/Card.cjs"),a=require("./components/Checkbox/Checkbox.cjs"),l=require("./components/DatePicker/DatePicker.cjs"),q=require("./components/DateRangePicker/DateRangePicker.cjs"),b=require("./components/ErrorBoundary/ErrorBoundary.cjs"),d=require("./components/ErrorBoundaryFallback/ErrorBoundaryFallback.cjs"),T=require("./components/Form/Form.cjs"),y=require("./components/Input/Input.cjs"),g=require("./components/Layout/Layout.cjs"),p=require("./components/Message/Message.cjs"),S=require("./components/Notification/Notification.cjs"),B=require("./components/Popover/Popover.cjs"),h=require("./components/Progress/Progress.cjs"),P=require("./components/Radio/RadioGroup.cjs"),C=require("./components/Row/Row.cjs"),G=require("./components/SegmentedControls/SegmentedControls.cjs"),k=require("./components/Select/Select.cjs"),v=require("./components/Shapes/Shapes.cjs"),m=require("./components/Switch/Switch.cjs"),E=require("./components/Table/Table.cjs"),R=require("./components/Table/TableWithControls/TableWithControls.cjs"),f=require("./components/Tabs/Tabs.cjs"),I=require("./components/Tile/Tile.cjs"),W=require("./components/Toast/Toast.cjs"),w=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");exports.GENESIS=e.default;exports.GlobalStyles=r.GlobalStyles;exports.Avatar=o;exports.Badge=t;exports.Breadcrumb=s;exports.Button=i;exports.UtilityButton=n;exports.IconButton=u;exports.Card=c;exports.Checkbox=a;exports.DatePicker=l;exports.DateRangePicker=q;exports.ErrorBoundary=b;exports.ErrorBoundaryFallback=d;exports.Form=T.default;exports.Input=y;exports.Layout=g;exports.Message=p;exports.Notification=S;exports.Popover=B;exports.Progress=h;exports.RadioGroup=P;exports.Row=C;exports.SegmentedControls=G;exports.Select=k;exports.Shapes=v;exports.Switch=m;exports.Table=E;exports.TableWithControls=R;exports.Tabs=f;exports.Tile=I;exports.Toast=W;exports.Tooltip=w;exports.Typography=D;exports.GenesisProvider=F.GenesisProvider;exports.useTable=x.useTable;exports.useTableWithControls=M.useTableWithControls;exports.useGenesis=N.useGenesis;
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;