@gobolt/genesis 0.2.16 → 0.2.17

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.
@@ -11,18 +11,20 @@ const Input = ({
11
11
  ...rest
12
12
  }) => {
13
13
  const { type, ...validRest } = rest;
14
- const validSize = size === "normal" ? "middle" : size;
15
14
  const addonAfter = React.isValidElement(rest.addonAfter) && rest.addonAfter.type === index ? React.cloneElement(rest.addonAfter, {
16
15
  suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(DropdownChevron, {})
17
16
  }) : rest.addonAfter;
18
17
  return /* @__PURE__ */ jsxRuntime.jsx(
19
18
  styles.Input,
20
19
  {
21
- size: validSize,
20
+ size,
22
21
  state,
23
22
  disabled: state === "disabled" || rest.disabled,
24
23
  ...validRest,
25
- addonAfter
24
+ addonAfter,
25
+ style: {
26
+ height: size === "normal" || size === "large" ? "40px" : "32px"
27
+ }
26
28
  }
27
29
  );
28
30
  };
@@ -10,18 +10,20 @@ const Input = ({
10
10
  ...rest
11
11
  }) => {
12
12
  const { type, ...validRest } = rest;
13
- const validSize = size === "normal" ? "middle" : size;
14
13
  const addonAfter = React__default.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select ? React__default.cloneElement(rest.addonAfter, {
15
14
  suffixIcon: /* @__PURE__ */ jsx(DropdownChevron, {})
16
15
  }) : rest.addonAfter;
17
16
  return /* @__PURE__ */ jsx(
18
17
  Input$1,
19
18
  {
20
- size: validSize,
19
+ size,
21
20
  state,
22
21
  disabled: state === "disabled" || rest.disabled,
23
22
  ...validRest,
24
- addonAfter
23
+ addonAfter,
24
+ style: {
25
+ height: size === "normal" || size === "large" ? "40px" : "32px"
26
+ }
25
27
  }
26
28
  );
27
29
  };
@@ -37,7 +37,7 @@ const getStateColors = (colors, type, state) => {
37
37
  const css = stateMap[getValidKey(state)];
38
38
  return css;
39
39
  };
