@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.
- package/dist/cjs/index.js +38 -30
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/OrderStatus/OrderStatus.stories.d.ts +1 -1
- package/dist/cjs/types/components/OrderStatus/helpers.d.ts +1 -1
- package/dist/cjs/types/components/OrderStatus/types.d.ts +1 -1
- package/dist/cjs/types/components/SelectorChip/styles.d.ts +4 -2
- package/dist/esm/index.esm.js +38 -30
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/OrderStatus/OrderStatus.stories.d.ts +1 -1
- package/dist/esm/types/components/OrderStatus/helpers.d.ts +1 -1
- package/dist/esm/types/components/OrderStatus/types.d.ts +1 -1
- package/dist/esm/types/components/SelectorChip/styles.d.ts +4 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OrderStatusVariant } from "./types";
|
|
2
|
-
export declare const getOrderStatusLabel: (variant
|
|
2
|
+
export declare const getOrderStatusLabel: (variant?: `${OrderStatusVariant}` | string, isPurchaser?: boolean) => string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
interface SelectorChipStyleProps {
|
|
2
2
|
$selected?: boolean;
|
|
3
|
+
$disabled?: boolean;
|
|
3
4
|
}
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
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 {};
|
package/dist/esm/index.esm.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
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
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
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.
|
|
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(
|
|
23123
|
-
a__default.createElement(
|
|
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
|
|