@iress-oss/ids-components 6.0.0-alpha.20 → 6.0.0-alpha.22
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/{Button-BTkololu.js → Button-BrpmQKsB.js} +10 -11
- package/dist/{Provider-B87u_maF.js → Provider-Dw49edAo.js} +21 -31
- package/dist/components/Alert/Alert.js +36 -36
- package/dist/components/Alert/Alert.styles.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.styles.js +1 -1
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Badge/Badge.styles.js +1 -1
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/CloseButton/CloseButton.js +12 -11
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup.styles.js +1 -1
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +1 -1
- package/dist/components/CheckboxMark/CheckboxMark.js +2 -2
- package/dist/components/CheckboxMark/CheckboxMark.styles.js +1 -1
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/Col/Col.styles.js +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.styles.js +1 -1
- package/dist/components/Divider/Divider.js +2 -2
- package/dist/components/Divider/Divider.styles.js +1 -1
- package/dist/components/Expander/Expander.js +3 -3
- package/dist/components/Expander/Expander.styles.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/Field/Field.styles.js +1 -1
- package/dist/components/Field/FieldGroup/FieldGroup.js +3 -3
- package/dist/components/Field/FieldGroup/FieldGroup.styles.js +1 -1
- package/dist/components/Field/components/FieldFooter.js +12 -11
- package/dist/components/Field/components/FieldHint.js +5 -4
- package/dist/components/Filter/Filter.js +4 -3
- package/dist/components/Filter/Filter.styles.js +1 -1
- package/dist/components/Filter/components/FilterResetButton.js +1 -1
- package/dist/components/Filter/components/FilterResultsDescriptor.js +1 -1
- package/dist/components/Filter/components/FilterSearch.d.ts +1 -1
- package/dist/components/Hide/Hide.js +1 -1
- package/dist/components/Icon/Icon.constants.d.ts +7 -0
- package/dist/components/Icon/Icon.constants.js +10 -0
- package/dist/components/Icon/Icon.d.ts +34 -16
- package/dist/components/Icon/Icon.js +68 -30
- package/dist/components/Icon/Icon.styles.d.ts +23 -0
- package/dist/components/Icon/Icon.styles.js +37 -4
- package/dist/components/Icon/IconProvider.d.ts +100 -0
- package/dist/components/Icon/IconProvider.js +66 -0
- package/dist/components/Icon/components/FontLoader.d.ts +31 -0
- package/dist/components/Icon/components/FontLoader.js +29 -0
- package/dist/components/Icon/helpers/getMaterialSymbolsList.d.ts +12 -0
- package/dist/components/Icon/helpers/getMaterialSymbolsList.js +12 -0
- package/dist/components/Icon/helpers/iconMapping.d.ts +78 -0
- package/dist/components/Icon/helpers/iconMapping.js +75 -0
- package/dist/components/Icon/hooks/useDynamicFontSubsetting.d.ts +45 -0
- package/dist/components/Icon/hooks/useDynamicFontSubsetting.js +78 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Icon/index.js +6 -2
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/Image.styles.js +1 -1
- package/dist/components/Inline/Inline.js +1 -1
- package/dist/components/Inline/Inline.styles.js +1 -1
- package/dist/components/Input/Input.js +3 -3
- package/dist/components/Input/Input.styles.js +13 -2
- package/dist/components/Input/InputBase/InputBase.js +1 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Label/LabelBase/LabelBase.js +1 -1
- package/dist/components/Link/Link.js +40 -41
- package/dist/components/Link/Link.styles.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/Menu.styles.js +1 -1
- package/dist/components/Menu/MenuItem/MenuItem.js +2 -2
- package/dist/components/Menu/MenuText/MenuText.js +2 -2
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/Modal.styles.js +1 -1
- package/dist/components/Panel/Panel.js +1 -1
- package/dist/components/Panel/Panel.styles.js +2 -2
- package/dist/components/Placeholder/Placeholder.d.ts +5 -1
- package/dist/components/Placeholder/Placeholder.js +48 -28
- package/dist/components/Placeholder/Placeholder.styles.js +10 -9
- package/dist/components/Popover/InputPopover/InputPopover.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Popover/components/PopoverContent.js +1 -1
- package/dist/components/Progress/Progress.js +4 -4
- package/dist/components/Progress/Progress.styles.js +1 -1
- package/dist/components/Provider/Provider.d.ts +9 -5
- package/dist/components/Provider/Provider.js +5 -2
- package/dist/components/Provider/index.js +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/Radio.styles.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.styles.js +1 -1
- package/dist/components/Readonly/Readonly.js +2 -2
- package/dist/components/Readonly/Readonly.styles.js +1 -1
- package/dist/components/RichSelect/RichSelect.styles.js +2 -2
- package/dist/components/RichSelect/SelectBody/SelectBody.styles.js +1 -1
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +1 -0
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +1 -1
- package/dist/components/RichSelect/SelectLabel/SelectLabel.styles.d.ts +1 -1
- package/dist/components/RichSelect/SelectLabel/SelectLabel.styles.js +1 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenu.styles.js +1 -1
- package/dist/components/RichSelect/SelectSearch/SelectSearch.styles.js +1 -1
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +11 -10
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.styles.js +1 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.js +3 -2
- package/dist/components/RichSelect/SelectTags/SelectTags.styles.d.ts +1 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.styles.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/Row.styles.js +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.styles.js +1 -1
- package/dist/components/Select/SelectOption/SelectOption.js +1 -1
- package/dist/components/Select/components/SelectControl.js +1 -1
- package/dist/components/Skeleton/Skeleton.styles.js +1 -1
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/SkipLink/SkipLink.styles.js +1 -1
- package/dist/components/Slideout/Slideout.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -1
- package/dist/components/Slideout/components/SlideoutInner.js +3 -3
- package/dist/components/Slideout/hooks/usePushElement.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/Slider.styles.js +1 -1
- package/dist/components/Slider/components/SliderTicks.js +1 -1
- package/dist/components/Spinner/Spinner.js +5 -4
- package/dist/components/Spinner/Spinner.styles.js +2 -2
- package/dist/components/Stack/Stack.js +1 -1
- package/dist/components/Stack/Stack.styles.js +1 -1
- package/dist/components/Styled/Styled.js +1 -1
- package/dist/components/TabSet/Tab/Tab.js +1 -1
- package/dist/components/TabSet/Tab/Tab.styles.js +1 -1
- package/dist/components/TabSet/TabSet.js +1 -1
- package/dist/components/TabSet/TabSet.styles.js +4 -2
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.styles.js +10 -6
- package/dist/components/Table/TableBody/TableBody.js +1 -1
- package/dist/components/Table/components/TableRows.js +1 -1
- package/dist/components/Table/components/TableSortButton.js +24 -15
- package/dist/components/Table/hooks/useTableColumnStyles.js +2 -2
- package/dist/components/Tag/Tag.js +4 -4
- package/dist/components/Tag/Tag.styles.js +1 -1
- package/dist/components/Tag/TagInput/TagInput.styles.js +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.styles.js +2 -2
- package/dist/components/Toaster/Toaster.js +1 -1
- package/dist/components/Toaster/Toaster.styles.js +1 -1
- package/dist/components/Toaster/components/Toast/Toast.js +31 -31
- package/dist/components/Toaster/components/Toast/Toast.styles.d.ts +1 -1
- package/dist/components/Toaster/components/Toast/Toast.styles.js +1 -5
- package/dist/components/Toggle/Toggle.js +2 -2
- package/dist/components/Toggle/Toggle.styles.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/components/ValidationMessage/ValidationMessage.js +1 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/{create-recipe-DjqynAXe.js → create-recipe-DUTadmvy.js} +2 -2
- package/dist/{css-DNdLYQld.js → css-BStWZDQe.js} +1 -1
- package/dist/{cva-DtPMccE9.js → cva-DJVW1KHF.js} +1 -1
- package/dist/{factory-CsinCTPr.js → factory-BrouwSOb.js} +3 -3
- package/dist/helpers/styling/iressCss.js +1 -1
- package/dist/{index-0AvnPY9d.js → index-Bir9MtY7.js} +0 -4
- package/dist/index.d-CZvOUeIl.js +3808 -0
- package/dist/is-valid-prop-DTA0i8bT.js +7 -0
- package/dist/main.js +257 -253
- package/dist/patterns/Form/Form.styles.js +1 -1
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -1
- package/dist/patterns/Form/HookForm/HookForm.js +1 -1
- package/dist/patterns/Loading/Loading.styles.js +1 -1
- package/dist/patterns/Loading/components/ComponentLoading.js +1 -1
- package/dist/patterns/Loading/components/DefaultLoading.js +1 -1
- package/dist/patterns/Loading/components/LongLoading.js +1 -1
- package/dist/patterns/Loading/components/PageLoading.js +1 -1
- package/dist/patterns/Loading/components/StartUpLoading.js +1 -1
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
- package/dist/patterns/Shadow/Shadow.d.ts +0 -4
- package/dist/patterns/Shadow/Shadow.js +414 -458
- package/dist/style.css +1 -1
- package/dist/styled-system/recipes/table.d.ts +1 -1
- package/dist/styled-system/tokens/tokens.d.ts +1 -1
- package/dist/styled-system/types/prop-type.d.ts +1 -0
- package/dist/styled-system/types/style-props.d.ts +1 -0
- package/dist/{sva-B7kca5XO.js → sva-Df1FmoEW.js} +2 -2
- package/dist/types.d.ts +4 -0
- package/package.json +5 -4
- package/dist/is-valid-prop-DweT-eOL.js +0 -7
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { getUniqueItemsByKey as y } from "../helpers/getUniqueItemsByKey.js";
|
|
3
3
|
import { useRef as l, useMemo as x, useEffect as h } from "react";
|
|
4
|
-
import { s as g } from "../../../factory-
|
|
4
|
+
import { s as g } from "../../../factory-BrouwSOb.js";
|
|
5
5
|
import "../../ValidationMessage/ValidationMessage.js";
|
|
6
6
|
import "../../ValidationMessage/ValidationLink/ValidationLink.js";
|
|
7
7
|
import { IressValidationSummary as I } from "../../ValidationMessage/ValidationSummary/ValidationSummary.js";
|
|
8
8
|
import { IressIcon as E } from "../../Icon/Icon.js";
|
|
9
9
|
import "../../Icon/Icon.styles.js";
|
|
10
|
+
import "../../Icon/IconProvider.js";
|
|
10
11
|
import { field as S } from "../Field.styles.js";
|
|
11
|
-
import { c } from "../../../css-
|
|
12
|
+
import { c } from "../../../css-BStWZDQe.js";
|
|
12
13
|
import { c as v } from "../../../cx-DN21T1EH.js";
|
|
13
14
|
import { IressText as F } from "../../Text/Text.js";
|
|
14
15
|
const b = (o) => /* @__PURE__ */ r(E, { name: "exclamation-triangle", ...o, pr: "xs" }), N = ({
|
|
@@ -20,26 +21,26 @@ const b = (o) => /* @__PURE__ */ r(E, { name: "exclamation-triangle", ...o, pr:
|
|
|
20
21
|
supplementary: n,
|
|
21
22
|
...u
|
|
22
23
|
}) => {
|
|
23
|
-
const a = S({ multipleFields: p }),
|
|
24
|
+
const a = S({ multipleFields: p }), e = l(null), m = l(null), t = x(
|
|
24
25
|
() => !!s || i.length > 0,
|
|
25
26
|
[s, i.length]
|
|
26
27
|
);
|
|
27
28
|
return h(() => {
|
|
28
|
-
if (!
|
|
29
|
-
m.current =
|
|
29
|
+
if (!e.current || m.current === t) {
|
|
30
|
+
m.current = t;
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
e.current.classList.remove(
|
|
33
34
|
c({ animationStyle: "field-footer" })
|
|
34
|
-
),
|
|
35
|
-
}, [
|
|
35
|
+
), e.current.offsetHeight, m.current = t, e.current.classList.add(c({ animationStyle: "field-footer" }));
|
|
36
|
+
}, [t]), !n && !t ? null : /* @__PURE__ */ d(
|
|
36
37
|
g.div,
|
|
37
38
|
{
|
|
38
39
|
...u,
|
|
39
40
|
className: v(o, a.footer),
|
|
40
|
-
ref:
|
|
41
|
+
ref: e,
|
|
41
42
|
children: [
|
|
42
|
-
|
|
43
|
+
t && /* @__PURE__ */ r(
|
|
43
44
|
I,
|
|
44
45
|
{
|
|
45
46
|
itemStyle: { textStyle: "typography.body.sm" },
|
|
@@ -50,7 +51,7 @@ const b = (o) => /* @__PURE__ */ r(E, { name: "exclamation-triangle", ...o, pr:
|
|
|
50
51
|
children: s
|
|
51
52
|
}
|
|
52
53
|
),
|
|
53
|
-
!
|
|
54
|
+
!t && /* @__PURE__ */ r(F, { className: a.supplementary, children: n })
|
|
54
55
|
]
|
|
55
56
|
}
|
|
56
57
|
);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as t, Fragment as s, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { IressIcon as l } from "../../Icon/Icon.js";
|
|
3
3
|
import "../../Icon/Icon.styles.js";
|
|
4
|
+
import "../../Icon/IconProvider.js";
|
|
4
5
|
import { IressTooltip as p } from "../../Tooltip/Tooltip.js";
|
|
5
6
|
import "../../Tooltip/Tooltip.styles.js";
|
|
6
7
|
import { propagateTestid as f } from "../../../helpers/utility/propagateTestid.js";
|
|
7
|
-
import { c } from "../../../css-
|
|
8
|
-
import { s as d } from "../../../factory-
|
|
8
|
+
import { c } from "../../../css-BStWZDQe.js";
|
|
9
|
+
import { s as d } from "../../../factory-BrouwSOb.js";
|
|
9
10
|
import { field as g } from "../Field.styles.js";
|
|
10
11
|
const x = ({
|
|
11
12
|
hint: r,
|
|
@@ -32,7 +33,7 @@ const x = ({
|
|
|
32
33
|
}
|
|
33
34
|
)
|
|
34
35
|
] });
|
|
35
|
-
},
|
|
36
|
+
}, w = ({ hint: r }) => /* @__PURE__ */ t(
|
|
36
37
|
p,
|
|
37
38
|
{
|
|
38
39
|
tooltipText: typeof r == "string" ? r : "Additional information",
|
|
@@ -50,5 +51,5 @@ const x = ({
|
|
|
50
51
|
x.displayName = "FieldHint";
|
|
51
52
|
export {
|
|
52
53
|
x as FieldHint,
|
|
53
|
-
|
|
54
|
+
w as FieldHintIcon
|
|
54
55
|
};
|
|
@@ -2,14 +2,14 @@ import { jsx as e, jsxs as m, Fragment as re } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as oe, useRef as se, useMemo as R, useState as I, useImperativeHandle as ie } from "react";
|
|
3
3
|
import { c as ae } from "../../cx-DN21T1EH.js";
|
|
4
4
|
import { filter as ne } from "./Filter.styles.js";
|
|
5
|
-
import { s as le } from "../../factory-
|
|
6
|
-
import { s as pe } from "../../is-valid-prop-
|
|
5
|
+
import { s as le } from "../../factory-BrouwSOb.js";
|
|
6
|
+
import { s as pe } from "../../is-valid-prop-DTA0i8bT.js";
|
|
7
7
|
import { propagateTestid as o } from "../../helpers/utility/propagateTestid.js";
|
|
8
8
|
import { IressPopover as me } from "../Popover/Popover.js";
|
|
9
9
|
import "../Popover/Popover.styles.js";
|
|
10
10
|
import "../Popover/InputPopover/InputPopover.js";
|
|
11
11
|
import "../Popover/hooks/useFloatingPopover.js";
|
|
12
|
-
import { I as ce } from "../../Button-
|
|
12
|
+
import { I as ce } from "../../Button-BrpmQKsB.js";
|
|
13
13
|
import "../Button/CloseButton/CloseButton.js";
|
|
14
14
|
import { useRichSelectState as de } from "../RichSelect/hooks/useRichSelectState.js";
|
|
15
15
|
import "../../Autocomplete-DUsna_OY.js";
|
|
@@ -34,6 +34,7 @@ import { FilterResetButton as be } from "./components/FilterResetButton.js";
|
|
|
34
34
|
import { FilterLabel as Se } from "./components/FilterLabel.js";
|
|
35
35
|
import { IressIcon as w } from "../Icon/Icon.js";
|
|
36
36
|
import "../Icon/Icon.styles.js";
|
|
37
|
+
import "../Icon/IconProvider.js";
|
|
37
38
|
import { GlobalCSSClass as Ce } from "../../enums.js";
|
|
38
39
|
import { FilterResultsDescriptor as Pe } from "./components/FilterResultsDescriptor.js";
|
|
39
40
|
const N = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { I as i } from "../../../Button-
|
|
2
|
+
import { I as i } from "../../../Button-BrpmQKsB.js";
|
|
3
3
|
import "../../Button/CloseButton/CloseButton.js";
|
|
4
4
|
import { filter as p } from "../Filter.styles.js";
|
|
5
5
|
import { usePopoverItem as f } from "../../Popover/hooks/usePopoverItem.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as p } from "react";
|
|
3
3
|
import { composeLabelValueDescriptor as i } from "../../../helpers/label-value/composeLabelValueDescriptor.js";
|
|
4
|
-
import { c as l } from "../../../css-
|
|
4
|
+
import { c as l } from "../../../css-BStWZDQe.js";
|
|
5
5
|
const u = ({
|
|
6
6
|
loading: t,
|
|
7
7
|
noResultsText: o = "No results",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputRef } from '../../Input/InputBase/InputBase';
|
|
2
|
-
export declare const FilterSearch: import('react').ForwardRefExoticComponent<Omit<import('../../Input').InputBaseProps<undefined>, "
|
|
2
|
+
export declare const FilterSearch: import('react').ForwardRefExoticComponent<Omit<import('../../Input').InputBaseProps<undefined>, "value" | "defaultValue" | "onChange"> & {
|
|
3
3
|
alignRight?: boolean;
|
|
4
4
|
append?: import('react').ReactNode;
|
|
5
5
|
defaultValue?: string | number | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { normaliseHideValues as n } from "./helpers/normaliseHideValues.js";
|
|
3
|
-
import { s as p } from "../../factory-
|
|
3
|
+
import { s as p } from "../../factory-BrouwSOb.js";
|
|
4
4
|
import { useBreakpoint as a } from "../../hooks/useBreakpoint.js";
|
|
5
5
|
import "react";
|
|
6
6
|
const d = p("div"), l = ({
|
|
@@ -1,39 +1,57 @@
|
|
|
1
1
|
import { IressStyledProps } from '../../types';
|
|
2
2
|
import { IconName } from '@fortawesome/fontawesome-common-types';
|
|
3
|
-
|
|
3
|
+
import { MaterialSymbol } from 'material-symbols';
|
|
4
|
+
import { IconType } from './IconProvider';
|
|
5
|
+
import { FontAwesomeIconWithMaterialEquivalent } from './helpers/iconMapping';
|
|
6
|
+
export type IressIconProps<P extends IconType = 'material'> = IressStyledProps<'span'> & {
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
8
|
+
* Filled variant for Material Symbols
|
|
9
|
+
* When true, icon uses filled style (fill=1)
|
|
10
|
+
* Useful for active/selected states
|
|
11
|
+
* @default false
|
|
6
12
|
*/
|
|
7
|
-
|
|
13
|
+
filled?: P extends 'material' ? boolean : never;
|
|
8
14
|
/**
|
|
9
|
-
* Adds
|
|
15
|
+
* Adds fixed width class for Font Awesome icons - fa-fw
|
|
16
|
+
* @deprecated Font Awesome specific. Material Symbols inherit text size automatically.
|
|
10
17
|
*/
|
|
11
|
-
|
|
18
|
+
fixedWidth?: P extends 'fontawesome' ? boolean : never;
|
|
12
19
|
/**
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
* - `fab`: Font Awesome Brand
|
|
16
|
-
* @default 'fal'
|
|
20
|
+
* The name of the icon.
|
|
21
|
+
* Note: Font Awesome is deprecated. Please migrate to Material Symbols.
|
|
17
22
|
*/
|
|
18
|
-
|
|
23
|
+
name: P extends 'fontawesome' ? IconName : MaterialSymbol | FontAwesomeIconWithMaterialEquivalent;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* Adds screen reader text if the icon needs to be visible to screen reader users
|
|
21
26
|
*/
|
|
22
|
-
|
|
27
|
+
screenreaderText?: string;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
29
|
+
* Amount of degrees to rotate the icon.
|
|
25
30
|
*/
|
|
26
|
-
|
|
31
|
+
rotate?: 90 | 180 | 270;
|
|
27
32
|
/**
|
|
28
33
|
* Flip the icon horizontally, vertically or both axes.
|
|
29
34
|
*/
|
|
30
35
|
flip?: 'horizontal' | 'vertical' | 'both';
|
|
36
|
+
/**
|
|
37
|
+
* The icon set to be used (Font Awesome only):
|
|
38
|
+
* - `fal`: Font Awesome Light
|
|
39
|
+
* - `fab`: Font Awesome Brand
|
|
40
|
+
* @default 'fal'
|
|
41
|
+
* @deprecated Font Awesome is deprecated. Please migrate to Material Symbols.
|
|
42
|
+
*/
|
|
43
|
+
set?: P extends 'fontawesome' ? 'fal' | 'fab' : never;
|
|
31
44
|
/**
|
|
32
45
|
* Accepts a numeric value for speed for one rotation.
|
|
33
46
|
*/
|
|
34
47
|
spin?: 'half' | 1 | 2 | 3;
|
|
35
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The icon provider to use
|
|
50
|
+
* Note: Font Awesome is deprecated. Please migrate to Material Symbols.
|
|
51
|
+
*/
|
|
52
|
+
type?: P;
|
|
53
|
+
};
|
|
36
54
|
export declare const IressIcon: {
|
|
37
|
-
({ className,
|
|
55
|
+
<P extends IconType = "material">({ className, flip, name, rotate, screenreaderText, spin, type, ...restProps }: IressIconProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
38
56
|
displayName: string;
|
|
39
57
|
};
|
|
@@ -1,43 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { s as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { s as d } from "../../factory-BrouwSOb.js";
|
|
3
|
+
import { s as v } from "../../is-valid-prop-DTA0i8bT.js";
|
|
4
|
+
import { c as L } from "../../css-BStWZDQe.js";
|
|
5
|
+
import { c as p } from "../../cx-DN21T1EH.js";
|
|
4
6
|
import { icon as I } from "./Icon.styles.js";
|
|
5
|
-
import { GlobalCSSClass as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { GlobalCSSClass as u } from "../../enums.js";
|
|
8
|
+
import { useContext as M, useEffect as N } from "react";
|
|
9
|
+
import { IconContext as S } from "./IconProvider.js";
|
|
10
|
+
import { idsLogger as _ } from "../../helpers/utility/idsLogger.js";
|
|
11
|
+
import { FA_TO_MATERIAL_MAP as $ } from "./helpers/iconMapping.js";
|
|
12
|
+
const E = ({
|
|
13
|
+
className: r,
|
|
14
|
+
flip: m,
|
|
15
|
+
name: s,
|
|
16
|
+
rotate: l,
|
|
17
|
+
screenreaderText: a,
|
|
18
|
+
spin: n,
|
|
19
|
+
type: f,
|
|
15
20
|
...t
|
|
16
21
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const i = M(S), e = f ?? i?.type ?? "material";
|
|
23
|
+
f == "fontawesome" && _(
|
|
24
|
+
`[IressIcon] Font Awesome is deprecated and will be removed in a future version. Please migrate to Material Symbols. Icon name: "${s}"`
|
|
25
|
+
);
|
|
26
|
+
let o;
|
|
27
|
+
if (e === "material" && (o = $[s] ?? s), N(() => {
|
|
28
|
+
e === "material" && i && o && i.registerIcon(o);
|
|
29
|
+
}, [e, i, o]), e === "material" && o) {
|
|
30
|
+
const x = i ? i.isIconLoaded(o) : !0, C = I.raw({
|
|
31
|
+
flip: m,
|
|
32
|
+
rotate: l,
|
|
33
|
+
spin: n,
|
|
34
|
+
filled: t.filled,
|
|
35
|
+
type: e,
|
|
36
|
+
loading: !x
|
|
37
|
+
}), [w, A] = v(t);
|
|
38
|
+
return /* @__PURE__ */ c(
|
|
39
|
+
d.span,
|
|
40
|
+
{
|
|
41
|
+
role: "img",
|
|
42
|
+
className: p(
|
|
43
|
+
L(C, w),
|
|
44
|
+
u.Icon,
|
|
45
|
+
"material-symbols-rounded",
|
|
46
|
+
r
|
|
47
|
+
),
|
|
48
|
+
"aria-hidden": !a && "true",
|
|
49
|
+
"aria-label": a,
|
|
50
|
+
...A,
|
|
51
|
+
children: o
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const g = "fa-", y = t.set ?? "fal", b = t.fixedWidth ?? !1, h = I({
|
|
56
|
+
flip: m,
|
|
57
|
+
rotate: l,
|
|
58
|
+
spin: n
|
|
21
59
|
});
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
60
|
+
return /* @__PURE__ */ c(
|
|
61
|
+
d.span,
|
|
24
62
|
{
|
|
25
63
|
role: "img",
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
64
|
+
className: p(
|
|
65
|
+
h,
|
|
66
|
+
u.Icon,
|
|
67
|
+
y,
|
|
68
|
+
`${g}${s}`,
|
|
69
|
+
b && "fa-fw",
|
|
70
|
+
r
|
|
33
71
|
),
|
|
34
|
-
"aria-hidden": !
|
|
35
|
-
"aria-label":
|
|
72
|
+
"aria-hidden": !a && "true",
|
|
73
|
+
"aria-label": a,
|
|
36
74
|
...t
|
|
37
75
|
}
|
|
38
76
|
);
|
|
39
77
|
};
|
|
40
|
-
|
|
78
|
+
E.displayName = "IressIcon";
|
|
41
79
|
export {
|
|
42
|
-
|
|
80
|
+
E as IressIcon
|
|
43
81
|
};
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
export declare const icon: import('../../styled-system/types').RecipeRuntimeFn<{
|
|
2
|
+
type: {
|
|
3
|
+
fontawesome: {};
|
|
4
|
+
material: {
|
|
5
|
+
fontFamily: "Material Symbols Rounded";
|
|
6
|
+
textStyle: "inherit";
|
|
7
|
+
verticalAlign: "middle";
|
|
8
|
+
materialSymbols: "true";
|
|
9
|
+
scale: "[1.5]";
|
|
10
|
+
fontFeatureSettings: "liga";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
filled: {
|
|
14
|
+
true: {
|
|
15
|
+
materialSymbols: "filled";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
2
18
|
flip: {
|
|
3
19
|
horizontal: {
|
|
4
20
|
transform: "scaleX(-1)";
|
|
@@ -10,6 +26,13 @@ export declare const icon: import('../../styled-system/types').RecipeRuntimeFn<{
|
|
|
10
26
|
transform: "scale(-1)";
|
|
11
27
|
};
|
|
12
28
|
};
|
|
29
|
+
loading: {
|
|
30
|
+
true: {
|
|
31
|
+
visibility: "hidden";
|
|
32
|
+
width: "[1em]";
|
|
33
|
+
height: "[1em]";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
13
36
|
rotate: {
|
|
14
37
|
90: {
|
|
15
38
|
transform: "rotate(90deg)";
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as t } from "../../cva-DJVW1KHF.js";
|
|
2
|
+
const i = t({
|
|
3
|
+
base: {},
|
|
3
4
|
variants: {
|
|
5
|
+
type: {
|
|
6
|
+
fontawesome: {},
|
|
7
|
+
material: {
|
|
8
|
+
fontFamily: "Material Symbols Rounded",
|
|
9
|
+
textStyle: "inherit",
|
|
10
|
+
verticalAlign: "middle",
|
|
11
|
+
materialSymbols: "true",
|
|
12
|
+
scale: "[1.5]",
|
|
13
|
+
fontFeatureSettings: "liga"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
filled: {
|
|
17
|
+
true: {
|
|
18
|
+
materialSymbols: "filled"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
4
21
|
flip: {
|
|
5
22
|
horizontal: {
|
|
6
23
|
transform: "scaleX(-1)"
|
|
@@ -12,6 +29,13 @@ const n = a({
|
|
|
12
29
|
transform: "scale(-1)"
|
|
13
30
|
}
|
|
14
31
|
},
|
|
32
|
+
loading: {
|
|
33
|
+
true: {
|
|
34
|
+
visibility: "hidden",
|
|
35
|
+
width: "[1em]",
|
|
36
|
+
height: "[1em]"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
15
39
|
rotate: {
|
|
16
40
|
90: {
|
|
17
41
|
transform: "rotate(90deg)"
|
|
@@ -37,8 +61,17 @@ const n = a({
|
|
|
37
61
|
animationStyle: "icon-spin-3"
|
|
38
62
|
}
|
|
39
63
|
}
|
|
40
|
-
}
|
|
64
|
+
},
|
|
65
|
+
compoundVariants: [
|
|
66
|
+
{
|
|
67
|
+
type: "material",
|
|
68
|
+
filled: !0,
|
|
69
|
+
css: {
|
|
70
|
+
materialSymbols: "filled"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
41
74
|
});
|
|
42
75
|
export {
|
|
43
|
-
|
|
76
|
+
i as icon
|
|
44
77
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { MaterialSymbol } from 'material-symbols';
|
|
3
|
+
import { ShadowContainer } from '../../types';
|
|
4
|
+
import { IressTestProps } from '../../interfaces';
|
|
5
|
+
export type IconType = 'fontawesome' | 'material';
|
|
6
|
+
export interface IconContextValue<P extends IconType = IconType> {
|
|
7
|
+
/**
|
|
8
|
+
* Check if an icon is already loaded (for Material Symbols only)
|
|
9
|
+
* @param name - The name of the Material Symbol icon
|
|
10
|
+
* @returns True if the icon is loaded, false otherwise
|
|
11
|
+
*/
|
|
12
|
+
isIconLoaded: (name: MaterialSymbol) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Register an icon as used (for Material Symbols only)
|
|
15
|
+
* @param name - The name of the Material Symbol icon
|
|
16
|
+
* @returns void
|
|
17
|
+
*/
|
|
18
|
+
registerIcon: (name: MaterialSymbol) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The icon provider type being used
|
|
21
|
+
* @default 'material'
|
|
22
|
+
*/
|
|
23
|
+
type: P;
|
|
24
|
+
}
|
|
25
|
+
export declare const IconContext: import('react').Context<IconContextValue<IconType> | null>;
|
|
26
|
+
export interface IressIconProviderProps<P extends IconType = 'material'> extends PropsWithChildren, IressTestProps {
|
|
27
|
+
/**
|
|
28
|
+
* Optional container to inject the font styles into.
|
|
29
|
+
* Can be a ShadowRoot, HTMLElement, or a ref to either.
|
|
30
|
+
* Note: Font is always injected into document head as well.
|
|
31
|
+
*/
|
|
32
|
+
container?: ShadowContainer;
|
|
33
|
+
/**
|
|
34
|
+
* Disable automatic font subsetting via Google Fonts CDN
|
|
35
|
+
* When false, only icons actually used in the component tree are loaded
|
|
36
|
+
* When true, the full Material Symbols font is loaded
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
noSubsetting?: P extends 'material' ? boolean : never;
|
|
40
|
+
/**
|
|
41
|
+
* The icon provider to use for all child icons
|
|
42
|
+
* @default 'material'
|
|
43
|
+
*/
|
|
44
|
+
type?: P;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* This provider tracks Material Symbols usage across your app and dynamically
|
|
48
|
+
* loads only the icons you use via Google Fonts CDN, dramatically reducing
|
|
49
|
+
* font payload size.
|
|
50
|
+
*
|
|
51
|
+
* Loads Material Symbols Rounded with fixed parameters:
|
|
52
|
+
* - Weight: 300
|
|
53
|
+
* - FILL: 0 (default state) to 1 (active state)
|
|
54
|
+
* - Grade: 24
|
|
55
|
+
* - Optical Size: 24dp
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* import { IconProvider } from '@iress-oss/ids-components';
|
|
60
|
+
*
|
|
61
|
+
* function App() {
|
|
62
|
+
* return (
|
|
63
|
+
* <IconProvider>
|
|
64
|
+
* <YourApp />
|
|
65
|
+
* </IconProvider>
|
|
66
|
+
* );
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* **Bundle Size Optimization:**
|
|
71
|
+
* - Full font: ~1.4MB
|
|
72
|
+
* - 18 icons (typical usage): ~15-20KB (85% savings)
|
|
73
|
+
* - Auto-optimizes based on actual usage
|
|
74
|
+
*
|
|
75
|
+
* **Trade-offs:**
|
|
76
|
+
* - ✅ Automatic optimization (no consumer config needed)
|
|
77
|
+
* - ✅ Works for any number of icons (1 to 1000+)
|
|
78
|
+
* - ✅ Google CDN handles caching
|
|
79
|
+
* - ⚠️ Requires internet connection
|
|
80
|
+
* - ⚠️ Brief icon loading delay
|
|
81
|
+
*
|
|
82
|
+
* **When to Use:**
|
|
83
|
+
* - You want automatic bundle size optimization
|
|
84
|
+
* - Network connectivity is expected
|
|
85
|
+
* - Icon loading delay is acceptable (typically <500ms on fast connections)
|
|
86
|
+
*
|
|
87
|
+
* **When NOT to Use:**
|
|
88
|
+
* - Using more than ~50 icons (consider full font instead)
|
|
89
|
+
* - Offline apps (use full bundled font instead)
|
|
90
|
+
* - SSR with critical icons (icons may flash during hydration)
|
|
91
|
+
* - Need deterministic font versions (Google controls CDN updates)
|
|
92
|
+
*
|
|
93
|
+
* ---
|
|
94
|
+
*
|
|
95
|
+
* It also provides Font Awesome fonts when using that icon set.
|
|
96
|
+
*/
|
|
97
|
+
export declare const IressIconProvider: {
|
|
98
|
+
<P extends IconType = "material">({ children, container, "data-testid": dataTestId, type, noSubsetting, }: IressIconProviderProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
displayName: string;
|
|
100
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as w, useState as y, useCallback as S } from "react";
|
|
3
|
+
import { FontLoader as m } from "./components/FontLoader.js";
|
|
4
|
+
import { useDynamicFontSubsetting as g } from "./hooks/useDynamicFontSubsetting.js";
|
|
5
|
+
import { MATERIAL_SYMBOLS as e } from "./Icon.constants.js";
|
|
6
|
+
const L = w(null), $ = ({
|
|
7
|
+
children: c,
|
|
8
|
+
container: i,
|
|
9
|
+
"data-testid": n,
|
|
10
|
+
type: t = "material",
|
|
11
|
+
noSubsetting: a = !1
|
|
12
|
+
}) => {
|
|
13
|
+
const [d, f] = y(/* @__PURE__ */ new Set()), u = S(
|
|
14
|
+
(o) => {
|
|
15
|
+
a || f((s) => {
|
|
16
|
+
if (!s.has(o)) {
|
|
17
|
+
const r = new Set(s);
|
|
18
|
+
return r.add(o), r;
|
|
19
|
+
}
|
|
20
|
+
return s;
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
[a]
|
|
24
|
+
), { isIconLoaded: I } = g({
|
|
25
|
+
icons: d,
|
|
26
|
+
buildUrl: (o) => {
|
|
27
|
+
let s = a ? "" : `&icon_names=${encodeURIComponent(o.join(","))}`;
|
|
28
|
+
return `https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@${e.opticalSize},${e.weight},0..1,${e.grade}${s}`;
|
|
29
|
+
},
|
|
30
|
+
dataAttribute: "material-icons-subset",
|
|
31
|
+
fontFamily: "Material Symbols Rounded",
|
|
32
|
+
disabled: t !== "material",
|
|
33
|
+
noSubsetting: a
|
|
34
|
+
}), p = {
|
|
35
|
+
type: t,
|
|
36
|
+
registerIcon: u,
|
|
37
|
+
isIconLoaded: (o) => t !== "material" ? !0 : I(o)
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ h(L.Provider, { value: p, children: [
|
|
40
|
+
c,
|
|
41
|
+
t === "material" && i && /* @__PURE__ */ l(
|
|
42
|
+
m,
|
|
43
|
+
{
|
|
44
|
+
url: `https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@${e.opticalSize},${e.weight},0..1,${e.grade}`,
|
|
45
|
+
container: i,
|
|
46
|
+
onlyShadow: !0,
|
|
47
|
+
keyPrefix: "material-symbols-fonts",
|
|
48
|
+
"data-testid": n
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
t === "fontawesome" && /* @__PURE__ */ l(
|
|
52
|
+
m,
|
|
53
|
+
{
|
|
54
|
+
url: "https://cdn.iress.com/icons/5.15.4/css/combined.min.css",
|
|
55
|
+
container: i,
|
|
56
|
+
keyPrefix: "font-awesome-fonts",
|
|
57
|
+
"data-testid": n
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
$.displayName = "IressIconProvider";
|
|
63
|
+
export {
|
|
64
|
+
L as IconContext,
|
|
65
|
+
$ as IressIconProvider
|
|
66
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ShadowContainer } from '../../../types';
|
|
2
|
+
import { IressTestProps } from '../../../interfaces';
|
|
3
|
+
export interface FontLoaderProps extends IressTestProps {
|
|
4
|
+
/**
|
|
5
|
+
* Optional container to inject the font styles into.
|
|
6
|
+
* Can be a ShadowRoot, HTMLElement, or a ref to either.
|
|
7
|
+
* Note: Font is always injected into document head as well.
|
|
8
|
+
*/
|
|
9
|
+
container?: ShadowContainer;
|
|
10
|
+
/**
|
|
11
|
+
* Unique key prefix for the portal keys
|
|
12
|
+
*/
|
|
13
|
+
keyPrefix: string;
|
|
14
|
+
/**
|
|
15
|
+
* Only load into the shadow container, not the head
|
|
16
|
+
* Used when the font is already loaded in the head in a different method (eg. subsetting)
|
|
17
|
+
*/
|
|
18
|
+
onlyShadow?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The URL of the font stylesheet to load
|
|
21
|
+
*/
|
|
22
|
+
url: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Shared component for injecting font stylesheets into document head and optional shadow container.
|
|
26
|
+
* This component uses React's createPortal to ensure the font styles are added where required.
|
|
27
|
+
*
|
|
28
|
+
* Uses <style> tags with @import to support CSS layers, which has lower priority
|
|
29
|
+
* than Panda CSS utilities. This allows Panda CSS styling props to override the default font styles.
|
|
30
|
+
*/
|
|
31
|
+
export declare const FontLoader: ({ container, keyPrefix, onlyShadow, url, }: FontLoaderProps) => import("react/jsx-runtime").JSX.Element | null;
|