@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
package/dist/cjs/index.js
CHANGED
|
@@ -23084,65 +23084,69 @@ const Tabs = ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, va
|
|
|
23084
23084
|
return (a$m.createElement(TabsBar, { "$variant": variant, "$isPill": isPill, id: id, className: className, ...htmlProps }, tabs.map((tab) => (a$m.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 })))));
|
|
23085
23085
|
};
|
|
23086
23086
|
|
|
23087
|
-
const
|
|
23087
|
+
const SelectorChipWrapper = styled.div `
|
|
23088
|
+
position: relative;
|
|
23088
23089
|
display: inline-flex;
|
|
23089
23090
|
align-items: center;
|
|
23090
|
-
justify-content: center;
|
|
23091
23091
|
gap: 5px;
|
|
23092
23092
|
height: 24px;
|
|
23093
|
-
|
|
23094
|
-
border-radius: 4px;
|
|
23093
|
+
border-radius: 5px;
|
|
23095
23094
|
border: 1px solid var(--grey200);
|
|
23096
23095
|
font-size: 14px;
|
|
23097
23096
|
line-height: 1;
|
|
23098
23097
|
font-weight: 500;
|
|
23099
23098
|
font-family: "inter";
|
|
23100
|
-
cursor: pointer;
|
|
23101
23099
|
transition: 0.15s ease;
|
|
23102
23100
|
background-color: var(--white);
|
|
23103
23101
|
color: var(--charcoal);
|
|
23104
23102
|
|
|
23105
|
-
${({ $selected }) => $selected
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
&:hover {
|
|
23113
|
-
background: var(--grey50);
|
|
23114
|
-
}
|
|
23115
|
-
`}
|
|
23103
|
+
${({ $selected }) => $selected &&
|
|
23104
|
+
styled.css `
|
|
23105
|
+
background-color: ${Styles.color.core.primary};
|
|
23106
|
+
border-color: var(--grey700);
|
|
23107
|
+
color: var(--white);
|
|
23108
|
+
cursor: default;
|
|
23109
|
+
`}
|
|
23116
23110
|
|
|
23117
|
-
|
|
23118
|
-
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23111
|
+
${({ $disabled }) => $disabled &&
|
|
23112
|
+
styled.css `
|
|
23113
|
+
background-color: var(--light-grey);
|
|
23114
|
+
border-color: var(--light-grey);
|
|
23115
|
+
color: var(--smoke);
|
|
23116
|
+
cursor: not-allowed;
|
|
23117
|
+
pointer-events: none;
|
|
23118
|
+
`}
|
|
23119
|
+
`;
|
|
23120
|
+
const SelectorChipComponent = styled.button `
|
|
23121
|
+
all: unset;
|
|
23122
|
+
display: flex;
|
|
23123
|
+
align-items: center;
|
|
23124
|
+
height: 100%;
|
|
23125
|
+
cursor: ${({ $selected }) => ($selected ? "default" : "pointer")};
|
|
23123
23126
|
`;
|
|
23124
|
-
const SelectorChipLabel = styled.
|
|
23127
|
+
const SelectorChipLabel = styled.label `
|
|
23125
23128
|
display: flex;
|
|
23126
23129
|
align-items: center;
|
|
23130
|
+
padding: 2px 8px;
|
|
23131
|
+
cursor: ${({ $selected }) => ($selected ? "default" : "pointer")};
|
|
23127
23132
|
`;
|
|
23128
23133
|
const SelectorChipClose = styled.button `
|
|
23129
23134
|
display: flex;
|
|
23130
23135
|
align-items: center;
|
|
23136
|
+
height: 100%;
|
|
23131
23137
|
justify-content: center;
|
|
23132
|
-
|
|
23138
|
+
padding: 0px 8px 0px 0px;
|
|
23133
23139
|
border: none;
|
|
23134
23140
|
background: transparent;
|
|
23135
|
-
padding: 0;
|
|
23136
|
-
|
|
23137
23141
|
cursor: pointer;
|
|
23138
23142
|
color: inherit;
|
|
23139
23143
|
`;
|
|
23140
23144
|
|
|
23141
23145
|
const SelectorChip = ({ id, className, label, selected = false, disabled = false, onClick, onClose, }) => {
|
|
23142
|
-
return (a$m.createElement(
|
|
23143
|
-
a$m.createElement(
|
|
23146
|
+
return (a$m.createElement(SelectorChipWrapper, { "$selected": selected, "$disabled": disabled, onClick: onClick, id: id },
|
|
23147
|
+
a$m.createElement(SelectorChipComponent, { "$selected": selected, id: id, type: "button" },
|
|
23148
|
+
a$m.createElement(SelectorChipLabel, { "$selected": selected }, label)),
|
|
23144
23149
|
selected && (a$m.createElement(SelectorChipClose, { type: "button", "aria-label": "Remove chip", disabled: disabled, onClick: (e) => {
|
|
23145
|
-
e.stopPropagation();
|
|
23146
23150
|
onClose?.();
|
|
23147
23151
|
} },
|
|
23148
23152
|
a$m.createElement(e, { size: 16 })))));
|
|
@@ -23167,6 +23171,9 @@ const OrderStatusLabel = styled.span `
|
|
|
23167
23171
|
overflow: hidden;
|
|
23168
23172
|
`;
|
|
23169
23173
|
|
|
23174
|
+
// This is used as a dictionary of all of the mapped strings to icons and labels.
|
|
23175
|
+
// It isn't being enforced because of the string type.
|
|
23176
|
+
// Still, any new status mappings need to be added here as it affects the tests and stories.
|
|
23170
23177
|
var OrderStatusVariant;
|
|
23171
23178
|
(function (OrderStatusVariant) {
|
|
23172
23179
|
OrderStatusVariant["COMPLETED"] = "Completed";
|
|
@@ -23202,7 +23209,7 @@ const getOrderStatusLabel = (variant, isPurchaser) => {
|
|
|
23202
23209
|
}
|
|
23203
23210
|
};
|
|
23204
23211
|
|
|
23205
|
-
const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
|
|
23212
|
+
const OrderStatus = ({ variant = "", id, className, isPurchaser, }) => {
|
|
23206
23213
|
const STATUS_ICON_MAP = {
|
|
23207
23214
|
InfoNeeded: "warning",
|
|
23208
23215
|
ViewPricing: "eye",
|
|
@@ -23221,6 +23228,7 @@ const OrderStatus = ({ variant, id, className, isPurchaser, }) => {
|
|
|
23221
23228
|
const label = getOrderStatusLabel(variant, isPurchaser);
|
|
23222
23229
|
return (a$m.createElement(OrderStatusComponent, { id: id, className: className },
|
|
23223
23230
|
iconName && a$m.createElement(OrderStatusIcon, { iconName: iconName, size: 16 }),
|
|
23231
|
+
!iconName && label !== "--" && (a$m.createElement(OrderStatusIcon, { iconName: "warning", size: 16 })),
|
|
23224
23232
|
a$m.createElement(OrderStatusLabel, null, label)));
|
|
23225
23233
|
};
|
|
23226
23234
|
|