@gobolt/genesis 0.2.16 → 0.2.18

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,7 +11,8 @@ const DateRangerPicker = (props) => {
11
11
  ...props,
12
12
  style: {
13
13
  border: `1px solid ${theme.colors.inputs.surface.border}`,
14
- padding: "8px"
14
+ padding: "8px",
15
+ width: "100%"
15
16
  }
16
17
  }
17
18
  );
@@ -10,7 +10,8 @@ const DateRangerPicker = (props) => {
10
10
  ...props,
11
11
  style: {
12
12
  border: `1px solid ${theme.colors.inputs.surface.border}`,
13
- padding: "8px"
13
+ padding: "8px",
14
+ width: "100%"
14
15
  }
15
16
  }
16
17
  );
@@ -6,4 +6,5 @@ type Story = StoryObj<typeof DateRangePicker>;
6
6
  export declare const DateRange: Story;
7
7
  export declare const DateTimeRange: Story;
8
8
  export declare const SetDateRange: Story;
9
+ export declare const FillParentWidth: Story;
9
10
  export declare const CommplexRow: Story;
@@ -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,
@@ -25,8 +25,6 @@ export { default as ErrorBoundaryFallback } from './ErrorBoundaryFallback';
25
25
  export type { ErrorBoundaryFallbackProps } from './ErrorBoundaryFallback';
26
26
  export { default as Form } from './Form';
27
27
  export type { FormProps } from './Form';
28
- export { default as GoBolt } from './GoBolt';
29
- export type { GoBoltProps } from './GoBolt';
30
28
  export { default as Input } from './Input';
31
29
  export type { InputProps } from './Input';
32
30
  export { default as Layout } from './Layout';
