@gobolt/genesis 0.5.0 → 0.6.0

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.
@@ -1,7 +1,7 @@
1
1
  import { default as React, MouseEvent } from 'react';
2
2
  import { ButtonProps as AntButtonProperties } from 'antd/es/button';
3
3
  import { STATE } from '../../constants';
4
- type ButtonThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
4
+ type ButtonThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon" | "password";
5
5
  export interface ButtonProps extends Omit<AntButtonProperties, "type" | "size"> {
6
6
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
7
7
  children?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  import { GenesisTheme } from '../../styles/theme/genesis-theme.types';
2
2
  interface StyledIconButtonProperties {
3
3
  theme?: GenesisTheme;
4
- $themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
4
+ $themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon" | "password";
5
5
  $state?: "active" | "hover" | "pressed" | "focus" | "disabled" | "selected";
6
6
  children?: React.ReactNode;
7
7
  $isIconButton?: boolean;
@@ -2,7 +2,7 @@ import { ButtonProps as AntButtonProperties } from 'antd/es/button';
2
2
  import { GenesisTheme } from '../../styles/theme/genesis-theme.types';
3
3
  interface StyledButtonProperties extends Omit<AntButtonProperties, "type" | "size"> {
4
4
  theme?: GenesisTheme;
5
- $themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
5
+ $themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon" | "password";
6
6
  $state?: "active" | "hover" | "pressed" | "focus" | "disabled" | "selected";
7
7
  children?: React.ReactNode;
8
8
  $isIconButton?: boolean;
@@ -8,6 +8,8 @@ export interface InputProps extends BaseInputProps {
8
8
  size?: "normal" | "small" | "large";
9
9
  onChange?: (actionEvent: InputEvent) => void;
10
10
  value?: string;
11
+ rest?: HTMLInputElement;
12
+ isPassword?: boolean;
11
13
  }
12
14
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
13
15
  export default Input;
@@ -0,0 +1,3 @@
1
+ export declare const StyledFormInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('..').InputProps & import('react').RefAttributes<import('rc-input').InputRef>, "ref"> & {
2
+ ref?: ((instance: import('rc-input').InputRef | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<import('rc-input').InputRef> | null | undefined;
3
+ }, never>> & string & Omit<import('react').ForwardRefExoticComponent<import('..').InputProps & import('react').RefAttributes<import('rc-input').InputRef>>, keyof import('react').Component<any, {}, any>>;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { STATE } from '../../constants';
3
3
  import { GenesisTheme } from '../../styles/theme/genesis-theme.types';
4
- type ThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
4
+ type ThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon" | "password";
5
5
  type Variant = "none" | "simple";
6
6
  interface SelectTriggerProperties {
7
7
  type?: ThemeType;
@@ -1,8 +1,12 @@
1
1
  import { Change } from '../Table';
2
2
  import { InfiniteScrollChangeEvent } from '../InfiniteScrollTable/types';
3
3
  import * as React from "react";
4
+ type Item = {
5
+ label: string;
6
+ value: unknown;
7
+ };
4
8
  export type Groups = {
5
- [key: string]: string[];
9
+ [key: string]: string[] | Item[];
6
10
  };
7
11
  export interface SecondaryTableControlsRowProps {
8
12
  groups: Groups | null;
@@ -1,6 +1,12 @@
1
1
  import { PrimaryTableControlsRowProps } from './PrimaryTableControlsRow';
2
2
  import { SecondaryTableControlsRowProps } from './SecondaryTableControlsRow';
3
3
  import { ActionEvent, TableEventPayload } from '../../../types/events';
4
+ export declare const TABLE_CONTROLS_EVENTS: {
5
+ GROUP_ITEM_CLICK: string;
6
+ ORDER_CLICK: string;
7
+ PRIMARY_SORT_CHANGE: string;
8
+ INPUT_CHANGE: string;
9
+ };
4
10
  export type TableControlsData = {
5
11
  primaryTableRowData: PrimaryTableControlsRowProps;
6
12
  secondaryTableRowData?: SecondaryTableControlsRowProps;
@@ -1,2 +1,2 @@
1
- export { default } from './TableControls';
1
+ export { default, TABLE_CONTROLS_EVENTS } from './TableControls';
2
2
  export type { TableControlsProps } from './TableControls';
@@ -5,7 +5,7 @@ interface TypographyStyledProperties {
5
5
  $themeType?: keyof typeof TYPE;
6
6
  variant?: string;
7
7
  state?: keyof typeof STATE;
8
- breakpoint?: string;
8
+ breakpoint?: keyof GenesisTheme["typography"];
9
9
  color?: string;
10
10
  $isFullWidth?: boolean;
11
11
  }
@@ -68,6 +68,7 @@ export type { TableWithControlsProps } from './TableWithControls';
68
68
  export { useTable } from './Table';
69
69
  export { useTableWithControls } from './TableWithControls';
70
70
  export type { UseTableConfig } from './Table';
71
+ export { TABLE_CONTROLS_EVENTS } from './Table/TableControls';
71
72
  export { default as Tabs } from './Tabs';
72
73
  export type { TabsProps } from './Tabs';
73
74
  export { default as Tile } from './Tile';
@@ -5,6 +5,7 @@ export declare const TYPE: {
5
5
  destructive: string;
6
6
  utility: string;
7
7
  icon: string;
8
+ password: string;
8
9
  };
9
10
  export declare const BREAKPOINTS: {
10
11
  wide: string;
@@ -86,6 +87,7 @@ declare const _default: {
86
87
  destructive: string;
87
88
  utility: string;
88
89
  icon: string;
90
+ password: string;
89
91
  };
90
92
  BREAKPOINTS: {
91
93
  wide: string;
package/dist/index.cjs CHANGED
@@ -59296,24 +59296,24 @@ const Avatar$1 = styled(Avatar$2)`
59296
59296
  return getGenesisClass$d(theme, type4, state);
59297
59297
  }}
59298
59298
  `;
59299
- const getBreakpoint = (breakpoint) => {
59300
- {
59301
- return "medium";
59302
- }
59303
- };
59304
59299
  const getVariant$2 = (typography2, variant, breakpoint) => {
59300
+ const typeClass = typography2["medium"];
59305
59301
  return `
59306
- font-size: ${typography2[getBreakpoint()][variant].fontSize}px !important;
59307
- line-height: ${typography2[getBreakpoint()][variant].lineHeight};
59308
- letter-spacing: ${typography2[getBreakpoint()][variant].letterSpacing}px;
59309
- font-weight: ${typography2[getBreakpoint()][variant].fontWeight};
59302
+ font-size: ${typeClass}.fontSize}px !important;
59303
+ line-height: ${typeClass.lineHeight};
59304
+ letter-spacing: ${typeClass.letterSpacing}px;
59305
+ font-weight: ${typeClass.fontWeight};
59310
59306
  `;
59311
59307
  };
59312
59308
  const getColor = (color2, colors2, $themeType) => {
59313
59309
  if (color2) {
59314
59310
  return color2;
59315
59311
  }
59316
- return colors2[$themeType].active.color;
59312
+ const themeColor = colors2[$themeType];
59313
+ if (themeColor?.active?.default) {
59314
+ return themeColor.active.default;
59315
+ }
59316
+ return colors2?.secondary?.active?.default || "#000000";
59317
59317
  };
59318
59318
  const getFontFamily = (variant) => {
59319
59319
  return `
@@ -59324,7 +59324,7 @@ const getGenesisTypographyClass = ({ colors: colors2, typography: typography2 },
59324
59324
  &.ant-typography {
59325
59325
  font-family: ${getFontFamily(variant)};
59326
59326
  color: ${getColor(color2, colors2, $themeType)} !important;
59327
- ${getVariant$2(typography2, variant)}
59327
+ ${getVariant$2(typography2)}
59328
59328
  margin-bottom: 0 !important;
59329
59329
  width: ${$isFullWidth ? "100%" : "auto"};
59330
59330
  line-height: 1;
@@ -59828,7 +59828,8 @@ const TYPE = {
59828
59828
  tertiary: "tertiary",
59829
59829
  destructive: "destructive",
59830
59830
  utility: "utility",
59831
- icon: "icon"
59831
+ icon: "icon",
59832
+ password: "primary"
59832
59833
  };
59833
59834
  const BREAKPOINTS = {
59834
59835
  wide: "wide",
@@ -74098,11 +74099,11 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
74098
74099
  /* @__PURE__ */ jsxRuntime.jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsxRuntime.jsx(MessageText, { children: message2 }) })
74099
74100
  ] });
74100
74101
  };
74101
- const getStateColors = (colors2, type4, state) => {
74102
+ const getStateColors = (colors2, variant, state = "themeState") => {
74102
74103
  const filled = {
74103
74104
  color: colors2.inputs.onsurface.active,
74104
74105
  borderColor: colors2[TYPE.secondary].active.borderColor,
74105
- ringColor: colors2[type4]?.focussed?.ringColor
74106
+ ringColor: colors2[variant]?.focussed?.ringColor
74106
74107
  };
74107
74108
  const success = {
74108
74109
  color: colors2.status.success.default,
@@ -74118,7 +74119,7 @@ const getStateColors = (colors2, type4, state) => {
74118
74119
  color: colors2.inputs.onsurface.active,
74119
74120
  backgroundColor: colors2.inputs.surface.active,
74120
74121
  borderColor: colors2.inputs.surface.border,
74121
- ringColor: type4 && state ? colors2[type4]?.[state]?.ringColor : void 0
74122
+ ringColor: variant && state ? colors2[variant]?.[state]?.ringColor : void 0
74122
74123
  } : null;
74123
74124
  const stateMap = {
74124
74125
  filled,
@@ -74133,8 +74134,8 @@ const getStateColors = (colors2, type4, state) => {
74133
74134
  const css = stateMap[getValidKey(state)];
74134
74135
  return css;
74135
74136
  };
74136
- const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
74137
- const stateColors = getStateColors(colors2, type4, state);
74137
+ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size, variant) => {
74138
+ const stateColors = getStateColors(colors2, variant, state);
74138
74139
  const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
74139
74140
  if (hasAfterAddon2 && !hasBeforeAddon2) {
74140
74141
  return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
@@ -74158,8 +74159,8 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74158
74159
  &.ant-input.ant-input:focus-visible,
74159
74160
  &.ant-input.ant-input-focused {
74160
74161
  outline: none !important;
74161
- border-color: ${colors2[type4].focussed.borderColor} !important;
74162
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
74162
+ border-color: ${colors2[variant].focussed.borderColor} !important;
74163
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor} !important;
74163
74164
  }
74164
74165
 
74165
74166
  &.ant-input-outlined {
@@ -74175,13 +74176,13 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74175
74176
  outline: none;
74176
74177
  color: ${stateColors.color};
74177
74178
  box-shadow: none;
74178
- border-color: ${colors2[type4].focussed.borderColor};
74179
+ border-color: ${colors2[variant].focussed.borderColor};
74179
74180
  }
74180
74181
  }
74181
74182
 
74182
74183
  .ant-input-group:focus-within {
74183
74184
  outline: none;
74184
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74185
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74185
74186
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74186
74187
  transition: box-shadow 0.2s ease-in-out;
74187
74188
 
@@ -74189,7 +74190,7 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74189
74190
  .ant-input:focus-within {
74190
74191
  box-shadow: none;
74191
74192
  border-radius: 0;
74192
- border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
74193
+ border-radius: ${getBorderRadius(hasBeforeAddon || false, hasAfterAddon || false)};
74193
74194
  border-color: #ddd;
74194
74195
  }
74195
74196
  }
@@ -74200,13 +74201,13 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74200
74201
  .ant-input-group .ant-input:focus-within {
74201
74202
  outline: none;
74202
74203
  box-shadow: none;
74203
- border-color: ${colors2[type4].focussed.borderColor};
74204
+ border-color: ${colors2[variant].focussed.borderColor};
74204
74205
  }
74205
74206
 
74206
74207
  /* Single focus ring on group */
74207
74208
  .ant-input-group:focus-within {
74208
74209
  outline: none;
74209
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74210
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74210
74211
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74211
74212
  transition: box-shadow 0.2s ease-in-out;
74212
74213
  }
@@ -74215,18 +74216,18 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74215
74216
  &:not(.ant-input-group):focus-visible {
74216
74217
  outline: none;
74217
74218
  color: ${stateColors.color};
74218
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74219
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74219
74220
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74220
- border-color: ${colors2[type4].focussed.borderColor};
74221
+ border-color: ${colors2[variant].focussed.borderColor};
74221
74222
  transition: box-shadow 0.2s ease-in-out;
74222
74223
  }
74223
74224
 
74224
74225
  &:not(.ant-input-group .ant-input):focus-visible {
74225
74226
  outline: none;
74226
74227
  color: ${stateColors.color};
74227
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74228
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74228
74229
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74229
- border-color: ${colors2[type4].focussed.borderColor};
74230
+ border-color: ${colors2[variant].focussed.borderColor};
74230
74231
  transition: box-shadow 0.2s ease-in-out;
74231
74232
  }
74232
74233
 
@@ -74267,7 +74268,7 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74267
74268
  `;
74268
74269
  };
74269
74270
  const Input$1 = styled(Input$2)`
74270
- ${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
74271
+ ${({ theme, state, type: type4, size = "normal", ...rest }) => {
74271
74272
  const hasBeforeAddon = !!rest.addonBefore;
74272
74273
  const hasAfterAddon = !!rest.addonAfter;
74273
74274
  return getGenesisInputClass(
@@ -74276,7 +74277,8 @@ const Input$1 = styled(Input$2)`
74276
74277
  state,
74277
74278
  hasBeforeAddon,
74278
74279
  hasAfterAddon,
74279
- size
74280
+ size,
74281
+ TYPE.primary
74280
74282
  );
74281
74283
  }}
74282
74284
  `;
@@ -74308,9 +74310,9 @@ const Input2 = React.forwardRef(
74308
74310
  size = "normal",
74309
74311
  onChange,
74310
74312
  value: value2,
74313
+ isPassword,
74311
74314
  ...rest
74312
74315
  }, ref) => {
74313
- const { type: type4, ...validRest } = rest;
74314
74316
  const addonAfter = React.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select$1 ? React.cloneElement(
74315
74317
  rest.addonAfter,
74316
74318
  {
@@ -74333,7 +74335,7 @@ const Input2 = React.forwardRef(
74333
74335
  return /* @__PURE__ */ jsxRuntime.jsx(
74334
74336
  Input$1,
74335
74337
  {
74336
- ...validRest,
74338
+ ...rest,
74337
74339
  ref,
74338
74340
  size,
74339
74341
  state,
@@ -74768,6 +74770,53 @@ const Solid = (properties) => /* @__PURE__ */ jsxRuntime.jsx(
74768
74770
  const UnitNumber = ({ variant }) => {
74769
74771
  return variant === "outline" ? /* @__PURE__ */ jsxRuntime.jsx(Outline, {}) : /* @__PURE__ */ jsxRuntime.jsx(Solid, {});
74770
74772
  };
74773
+ const StyledFormInput = styled(Input2)`
74774
+ /* Ensure the border color matches regular Input using Genesis theme token */
74775
+ &.ant-input,
74776
+ .ant-input-group .ant-input {
74777
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74778
+ }
74779
+
74780
+ /* Input group wrapper styling - most specific selector for addon scenarios */
74781
+ &.ant-input-group-wrapper .ant-input-group {
74782
+ .ant-input {
74783
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74784
+ }
74785
+
74786
+ .ant-input-group-addon {
74787
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74788
+ background-color: #f5f5f5;
74789
+ }
74790
+ }
74791
+
74792
+ /* When input is in a group wrapper */
74793
+ .ant-input-group-wrapper & {
74794
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74795
+ }
74796
+
74797
+ /* Direct targeting of input group elements */
74798
+ .ant-input-group .ant-input {
74799
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74800
+ }
74801
+
74802
+ .ant-input-group-addon {
74803
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74804
+ }
74805
+
74806
+ /* Hover and focus states should maintain the correct colors */
74807
+ &.ant-input:hover,
74808
+ &.ant-input:focus,
74809
+ .ant-input-group .ant-input:hover,
74810
+ .ant-input-group .ant-input:focus,
74811
+ .ant-input-group-wrapper .ant-input-group:hover .ant-input,
74812
+ .ant-input-group-wrapper .ant-input-group:focus-within .ant-input,
74813
+ .ant-input-group-wrapper .ant-input-group:hover .ant-input-group-addon,
74814
+ .ant-input-group-wrapper
74815
+ .ant-input-group:focus-within
74816
+ .ant-input-group-addon {
74817
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74818
+ }
74819
+ `;
74771
74820
  const defaultValidator = (_rule, value2) => {
74772
74821
  console.log(`Validating value: ${value2}, Type: ${typeof value2}`);
74773
74822
  if (!value2 || /^\d+$/.test(value2)) {
@@ -74788,7 +74837,7 @@ const FormInput = React.forwardRef((props, ref) => {
74788
74837
  const { addonBefore, addonAfter, placeholder } = inputProps;
74789
74838
  if (addonBefore && !addonAfter) {
74790
74839
  return /* @__PURE__ */ jsxRuntime.jsx(
74791
- Input2,
74840
+ StyledFormInput,
74792
74841
  {
74793
74842
  ...inputProps,
74794
74843
  ref,
@@ -74802,7 +74851,7 @@ const FormInput = React.forwardRef((props, ref) => {
74802
74851
  }
74803
74852
  if (addonAfter && !addonBefore) {
74804
74853
  return /* @__PURE__ */ jsxRuntime.jsx(
74805
- Input2,
74854
+ StyledFormInput,
74806
74855
  {
74807
74856
  ...inputProps,
74808
74857
  ref,
@@ -74815,7 +74864,7 @@ const FormInput = React.forwardRef((props, ref) => {
74815
74864
  );
74816
74865
  }
74817
74866
  return /* @__PURE__ */ jsxRuntime.jsx(
74818
- Input2,
74867
+ StyledFormInput,
74819
74868
  {
74820
74869
  ...inputProps,
74821
74870
  ref,
@@ -82524,6 +82573,7 @@ const TypographyWideFontSizeBody1 = 16;
82524
82573
  const TypographyMediumFontSizeBody1 = 16;
82525
82574
  const TypographyWideFontSizeHeading3 = Size4;
82526
82575
  const TypographyWideFontSizeSubHeading1 = 20;
82576
+ const TypographyWideFontSizeSubHeading2 = 16;
82527
82577
  const TypographyWideFontSizeSubHeading3 = 14;
82528
82578
  const TypographyWideFontSizeBody2 = 14;
82529
82579
  const TypographyWideFontSizeBody3 = 12;
@@ -82722,9 +82772,9 @@ const wideTypography = {
82722
82772
  letterSpacing: "0"
82723
82773
  },
82724
82774
  subHeading2: {
82725
- fontSize: "24px",
82726
- lineHeight: "32px",
82727
- fontWeight: 400,
82775
+ fontSize: TypographyWideFontSizeSubHeading2,
82776
+ lineHeight: "1.25rem",
82777
+ fontWeight: 600,
82728
82778
  letterSpacing: "0"
82729
82779
  },
82730
82780
  subHeading3: {
@@ -85744,7 +85794,7 @@ const GroupItem = ({
85744
85794
  onGroupItemClick,
85745
85795
  getCustomIcon
85746
85796
  }) => {
85747
- if (items.length === 0) return null;
85797
+ if (!items || items?.length === 0) return null;
85748
85798
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
85749
85799
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip2, { tip: title, isAbsolutePositioned: false, children: /* @__PURE__ */ jsxRuntime.jsx(
85750
85800
  "div",
@@ -85759,18 +85809,21 @@ const GroupItem = ({
85759
85809
  children: getCustomIcon ? getCustomIcon(title) : getIcon$1(title)
85760
85810
  }
85761
85811
  ) }),
85762
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 4 }, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
85763
- Badge$1,
85764
- {
85765
- label: item,
85766
- hasClose: true,
85767
- hasIcon: false,
85768
- state: "generic",
85769
- size: "small",
85770
- onClick: () => onGroupItemClick(title, item)
85771
- },
85772
- item.toString()
85773
- )) })
85812
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 4 }, children: items?.map((item) => {
85813
+ const isObjectItem = typeof item === "object" && item !== null && "label" in item && "value" in item;
85814
+ return /* @__PURE__ */ jsxRuntime.jsx(
85815
+ Badge$1,
85816
+ {
85817
+ label: isObjectItem ? item.label : item?.toString() || "Undefined",
85818
+ hasClose: true,
85819
+ hasIcon: false,
85820
+ state: "generic",
85821
+ size: "small",
85822
+ onClick: () => onGroupItemClick(title, item)
85823
+ },
85824
+ !item ? "Undefined" : item?.toString()
85825
+ );
85826
+ }) })
85774
85827
  ] });
85775
85828
  };
85776
85829
  const GroupsRow = ({
@@ -85787,7 +85840,7 @@ const GroupsRow = ({
85787
85840
  GroupItem,
85788
85841
  {
85789
85842
  title: group.title,
85790
- items: group.items,
85843
+ items: group?.items,
85791
85844
  onGroupItemClick,
85792
85845
  getCustomIcon
85793
85846
  },
@@ -85888,6 +85941,12 @@ const SecondaryTableControlsRow = ({
85888
85941
  }
85889
85942
  );
85890
85943
  };
85944
+ const TABLE_CONTROLS_EVENTS = {
85945
+ GROUP_ITEM_CLICK: "groupItemClick",
85946
+ ORDER_CLICK: "orderClick",
85947
+ PRIMARY_SORT_CHANGE: "primarySortChange",
85948
+ INPUT_CHANGE: "inputChange"
85949
+ };
85891
85950
  const TableControls = ({
85892
85951
  primaryTableRowData,
85893
85952
  secondaryTableRowData,
@@ -87387,6 +87446,7 @@ exports.SegmentedControls = SegmentedControls;
87387
87446
  exports.Select = Select;
87388
87447
  exports.Shapes = Shapes;
87389
87448
  exports.Switch = Switch;
87449
+ exports.TABLE_CONTROLS_EVENTS = TABLE_CONTROLS_EVENTS;
87390
87450
  exports.Table = TablePagination;
87391
87451
  exports.TableWithControls = TableWithControls;
87392
87452
  exports.Tabs = Tabs;
package/dist/index.js CHANGED
@@ -59278,24 +59278,24 @@ const Avatar$1 = styled(Avatar$2)`
59278
59278
  return getGenesisClass$d(theme, type4, state);
59279
59279
  }}
59280
59280
  `;
59281
- const getBreakpoint = (breakpoint) => {
59282
- {
59283
- return "medium";
59284
- }
59285
- };
59286
59281
  const getVariant$2 = (typography2, variant, breakpoint) => {
59282
+ const typeClass = typography2["medium"];
59287
59283
  return `
59288
- font-size: ${typography2[getBreakpoint()][variant].fontSize}px !important;
59289
- line-height: ${typography2[getBreakpoint()][variant].lineHeight};
59290
- letter-spacing: ${typography2[getBreakpoint()][variant].letterSpacing}px;
59291
- font-weight: ${typography2[getBreakpoint()][variant].fontWeight};
59284
+ font-size: ${typeClass}.fontSize}px !important;
59285
+ line-height: ${typeClass.lineHeight};
59286
+ letter-spacing: ${typeClass.letterSpacing}px;
59287
+ font-weight: ${typeClass.fontWeight};
59292
59288
  `;
59293
59289
  };
59294
59290
  const getColor = (color2, colors2, $themeType) => {
59295
59291
  if (color2) {
59296
59292
  return color2;
59297
59293
  }
59298
- return colors2[$themeType].active.color;
59294
+ const themeColor = colors2[$themeType];
59295
+ if (themeColor?.active?.default) {
59296
+ return themeColor.active.default;
59297
+ }
59298
+ return colors2?.secondary?.active?.default || "#000000";
59299
59299
  };
59300
59300
  const getFontFamily = (variant) => {
59301
59301
  return `
@@ -59306,7 +59306,7 @@ const getGenesisTypographyClass = ({ colors: colors2, typography: typography2 },
59306
59306
  &.ant-typography {
59307
59307
  font-family: ${getFontFamily(variant)};
59308
59308
  color: ${getColor(color2, colors2, $themeType)} !important;
59309
- ${getVariant$2(typography2, variant)}
59309
+ ${getVariant$2(typography2)}
59310
59310
  margin-bottom: 0 !important;
59311
59311
  width: ${$isFullWidth ? "100%" : "auto"};
59312
59312
  line-height: 1;
@@ -59810,7 +59810,8 @@ const TYPE = {
59810
59810
  tertiary: "tertiary",
59811
59811
  destructive: "destructive",
59812
59812
  utility: "utility",
59813
- icon: "icon"
59813
+ icon: "icon",
59814
+ password: "primary"
59814
59815
  };
59815
59816
  const BREAKPOINTS = {
59816
59817
  wide: "wide",
@@ -74080,11 +74081,11 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
74080
74081
  /* @__PURE__ */ jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsx(MessageText, { children: message2 }) })
74081
74082
  ] });
74082
74083
  };
74083
- const getStateColors = (colors2, type4, state) => {
74084
+ const getStateColors = (colors2, variant, state = "themeState") => {
74084
74085
  const filled = {
74085
74086
  color: colors2.inputs.onsurface.active,
74086
74087
  borderColor: colors2[TYPE.secondary].active.borderColor,
74087
- ringColor: colors2[type4]?.focussed?.ringColor
74088
+ ringColor: colors2[variant]?.focussed?.ringColor
74088
74089
  };
74089
74090
  const success = {
74090
74091
  color: colors2.status.success.default,
@@ -74100,7 +74101,7 @@ const getStateColors = (colors2, type4, state) => {
74100
74101
  color: colors2.inputs.onsurface.active,
74101
74102
  backgroundColor: colors2.inputs.surface.active,
74102
74103
  borderColor: colors2.inputs.surface.border,
74103
- ringColor: type4 && state ? colors2[type4]?.[state]?.ringColor : void 0
74104
+ ringColor: variant && state ? colors2[variant]?.[state]?.ringColor : void 0
74104
74105
  } : null;
74105
74106
  const stateMap = {
74106
74107
  filled,
@@ -74115,8 +74116,8 @@ const getStateColors = (colors2, type4, state) => {
74115
74116
  const css = stateMap[getValidKey(state)];
74116
74117
  return css;
74117
74118
  };
74118
- const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
74119
- const stateColors = getStateColors(colors2, type4, state);
74119
+ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size, variant) => {
74120
+ const stateColors = getStateColors(colors2, variant, state);
74120
74121
  const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
74121
74122
  if (hasAfterAddon2 && !hasBeforeAddon2) {
74122
74123
  return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
@@ -74140,8 +74141,8 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74140
74141
  &.ant-input.ant-input:focus-visible,
74141
74142
  &.ant-input.ant-input-focused {
74142
74143
  outline: none !important;
74143
- border-color: ${colors2[type4].focussed.borderColor} !important;
74144
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
74144
+ border-color: ${colors2[variant].focussed.borderColor} !important;
74145
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor} !important;
74145
74146
  }
74146
74147
 
74147
74148
  &.ant-input-outlined {
@@ -74157,13 +74158,13 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74157
74158
  outline: none;
74158
74159
  color: ${stateColors.color};
74159
74160
  box-shadow: none;
74160
- border-color: ${colors2[type4].focussed.borderColor};
74161
+ border-color: ${colors2[variant].focussed.borderColor};
74161
74162
  }
74162
74163
  }
74163
74164
 
74164
74165
  .ant-input-group:focus-within {
74165
74166
  outline: none;
74166
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74167
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74167
74168
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74168
74169
  transition: box-shadow 0.2s ease-in-out;
74169
74170
 
@@ -74171,7 +74172,7 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74171
74172
  .ant-input:focus-within {
74172
74173
  box-shadow: none;
74173
74174
  border-radius: 0;
74174
- border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
74175
+ border-radius: ${getBorderRadius(hasBeforeAddon || false, hasAfterAddon || false)};
74175
74176
  border-color: #ddd;
74176
74177
  }
74177
74178
  }
@@ -74182,13 +74183,13 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74182
74183
  .ant-input-group .ant-input:focus-within {
74183
74184
  outline: none;
74184
74185
  box-shadow: none;
74185
- border-color: ${colors2[type4].focussed.borderColor};
74186
+ border-color: ${colors2[variant].focussed.borderColor};
74186
74187
  }
74187
74188
 
74188
74189
  /* Single focus ring on group */
74189
74190
  .ant-input-group:focus-within {
74190
74191
  outline: none;
74191
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74192
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74192
74193
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74193
74194
  transition: box-shadow 0.2s ease-in-out;
74194
74195
  }
@@ -74197,18 +74198,18 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74197
74198
  &:not(.ant-input-group):focus-visible {
74198
74199
  outline: none;
74199
74200
  color: ${stateColors.color};
74200
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74201
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74201
74202
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74202
- border-color: ${colors2[type4].focussed.borderColor};
74203
+ border-color: ${colors2[variant].focussed.borderColor};
74203
74204
  transition: box-shadow 0.2s ease-in-out;
74204
74205
  }
74205
74206
 
74206
74207
  &:not(.ant-input-group .ant-input):focus-visible {
74207
74208
  outline: none;
74208
74209
  color: ${stateColors.color};
74209
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
74210
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[variant].focussed.ringColor};
74210
74211
  border-radius: ${borderRadius2.BorderRadiusMd}px;
74211
- border-color: ${colors2[type4].focussed.borderColor};
74212
+ border-color: ${colors2[variant].focussed.borderColor};
74212
74213
  transition: box-shadow 0.2s ease-in-out;
74213
74214
  }
74214
74215
 
@@ -74249,7 +74250,7 @@ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, co
74249
74250
  `;
74250
74251
  };
74251
74252
  const Input$1 = styled(Input$2)`
74252
- ${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
74253
+ ${({ theme, state, type: type4, size = "normal", ...rest }) => {
74253
74254
  const hasBeforeAddon = !!rest.addonBefore;
74254
74255
  const hasAfterAddon = !!rest.addonAfter;
74255
74256
  return getGenesisInputClass(
@@ -74258,7 +74259,8 @@ const Input$1 = styled(Input$2)`
74258
74259
  state,
74259
74260
  hasBeforeAddon,
74260
74261
  hasAfterAddon,
74261
- size
74262
+ size,
74263
+ TYPE.primary
74262
74264
  );
74263
74265
  }}
74264
74266
  `;
@@ -74290,9 +74292,9 @@ const Input2 = React__default.forwardRef(
74290
74292
  size = "normal",
74291
74293
  onChange,
74292
74294
  value: value2,
74295
+ isPassword,
74293
74296
  ...rest
74294
74297
  }, ref) => {
74295
- const { type: type4, ...validRest } = rest;
74296
74298
  const addonAfter = React__default.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select$1 ? React__default.cloneElement(
74297
74299
  rest.addonAfter,
74298
74300
  {
@@ -74315,7 +74317,7 @@ const Input2 = React__default.forwardRef(
74315
74317
  return /* @__PURE__ */ jsx(
74316
74318
  Input$1,
74317
74319
  {
74318
- ...validRest,
74320
+ ...rest,
74319
74321
  ref,
74320
74322
  size,
74321
74323
  state,
@@ -74750,6 +74752,53 @@ const Solid = (properties) => /* @__PURE__ */ jsx(
74750
74752
  const UnitNumber = ({ variant }) => {
74751
74753
  return variant === "outline" ? /* @__PURE__ */ jsx(Outline, {}) : /* @__PURE__ */ jsx(Solid, {});
74752
74754
  };
74755
+ const StyledFormInput = styled(Input2)`
74756
+ /* Ensure the border color matches regular Input using Genesis theme token */
74757
+ &.ant-input,
74758
+ .ant-input-group .ant-input {
74759
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74760
+ }
74761
+
74762
+ /* Input group wrapper styling - most specific selector for addon scenarios */
74763
+ &.ant-input-group-wrapper .ant-input-group {
74764
+ .ant-input {
74765
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74766
+ }
74767
+
74768
+ .ant-input-group-addon {
74769
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74770
+ background-color: #f5f5f5;
74771
+ }
74772
+ }
74773
+
74774
+ /* When input is in a group wrapper */
74775
+ .ant-input-group-wrapper & {
74776
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74777
+ }
74778
+
74779
+ /* Direct targeting of input group elements */
74780
+ .ant-input-group .ant-input {
74781
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74782
+ }
74783
+
74784
+ .ant-input-group-addon {
74785
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74786
+ }
74787
+
74788
+ /* Hover and focus states should maintain the correct colors */
74789
+ &.ant-input:hover,
74790
+ &.ant-input:focus,
74791
+ .ant-input-group .ant-input:hover,
74792
+ .ant-input-group .ant-input:focus,
74793
+ .ant-input-group-wrapper .ant-input-group:hover .ant-input,
74794
+ .ant-input-group-wrapper .ant-input-group:focus-within .ant-input,
74795
+ .ant-input-group-wrapper .ant-input-group:hover .ant-input-group-addon,
74796
+ .ant-input-group-wrapper
74797
+ .ant-input-group:focus-within
74798
+ .ant-input-group-addon {
74799
+ border-color: ${({ theme }) => theme.colors.inputs.surface.border} !important;
74800
+ }
74801
+ `;
74753
74802
  const defaultValidator = (_rule, value2) => {
74754
74803
  console.log(`Validating value: ${value2}, Type: ${typeof value2}`);
74755
74804
  if (!value2 || /^\d+$/.test(value2)) {
@@ -74770,7 +74819,7 @@ const FormInput = React__default.forwardRef((props, ref) => {
74770
74819
  const { addonBefore, addonAfter, placeholder } = inputProps;
74771
74820
  if (addonBefore && !addonAfter) {
74772
74821
  return /* @__PURE__ */ jsx(
74773
- Input2,
74822
+ StyledFormInput,
74774
74823
  {
74775
74824
  ...inputProps,
74776
74825
  ref,
@@ -74784,7 +74833,7 @@ const FormInput = React__default.forwardRef((props, ref) => {
74784
74833
  }
74785
74834
  if (addonAfter && !addonBefore) {
74786
74835
  return /* @__PURE__ */ jsx(
74787
- Input2,
74836
+ StyledFormInput,
74788
74837
  {
74789
74838
  ...inputProps,
74790
74839
  ref,
@@ -74797,7 +74846,7 @@ const FormInput = React__default.forwardRef((props, ref) => {
74797
74846
  );
74798
74847
  }
74799
74848
  return /* @__PURE__ */ jsx(
74800
- Input2,
74849
+ StyledFormInput,
74801
74850
  {
74802
74851
  ...inputProps,
74803
74852
  ref,
@@ -82506,6 +82555,7 @@ const TypographyWideFontSizeBody1 = 16;
82506
82555
  const TypographyMediumFontSizeBody1 = 16;
82507
82556
  const TypographyWideFontSizeHeading3 = Size4;
82508
82557
  const TypographyWideFontSizeSubHeading1 = 20;
82558
+ const TypographyWideFontSizeSubHeading2 = 16;
82509
82559
  const TypographyWideFontSizeSubHeading3 = 14;
82510
82560
  const TypographyWideFontSizeBody2 = 14;
82511
82561
  const TypographyWideFontSizeBody3 = 12;
@@ -82704,9 +82754,9 @@ const wideTypography = {
82704
82754
  letterSpacing: "0"
82705
82755
  },
82706
82756
  subHeading2: {
82707
- fontSize: "24px",
82708
- lineHeight: "32px",
82709
- fontWeight: 400,
82757
+ fontSize: TypographyWideFontSizeSubHeading2,
82758
+ lineHeight: "1.25rem",
82759
+ fontWeight: 600,
82710
82760
  letterSpacing: "0"
82711
82761
  },
82712
82762
  subHeading3: {
@@ -85726,7 +85776,7 @@ const GroupItem = ({
85726
85776
  onGroupItemClick,
85727
85777
  getCustomIcon
85728
85778
  }) => {
85729
- if (items.length === 0) return null;
85779
+ if (!items || items?.length === 0) return null;
85730
85780
  return /* @__PURE__ */ jsxs(Fragment, { children: [
85731
85781
  /* @__PURE__ */ jsx(Tooltip2, { tip: title, isAbsolutePositioned: false, children: /* @__PURE__ */ jsx(
85732
85782
  "div",
@@ -85741,18 +85791,21 @@ const GroupItem = ({
85741
85791
  children: getCustomIcon ? getCustomIcon(title) : getIcon$1(title)
85742
85792
  }
85743
85793
  ) }),
85744
- /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4 }, children: items.map((item) => /* @__PURE__ */ jsx(
85745
- Badge$1,
85746
- {
85747
- label: item,
85748
- hasClose: true,
85749
- hasIcon: false,
85750
- state: "generic",
85751
- size: "small",
85752
- onClick: () => onGroupItemClick(title, item)
85753
- },
85754
- item.toString()
85755
- )) })
85794
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4 }, children: items?.map((item) => {
85795
+ const isObjectItem = typeof item === "object" && item !== null && "label" in item && "value" in item;
85796
+ return /* @__PURE__ */ jsx(
85797
+ Badge$1,
85798
+ {
85799
+ label: isObjectItem ? item.label : item?.toString() || "Undefined",
85800
+ hasClose: true,
85801
+ hasIcon: false,
85802
+ state: "generic",
85803
+ size: "small",
85804
+ onClick: () => onGroupItemClick(title, item)
85805
+ },
85806
+ !item ? "Undefined" : item?.toString()
85807
+ );
85808
+ }) })
85756
85809
  ] });
85757
85810
  };
85758
85811
  const GroupsRow = ({
@@ -85769,7 +85822,7 @@ const GroupsRow = ({
85769
85822
  GroupItem,
85770
85823
  {
85771
85824
  title: group.title,
85772
- items: group.items,
85825
+ items: group?.items,
85773
85826
  onGroupItemClick,
85774
85827
  getCustomIcon
85775
85828
  },
@@ -85870,6 +85923,12 @@ const SecondaryTableControlsRow = ({
85870
85923
  }
85871
85924
  );
85872
85925
  };
85926
+ const TABLE_CONTROLS_EVENTS = {
85927
+ GROUP_ITEM_CLICK: "groupItemClick",
85928
+ ORDER_CLICK: "orderClick",
85929
+ PRIMARY_SORT_CHANGE: "primarySortChange",
85930
+ INPUT_CHANGE: "inputChange"
85931
+ };
85873
85932
  const TableControls = ({
85874
85933
  primaryTableRowData,
85875
85934
  secondaryTableRowData,
@@ -87370,6 +87429,7 @@ export {
87370
87429
  Select,
87371
87430
  Shapes,
87372
87431
  Switch,
87432
+ TABLE_CONTROLS_EVENTS,
87373
87433
  TablePagination as Table,
87374
87434
  TableWithControls,
87375
87435
  Tabs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobolt/genesis",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "genesis design system",
5
5
  "author": "gobolt",
6
6
  "license": "MIT",
@@ -150,7 +150,7 @@
150
150
  },
151
151
  "dependencies": {
152
152
  "@ant-design/icons": "^5.5.2",
153
- "@gobolt/genesis-tokens": "^0.0.10",
153
+ "@gobolt/genesis-tokens": "^0.0.9",
154
154
  "@mdx-js/react": "^3.0.1",
155
155
  "@secondcloset/types": "^3.4.6",
156
156
  "@types/d3": "^7.4.3",