@stella-source/stellasource-dsl 3.5.0 → 3.5.2
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 +33 -29
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/SelectorChip/styles.d.ts +4 -2
- package/dist/esm/index.esm.js +33 -29
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/SelectorChip/styles.d.ts +4 -2
- 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, { className: className, "$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 })))));
|