package/dist/index.cjs CHANGED
@@ -14,7 +14,6 @@ var DateRangePicker = require("./components/DateRangePicker/DateRangePicker.cjs"
14
14
  var ErrorBoundary = require("./components/ErrorBoundary/ErrorBoundary.cjs");
15
15
  var ErrorBoundaryFallback = require("./components/ErrorBoundaryFallback/ErrorBoundaryFallback.cjs");
16
16
  var Form = require("./components/Form/Form.cjs");
17
- var GoBolt = require("./components/GoBolt/GoBolt.cjs");
18
17
  var Input = require("./components/Input/Input.cjs");
19
18
  var Layout = require("./components/Layout/Layout.cjs");
20
19
  var Message = require("./components/Message/Message.cjs");
@@ -55,7 +54,6 @@ exports.DateRangePicker = DateRangePicker;
55
54
  exports.ErrorBoundary = ErrorBoundary;
56
55
  exports.ErrorBoundaryFallback = ErrorBoundaryFallback;
57
56
  exports.Form = Form.default;
58
- exports.GoBolt = GoBolt;
59
57
  exports.Input = Input;
60
58
  exports.Layout = Layout;
61
59
  exports.Message = Message;
package/dist/index.js CHANGED
@@ -13,27 +13,26 @@ import { default as default12 } from "./components/DateRangePicker/DateRangePick
13
13
  import { default as default13 } from "./components/ErrorBoundary/ErrorBoundary.js";
14
14
  import { default as default14 } from "./components/ErrorBoundaryFallback/ErrorBoundaryFallback.js";
15
15
  import { default as default15 } from "./components/Form/Form.js";
16
- import { default as default16 } from "./components/GoBolt/GoBolt.js";
17
- import { default as default17 } from "./components/Input/Input.js";
18
- import { default as default18 } from "./components/Layout/Layout.js";
19
- import { default as default19 } from "./components/Message/Message.js";
20
- import { default as default20 } from "./components/Notification/Notification.js";
21
- import { default as default21 } from "./components/Popover/Popover.js";
22
- import { default as default22 } from "./components/Progress/Progress.js";
23
- import { default as default23 } from "./components/Radio/RadioGroup.js";
24
- import { default as default24 } from "./components/Row/Row.js";
25
- import { default as default25 } from "./components/SegmentedControls/SegmentedControls.js";
26
- import { default as default26 } from "./components/Select/Select.js";
27
- import { default as default27 } from "./components/Select/MultiSelectCount.js";
28
- import { default as default28 } from "./components/Shapes/Shapes.js";
29
- import { default as default29 } from "./components/Switch/Switch.js";
30
- import { default as default30 } from "./components/Table/Table.js";
31
- import { default as default31 } from "./components/Table/TableWithControls/TableWithControls.js";
32
- import { default as default32 } from "./components/Tabs/Tabs.js";
33
- import { default as default33 } from "./components/Tile/Tile.js";
34
- import { default as default34 } from "./components/Toast/Toast.js";
35
- import { default as default35 } from "./components/Tooltip/Tooltip.js";
36
- import { default as default36 } from "./components/Typography/Typography.js";
16
+ import { default as default16 } from "./components/Input/Input.js";
17
+ import { default as default17 } from "./components/Layout/Layout.js";
18
+ import { default as default18 } from "./components/Message/Message.js";
19
+ import { default as default19 } from "./components/Notification/Notification.js";
20
+ import { default as default20 } from "./components/Popover/Popover.js";
21
+ import { default as default21 } from "./components/Progress/Progress.js";
22
+ import { default as default22 } from "./components/Radio/RadioGroup.js";
23
+ import { default as default23 } from "./components/Row/Row.js";
24
+ import { default as default24 } from "./components/SegmentedControls/SegmentedControls.js";
25
+ import { default as default25 } from "./components/Select/Select.js";
26
+ import { default as default26 } from "./components/Select/MultiSelectCount.js";
27
+ import { default as default27 } from "./components/Shapes/Shapes.js";
28
+ import { default as default28 } from "./components/Switch/Switch.js";
29
+ import { default as default29 } from "./components/Table/Table.js";
30
+ import { default as default30 } from "./components/Table/TableWithControls/TableWithControls.js";
31
+ import { default as default31 } from "./components/Tabs/Tabs.js";
32
+ import { default as default32 } from "./components/Tile/Tile.js";
33
+ import { default as default33 } from "./components/Toast/Toast.js";
34
+ import { default as default34 } from "./components/Tooltip/Tooltip.js";
35
+ import { default as default35 } from "./components/Typography/Typography.js";
37
36
  import { GenesisProvider } from "./providers/GenesisProvider.js";
38
37
  import { useTable } from "./components/Table/useTable.js";
39
38
  import { useTableWithControls } from "./components/Table/TableWithControls/useTableWithControls.js";
@@ -54,28 +53,27 @@ export {
54
53
  default2 as GENESIS,
55
54
  GenesisProvider,
56
55
  GlobalStyles,
57
- default16 as GoBolt,
58
56
  default8 as IconButton,
59
- default17 as Input,
60
- default18 as Layout,
61
- default19 as Message,
62
- default27 as MultiSelectCount,
63
- default20 as Notification,
64
- default21 as Popover,
65
- default22 as Progress,
66
- default23 as RadioGroup,
67
- default24 as Row,
68
- default25 as SegmentedControls,
69
- default26 as Select,
70
- default28 as Shapes,
71
- default29 as Switch,
72
- default30 as Table,
73
- default31 as TableWithControls,
74
- default32 as Tabs,
75
- default33 as Tile,
76
- default34 as Toast,
77
- default35 as Tooltip,
78
- default36 as Typography,
57
+ default16 as Input,
58
+ default17 as Layout,
59
+ default18 as Message,
60
+ default26 as MultiSelectCount,
61
+ default19 as Notification,
62
+ default20 as Popover,
63
+ default21 as Progress,
64
+ default22 as RadioGroup,
65
+ default23 as Row,
66
+ default24 as SegmentedControls,
67
+ default25 as Select,
68
+ default27 as Shapes,
69
+ default28 as Switch,
70
+ default29 as Table,
71
+ default30 as TableWithControls,
72
+ default31 as Tabs,
73
+ default32 as Tile,
74
+ default33 as Toast,
75
+ default34 as Tooltip,
76
+ default35 as Typography,
79
77
  TypographySizeKey,
80
78
  default7 as UtilityButton,
81
79
  baseTokens,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobolt/genesis",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "genesis design system",
5
5
  "author": "gobolt",
6
6
  "license": "MIT",
@@ -1,6 +0,0 @@
1
- "use strict";
2
- var jsxRuntime = require("react/jsx-runtime");
3
- const GoBolt = ({ hello = "hello world" }) => {
4
- return /* @__PURE__ */ jsxRuntime.jsx("p", { children: hello });
5
- };
6
- module.exports = GoBolt;
@@ -1,7 +0,0 @@
1
- export interface GoBoltProps {
2
- hello?: string;
3
- }
4
- declare const GoBolt: ({ hello }: {
5
- hello?: string;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default GoBolt;
@@ -1,7 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- const GoBolt = ({ hello = "hello world" }) => {
3
- return /* @__PURE__ */ jsx("p", { children: hello });
4
- };
5
- export {
6
- GoBolt as default
7
- };
@@ -1,2 +0,0 @@
1
- export { default } from './GoBolt';
2
- export type { GoBoltProps } from './GoBolt';