@common-origin/design-system 3.2.0 → 3.3.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.
- package/dist/client.js +34 -10
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Icon/Icon.d.mts +1 -1
- package/dist/components/atoms/Icon/Icon.d.ts +1 -1
- package/dist/components/atoms/Icon/Icon.mjs +35 -10
- package/dist/data.js +2460 -7
- package/dist/data.js.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/lib/statusShapes.mjs +1 -1
- package/dist/lib/statusShapes.mjs.map +1 -1
- package/dist/styles/iconSet.json.mjs +2442 -0
- package/dist/styles/iconSet.json.mjs.map +1 -0
- package/dist/types/iconSet.d.mts +6 -0
- package/dist/types/iconSet.d.ts +6 -0
- package/dist/types/iconSet.mjs +12 -0
- package/dist/types/iconSet.mjs.map +1 -0
- package/dist/types/icons.d.mts +58 -6
- package/dist/types/icons.d.ts +58 -6
- package/dist/types/icons.mjs +5 -0
- package/dist/types/icons.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +5 -3
package/dist/client.js
CHANGED
|
@@ -814,7 +814,10 @@ var IconStyled = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
814
814
|
},
|
|
815
815
|
displayName: "Icon__IconStyled",
|
|
816
816
|
componentId: "sc-1105czq-0"
|
|
817
|
-
})(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"
|
|
817
|
+
})(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"
|
|
818
|
+
// How each paint draws, in currentColor. Lines are 2px on the 24px grid, so they scale with the
|
|
819
|
+
// icon (decision 0058).
|
|
820
|
+
])), function (_a) {
|
|
818
821
|
var $size = _a.$size;
|
|
819
822
|
return tokens.semantic.size.icon[$size];
|
|
820
823
|
}, function (_a) {
|
|
@@ -847,6 +850,25 @@ var IconStyled = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
847
850
|
return tokens.semantic.color.icon["default"];
|
|
848
851
|
}
|
|
849
852
|
});
|
|
853
|
+
// How each paint draws, in currentColor. Lines are 2px on the 24px grid, so they scale with the
|
|
854
|
+
// icon (decision 0058).
|
|
855
|
+
var LINE = {
|
|
856
|
+
stroke: 'currentColor',
|
|
857
|
+
strokeWidth: 2,
|
|
858
|
+
strokeLinecap: 'round',
|
|
859
|
+
strokeLinejoin: 'round'
|
|
860
|
+
};
|
|
861
|
+
var PAINT = {
|
|
862
|
+
stroke: __assign({
|
|
863
|
+
fill: 'none'
|
|
864
|
+
}, LINE),
|
|
865
|
+
fill: {
|
|
866
|
+
fill: 'currentColor'
|
|
867
|
+
},
|
|
868
|
+
both: __assign({
|
|
869
|
+
fill: 'currentColor'
|
|
870
|
+
}, LINE)
|
|
871
|
+
};
|
|
850
872
|
var Icon = function Icon(_a) {
|
|
851
873
|
var name = _a.name,
|
|
852
874
|
_b = _a.size,
|
|
@@ -858,10 +880,9 @@ var Icon = function Icon(_a) {
|
|
|
858
880
|
dataTestId = _a["data-testid"];
|
|
859
881
|
// Decorative unless it's given a name. A blank name is no name, so the icon stays hidden
|
|
860
882
|
var label = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) || (title === null || title === void 0 ? void 0 : title.trim()) || undefined;
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
console.warn("Icon \"".concat(name, "\" not found in icons.json"));
|
|
883
|
+
var icon = data.iconSet[name];
|
|
884
|
+
if (!icon) {
|
|
885
|
+
console.warn("Icon \"".concat(name, "\" not found in iconSet"));
|
|
865
886
|
return jsxRuntime.jsx(IconStyled, {
|
|
866
887
|
"$size": size,
|
|
867
888
|
"$iconColor": iconColor,
|
|
@@ -874,9 +895,8 @@ var Icon = function Icon(_a) {
|
|
|
874
895
|
"data-testid": dataTestId,
|
|
875
896
|
children: jsxRuntime.jsxs("svg", __assign({
|
|
876
897
|
viewBox: "0 0 24 24",
|
|
877
|
-
fill: "currentColor",
|
|
878
898
|
xmlns: "http://www.w3.org/2000/svg"
|
|
879
|
-
}, label ? {
|
|
899
|
+
}, PAINT[icon.paint], label ? {
|
|
880
900
|
role: 'img',
|
|
881
901
|
'aria-label': label
|
|
882
902
|
} : {
|
|
@@ -885,8 +905,12 @@ var Icon = function Icon(_a) {
|
|
|
885
905
|
}, {
|
|
886
906
|
children: [(title === null || title === void 0 ? void 0 : title.trim()) && jsxRuntime.jsx("title", {
|
|
887
907
|
children: title
|
|
888
|
-
}),
|
|
889
|
-
|
|
908
|
+
}), icon.elements.map(function (_a, index) {
|
|
909
|
+
var tag = _a[0],
|
|
910
|
+
attributes = _a[1];
|
|
911
|
+
return /*#__PURE__*/React__default.default.createElement(tag, __assign({
|
|
912
|
+
key: index
|
|
913
|
+
}, attributes));
|
|
890
914
|
})]
|
|
891
915
|
}))
|
|
892
916
|
});
|
|
@@ -2272,7 +2296,7 @@ var Stack = function Stack(_a) {
|
|
|
2272
2296
|
var templateObject_1$E;
|
|
2273
2297
|
|
|
2274
2298
|
// Shape indicators for the six coloured statuses (decision 0045): filled silhouettes on the
|
|
2275
|
-
// 24px grid
|
|
2299
|
+
// 24px grid. Each status icon draws its outline along the same path as a 2px line (decision 0058). Internal: they aren't public icons, so a
|
|
2276
2300
|
// bare shape can't be shown without its label. The shape indicator (#264) and the small
|
|
2277
2301
|
// StatusLabel and InlineAlert sizes render them at 12px or more, with a darker edge.
|
|
2278
2302
|
var statusShapes = {
|