@stella-source/stellasource-dsl 3.4.0 → 3.5.1

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.
@@ -8,7 +8,7 @@ declare const _default: {
8
8
  control: {
9
9
  type: string;
10
10
  };
11
- options: (OrderStatusVariant | null)[];
11
+ options: string[];
12
12
  };
13
13
  };
14
14
  args: {
@@ -1,2 +1,2 @@
1
1
  import { OrderStatusVariant } from "./types";
2
- export declare const getOrderStatusLabel: (variant: OrderStatusVariant | null, isPurchaser?: boolean) => string;
2
+ export declare const getOrderStatusLabel: (variant?: `${OrderStatusVariant}` | string, isPurchaser?: boolean) => string;
@@ -15,6 +15,6 @@ export declare enum OrderStatusVariant {
15
15
  export interface OrderStatusProps {
16
16
  id?: string;
17
17
  className?: string;
18
- variant: OrderStatusVariant | null;
18
+ variant?: `${OrderStatusVariant}` | string;
19
19
  isPurchaser?: boolean;
20
20
  }
@@ -1,7 +1,9 @@
1
1
  interface SelectorChipStyleProps {
2
2
  $selected?: boolean;
3
+ $disabled?: boolean;
3
4
  }
4
- export declare const SelectorChipComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$selected"> & SelectorChipStyleProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "$selected"> & SelectorChipStyleProps, never>>> & string;
5
- export declare const SelectorChipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
5
+ export declare const SelectorChipWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never>>> & string;
6
+ export declare const SelectorChipComponent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never>>> & string;
7
+ export declare const SelectorChipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, keyof SelectorChipStyleProps> & SelectorChipStyleProps, never>>> & string;
6
8
  export declare const SelectorChipClose: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>> & string;
7
9
  export {};
@@ -23064,65 +23064,69 @@ const Tabs = ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, va
23064
23064
  return (a__default.createElement(TabsBar, { "$variant": variant, "$isPill": isPill, id: id, className: className, ...htmlProps }, tabs.map((tab) => (a__default.createElement(Tab, { key: `${id}-${tab.label}`, id: `${id}-${tab.label}`, label: tab.label, active: tab.label === activeTab, variant: variant, onClick: () => handleClick(tab.label), notifications: tab.notifications })))));
23065
23065
  };
23066
23066
 
23067
- const SelectorChipComponent = styled.button `
23067
+ const SelectorChipWrapper = styled.div `
23068
+ position: relative;
23068
23069
  display: inline-flex;
23069
23070
  align-items: center;
23070
- justify-content: center;
23071
23071
  gap: 5px;
23072
23072
  height: 24px;
23073
- padding: 2px 8px;
23074
- border-radius: 4px;
23073
+ border-radius: 5px;
23075
23074
  border: 1px solid var(--grey200);
23076
23075
  font-size: 14px;
23077
23076
  line-height: 1;
23078
23077
  font-weight: 500;
23079
23078
  font-family: "inter";
23080
- cursor: pointer;
23081
23079
  transition: 0.15s ease;
23082
23080
  background-color: var(--white);
23083
23081
  color: var(--charcoal);
23084
23082
 
23085
- ${({ $selected }) => $selected
23086
- ? css `
23087
- background-color: var(--grey700);
23088
- border-color: var(--grey700);
23089
- color: var(--white);
23090
- `
23091
- : css `
23092
- &:hover {
23093
- background: var(--grey50);
23094
- }
23095
- `}
23083
+ ${({ $selected }) => $selected &&
23084
+ css `
23085
+ background-color: ${Styles.color.core.primary};
23086
+ border-color: var(--grey700);
23087
+ color: var(--white);
23088
+ cursor: default;
23089
+ `}
23096
23090
 
23097
- &:disabled {
23098
- background-color: var(--light-grey);
23099
- border-color: var(--light-grey);
23100
- color: var(--smoke);
23101
- cursor: not-allowed;
23102
- }
23091
+ ${({ $disabled }) => $disabled &&
23092
+ css `
23093
+ background-color: var(--light-grey);
23094
+ border-color: var(--light-grey);
23095
+ color: var(--smoke);
23096
+ cursor: not-allowed;
23097
+ pointer-events: none;
23098
+ `}
23099
+ `;
23100
+ const SelectorChipComponent = styled.button `
23101
+ all: unset;
23102
+ display: flex;
23103
+ align-items: center;
23104
+ height: 100%;
23105
+ cursor: ${({ $selected }) => ($selected ? "default" : "pointer")};
23103
23106
  `;
23104
- const SelectorChipLabel = styled.span `
23107
+ const SelectorChipLabel = styled.label `
23105
23108
  display: flex;
23106
23109
  align-items: center;
23110
+ padding: 2px 8px;
23111
+ cursor: ${({ $selected }) => ($selected ? "default" : "pointer")};
23107
23112
  `;
23108
23113
  const SelectorChipClose = styled.button `
23109
23114
  display: flex;
23110
23115
  align-items: center;
23116
+ height: 100%;
23111
23117
  justify-content: center;
23112
-
23118
+ padding: 0px 8px 0px 0px;
23113
23119
  border: none;
23114
23120
  background: transparent;
23115
- padding: 0;
23116
-
23117
23121
  cursor: pointer;
23118
23122
  color: inherit;
23119
23123
  `;
23120
23124
 
23121
23125
  const SelectorChip = ({ id, className, label, selected = false, disabled = false, onClick, onClose, }) => {
23122
- return (a__default.createElement(SelectorChipComponent, { id: id, className: className, "$selected": selected, disabled: disabled, onClick: onClick },
23123
- a__default.createElement(SelectorChipLabel, null, label),
23126
+ return (a__default.createElement(SelectorChipWrapper, { "$selected": selected, "$disabled": disabled, onClick: onClick, id: id },
23127
+ a__default.createElement(SelectorChipComponent, { "$selected": selected, id: id, type: "button" },
23128
+ a__default.createElement(SelectorChipLabel, { "$selected": selected }, label)),
23124
23129
  selected && (a__default.createElement(SelectorChipClose, { type: "button", "aria-label": "Remove chip", disabled: disabled, onClick: (e) => {
23125
- e.stopPropagation();
23126
23130
  onClose?.();
23127
23131
  } },
23128
23132
  a__default.createElement(e, { size: 16 })))));
@@ -23147,6 +23151,9 @@ const OrderStatusLabel = styled.span `
23147
23151
  overflow: hidden;
23148
23152
  `;
23149
23153
 
23154
+ // This is used as a dictionary of all of the mapped strings to icons and labels.
23155
+ // It isn't being enforced because of the string type.
23156
+ // Still, any new status mappings need to be added here as it affects the tests and stories.
23150
23157
  var OrderStatusVariant;
23151
23158
  (function (OrderStatusVariant) {
23152
23159
  OrderStatusVariant["COMPLETED"] = "Completed";
@@ -23182,7 +23189,7 @@ const getOrderStatusLabel = (variant, isPurchaser) => {
23182
23189
  }
23183
23190
  };
23184
23191
 
23185
- const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
23192
+ const OrderStatus = ({ variant = "", id, className, isPurchaser, }) => {
23186
23193
  const STATUS_ICON_MAP = {
23187
23194
  InfoNeeded: "warning",
23188
23195
  ViewPricing: "eye",
@@ -23201,6 +23208,7 @@ const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
23201
23208
  const label = getOrderStatusLabel(variant, isPurchaser);
23202
23209
  return (a__default.createElement(OrderStatusComponent, { id: id, className: className },
23203
23210
  iconName && a__default.createElement(OrderStatusIcon, { iconName: iconName, size: 16 }),
23211
+ !iconName && label !== "--" && (a__default.createElement(OrderStatusIcon, { iconName: "warning", size: 16 })),
23204
23212
  a__default.createElement(OrderStatusLabel, null, label)));
23205
23213
  };
23206
23214