40
- const getGenesisInputClass = ({ colors, borderRadius, components }, type, state, hasBeforeAddon, hasAfterAddon) => {
40
+ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state, hasBeforeAddon, hasAfterAddon, size) => {
41
41
  const stateColors = getStateColors(colors, type, state);
42
42
  const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
43
43
  if (hasAfterAddon2 && !hasBeforeAddon2) {
@@ -53,6 +53,7 @@ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state,
53
53
  font-family: 'Inter', sans-serif;
54
54
  color: ${stateColors.color};
55
55
  border-color: ${stateColors.borderColor};
56
+ height: ${size === "normal" || size === "large" ? "40px" : "32px !important"};
56
57
  }
57
58
 
58
59
  &.ant-input-outlined {
@@ -139,7 +140,7 @@ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state,
139
140
  `;
140
141
  };
141
142
  const Input = styled(index$1)`
142
- ${({ theme, state, type = index.TYPE.primary, ...rest }) => {
143
+ ${({ theme, state, type = index.TYPE.primary, size = "normal", ...rest }) => {
143
144
  const hasBeforeAddon = !!rest.addonBefore;
144
145
  const hasAfterAddon = !!rest.addonAfter;
145
146
  return getGenesisInputClass(
@@ -147,7 +148,8 @@ const Input = styled(index$1)`
147
148
  type,
148
149
  state,
149
150
  hasBeforeAddon,
150
- hasAfterAddon
151
+ hasAfterAddon,
152
+ size
151
153
  );
152
154
  }}
153
155
  `;
@@ -1,7 +1,8 @@
1
1
  import { InputProps as AntInputProps } from 'antd';
2
2
  import { STATE } from '../../constants';
3
- interface InputStyledProps extends AntInputProps {
3
+ interface InputStyledProps extends Omit<AntInputProps, "size"> {
4
4
  state?: keyof typeof STATE;
5
+ size?: "normal" | "small" | "large";
5
6
  }
6
7
  export declare const Input: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<Omit<AntInputProps & import('react').RefAttributes<import('rc-input').InputRef>, "ref"> & {
7
8
  ref?: import('react').Ref<import('rc-input').InputRef>;
@@ -36,7 +36,7 @@ const getStateColors = (colors, type, state) => {
36
36
  const css = stateMap[getValidKey(state)];
37
37
  return css;
38
38
  };
39
- const getGenesisInputClass = ({ colors, borderRadius, components }, type, state, hasBeforeAddon, hasAfterAddon) => {
39
+ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state, hasBeforeAddon, hasAfterAddon, size) => {
40
40
  const stateColors = getStateColors(colors, type, state);
41
41
  const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
42
42
  if (hasAfterAddon2 && !hasBeforeAddon2) {
@@ -52,6 +52,7 @@ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state,
52
52
  font-family: 'Inter', sans-serif;
53
53
  color: ${stateColors.color};
54
54
  border-color: ${stateColors.borderColor};
55
+ height: ${size === "normal" || size === "large" ? "40px" : "32px !important"};
55
56
  }
56
57
 
57
58
  &.ant-input-outlined {
@@ -138,7 +139,7 @@ const getGenesisInputClass = ({ colors, borderRadius, components }, type, state,
138
139
  `;
139
140
  };
140
141
  const Input = styled(Input$1)`
141
- ${({ theme, state, type = TYPE.primary, ...rest }) => {
142
+ ${({ theme, state, type = TYPE.primary, size = "normal", ...rest }) => {
142
143
  const hasBeforeAddon = !!rest.addonBefore;
143
144
  const hasAfterAddon = !!rest.addonAfter;
144
145
  return getGenesisInputClass(
@@ -146,7 +147,8 @@ const Input = styled(Input$1)`
146
147
  type,
147
148
  state,
148
149
  hasBeforeAddon,
149
- hasAfterAddon
150
+ hasAfterAddon,
151
+ size
150
152
  );
151
153
  }}
152
154
  `;
@@ -11,6 +11,7 @@ const Select = ({
11
11
  variant = "none",
12
12
  defaultValue,
13
13
  onChange,
14
+ size = "normal",
14
15
  ...rest
15
16
  }) => {
16
17
  const { breakpoint } = useGenesis.useGenesis();
@@ -33,6 +34,7 @@ const Select = ({
33
34
  styles.Select,
34
35
  {
35
36
  ...rest,
37
+ size,
36
38
  defaultValue,
37
39
  $variant: variant,
38
40
  suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(DropdownChevron, {}),
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { TYPE, STATE } from '../../constants';
3
3
  import { SelectProps as AntSelectProps } from 'antd';
4
- export interface SelectProps extends Omit<AntSelectProps, "variant"> {
4
+ export interface SelectProps extends Omit<AntSelectProps, "variant" | "size"> {
5
5
  type?: keyof typeof TYPE;
6
6
  state?: keyof typeof STATE;
7
7
  options?: {
@@ -11,6 +11,7 @@ export interface SelectProps extends Omit<AntSelectProps, "variant"> {
11
11
  variant?: "simple" | "none";
12
12
  defaultValue?: string | string[] | number | number[] | unknown;
13
13
  onChange?: (value: string | string[]) => void;
14
+ size?: "normal" | "small" | "large";
14
15
  }
15
- declare const Select: ({ type, state, variant, defaultValue, onChange, ...rest }: SelectProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const Select: ({ type, state, variant, defaultValue, onChange, size, ...rest }: SelectProps) => import("react/jsx-runtime").JSX.Element;
16
17
  export default Select;
@@ -10,6 +10,7 @@ const Select = ({
10
10
  variant = "none",
11
11
  defaultValue,
12
12
  onChange,
13
+ size = "normal",
13
14
  ...rest
14
15
  }) => {
15
16
  const { breakpoint } = useGenesis();
@@ -32,6 +33,7 @@ const Select = ({
32
33
  Select$1,
33
34
  {
34
35
  ...rest,
36
+ size,
35
37
  defaultValue,
36
38
  $variant: variant,
37
39
  suffixIcon: /* @__PURE__ */ jsx(DropdownChevron, {}),
@@ -39,7 +39,7 @@ const getSimpleVariant = (colors, type, state, borderRadius) => {
39
39
  }
40
40
  `;
41
41
  };
42
- const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius }, type, state, $variant) => {
42
+ const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius }, type, state, $variant, size) => {
43
43
  var _a, _b, _c, _d;
44
44
  if ($variant === "simple") {
45
45
  return getSimpleVariant(colors, type, state, borderRadius);
@@ -55,8 +55,7 @@ const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius },
55
55
 
56
56
  width: 100%;
57
57
  min-width: 250px;
58
- height: auto;
59
- min-height: 32px;
58
+ height: ${size === "normal" || size === "large" ? "40px" : "32px"};
60
59
 
61
60
  //background-color: ${colors[type][state].backgroundColor}
62
61
  background-color: #fff;
@@ -221,7 +220,13 @@ const SelectDropdown = styled.div`
221
220
  }
222
221
  `;
223
222
  const Select = styled(index)`
224
- ${({ theme: theme2, type = "primary", state = "active", $variant = "none" }) => getGenesisClass(theme2, type, state, $variant)}
223
+ ${({
224
+ theme: theme2,
225
+ type = "primary",
226
+ state = "active",
227
+ $variant = "none",
228
+ size = "normal"
229
+ }) => getGenesisClass(theme2, type, state, $variant, size)}
225
230
  `;
226
231
  exports.Select = Select;
227
232
  exports.SelectDropdown = SelectDropdown;
@@ -11,6 +11,7 @@ interface SelectWrapperProps {
11
11
  $isFocused: boolean;
12
12
  type: keyof typeof TYPE;
13
13
  variant?: "simple" | "none";
14
+ size?: "normal" | "small" | "large";
14
15
  }
15
16
  export declare const SelectWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SelectWrapperProps>> & string;
16
17
  export declare const getGenesisClass: ({ colors, sizing, typography, borderRadius }: {
@@ -18,7 +19,7 @@ export declare const getGenesisClass: ({ colors, sizing, typography, borderRadiu
18
19
  sizing: any;
19
20
  typography: any;
20
21
  borderRadius: any;
21
- }, type: any, state: any, $variant: any) => string;
22
+ }, type: any, state: any, $variant: any, size: any) => string;
22
23
  interface SelectMenuItemProps {
23
24
  theme: GenesisTheme;
24
25
  type?: keyof typeof TYPE;
@@ -29,6 +30,7 @@ interface SelectDropdownProps {
29
30
  theme: GenesisTheme;
30
31
  type?: keyof typeof TYPE;
31
32
  state?: keyof Breakpoint;
33
+ size?: "normal" | "small" | "large";
32
34
  }
33
35
  export declare const SelectDropdown: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SelectDropdownProps>> & string;
34
36
  type StyledSelectComponent = StyledComponent<typeof AntSelect, any, StyledSelectProps & {
@@ -38,7 +38,7 @@ const getSimpleVariant = (colors, type, state, borderRadius) => {
38
38
  }
39
39
  `;
40
40
  };
41
- const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius }, type, state, $variant) => {
41
+ const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius }, type, state, $variant, size) => {
42
42
  var _a, _b, _c, _d;
43
43
  if ($variant === "simple") {
44
44
  return getSimpleVariant(colors, type, state, borderRadius);
@@ -54,8 +54,7 @@ const getGenesisClass = ({ colors, sizing: sizing2, typography, borderRadius },
54
54
 
55
55
  width: 100%;
56
56
  min-width: 250px;
57
- height: auto;
58
- min-height: 32px;
57
+ height: ${size === "normal" || size === "large" ? "40px" : "32px"};
59
58
 
60
59
  //background-color: ${colors[type][state].backgroundColor}
61
60
  background-color: #fff;
@@ -220,7 +219,13 @@ const SelectDropdown = styled.div`
220
219
  }
221
220
  `;
222
221
  const Select = styled(Select$1)`
223
- ${({ theme: theme2, type = "primary", state = "active", $variant = "none" }) => getGenesisClass(theme2, type, state, $variant)}
222
+ ${({
223
+ theme: theme2,
224
+ type = "primary",
225
+ state = "active",
226
+ $variant = "none",
227
+ size = "normal"
228
+ }) => getGenesisClass(theme2, type, state, $variant, size)}
224
229
  `;
225
230
  export {
226
231
  Select,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobolt/genesis",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "genesis design system",
5
5
  "author": "gobolt",
6
6
  "license": "MIT",