@iress-oss/ids-components 6.0.0-beta.4 → 6.0.0-beta.5
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/.ai/components/popover.md +23 -0
- package/.ai/components/provider.md +2 -1
- package/.ai/skills/ui-doctor.md +1 -1
- package/.ai/skills/ui-translation.md +1 -1
- package/dist/Provider-DvnuqPfQ.js +58 -0
- package/dist/{Shadow-DdGxqWgh.js → Shadow-C-AJ5pf_.js} +23 -22
- package/dist/components/Field/FieldGroup/FieldGroup.d.ts +1 -1
- package/dist/components/Field/FieldGroup/FieldGroup.js +12 -11
- package/dist/components/Field/FieldGroup/FieldGroup.styles.d.ts +12 -0
- package/dist/components/Field/FieldGroup/FieldGroup.styles.js +7 -3
- package/dist/components/Icon/helpers/getMaterialSymbolsList.js +1 -1
- package/dist/components/Popover/PopoverProvider.d.ts +15 -0
- package/dist/components/Popover/PopoverProvider.js +14 -0
- package/dist/components/Popover/components/PopoverContent.js +25 -24
- package/dist/components/Popover/hooks/usePopoverContainer.d.ts +17 -0
- package/dist/components/Popover/hooks/usePopoverContainer.js +5 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/index.js +7 -5
- package/dist/components/Provider/Provider.d.ts +16 -2
- package/dist/components/Provider/Provider.js +1 -1
- package/dist/components/Provider/index.js +1 -1
- package/dist/index.d-pXVOif1T.js +4 -0
- package/dist/main.js +132 -130
- package/dist/patterns/Shadow/Shadow.d.ts +1 -1
- package/dist/patterns/Shadow/Shadow.js +1 -1
- package/dist/patterns/Shadow/index.js +1 -1
- package/package.json +11 -11
- package/dist/Provider-CQ9D7IoC.js +0 -54
- package/dist/index.d-BJM5_ZcV.js +0 -4
|
@@ -173,6 +173,29 @@ This will be the case when you are rendering into its parent container, which is
|
|
|
173
173
|
|
|
174
174
|
[View "ParentContainer" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-popover--parent-container)
|
|
175
175
|
|
|
176
|
+
### Using the `IressPopoverProvider`
|
|
177
|
+
|
|
178
|
+
You can use the `IressPopoverProvider` to set a shared container for
|
|
179
|
+
all nested popovers. This is useful when you want all popovers in a
|
|
180
|
+
section of your application to render into the same DOM node, similar
|
|
181
|
+
to how `IressModalProvider` and `IressSlideoutProvider` work.
|
|
182
|
+
|
|
183
|
+
Individual popovers can still override the provider's container by
|
|
184
|
+
setting their own `container` prop.
|
|
185
|
+
|
|
186
|
+
> **Note:** If you are already using `IressProvider` or `IressShadow`,
|
|
187
|
+
> you do not need to add `IressPopoverProvider` separately — it is
|
|
188
|
+
> already included. To set a shared container for popovers through
|
|
189
|
+
> `IressProvider`, use the `popoverContainer` prop. You can also set
|
|
190
|
+
> `popoverContainer="container"` to reuse the same container that
|
|
191
|
+
> modals, slideouts and toasts render into.
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<AppWithPopoverProvider />
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
[View "Provider" example in Storybook →](https://main--691abcc79dfa560a36d0a74f.chromatic.com/?path=/story/components_components-provider--provider)
|
|
198
|
+
|
|
176
199
|
## `IressInputPopover`
|
|
177
200
|
|
|
178
201
|
If you need a popover that is triggered by input changes, you can use the `IressInputPopover` component. This component has an additional `minLength` prop that allows you to specify the minimum number of characters required before the popover is shown.
|
|
@@ -19,10 +19,11 @@ The design system provider automates some set-up tasks for you, including:
|
|
|
19
19
|
|
|
20
20
|
- Adding the icon fonts and CSS variables to the document head
|
|
21
21
|
- Consistent container handling for providers, if you need the modals, slideouts and toasts rendered in a specific area (common with micro frontends)
|
|
22
|
+
- Optional separate container for popovers via the `popoverContainer` prop
|
|
22
23
|
|
|
23
24
|
In most cases, you should wrap the entire application with the `IressProvider` component. This will ensure that the design system is set up correctly and consistently across the application.
|
|
24
25
|
|
|
25
|
-
> **Note:** `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, and `IressIconProvider`. You do not need to add these providers separately when using `IressProvider`. Similarly, `IressShadow` includes `IressProvider` internally, so you do not need any additional providers when using `IressShadow`.
|
|
26
|
+
> **Note:** `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, `IressPopoverProvider`, and `IressIconProvider`. You do not need to add these providers separately when using `IressProvider`. Similarly, `IressShadow` includes `IressProvider` internally, so you do not need any additional providers when using `IressShadow`.
|
|
26
27
|
|
|
27
28
|
```tsx
|
|
28
29
|
import { IressProvider } from '@iress-oss/ids-components';
|
package/.ai/skills/ui-doctor.md
CHANGED
|
@@ -1812,7 +1812,7 @@ Not every raw HTML element is a violation. The following are **acceptable except
|
|
|
1812
1812
|
|
|
1813
1813
|
#### a. Provider & CSS Setup
|
|
1814
1814
|
|
|
1815
|
-
- **IressProvider must wrap the application root** — Required for fonts, CSS variables, and theming. `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, and `IressIconProvider` — these should not be added separately. Similarly, `IressShadow` includes `IressProvider` internally, so no additional providers are needed when using `IressShadow`.
|
|
1815
|
+
- **IressProvider must wrap the application root** — Required for fonts, CSS variables, and theming. `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, `IressPopoverProvider`, and `IressIconProvider` — these should not be added separately. Similarly, `IressShadow` includes `IressProvider` internally, so no additional providers are needed when using `IressShadow`.
|
|
1816
1816
|
- **The IDS component CSS must be imported** — `@iress-oss/ids-components/dist/style.css` contains all component styles
|
|
1817
1817
|
- Users only need to install `@iress-oss/ids-components@beta` — the tokens are bundled within the component library and do not need to be installed separately. **IDS v6 is currently in beta**, so the `@beta` tag is required (e.g. `npm install @iress-oss/ids-components@beta`)
|
|
1818
1818
|
- **CSP must allowlist IDS external origins** — If the app enforces a Content Security Policy, `fonts.googleapis.com` and `fonts.gstatic.com` must be in `style-src`/`font-src`. Add `cdn.iress.com` if using legacy Font Awesome icons or `IressTheme`. If using `IressShadow` and inline styles are blocked, add `<meta name="csp-nonce" content="...">` in `<head>`. See the CSP Guide at `node_modules/@iress-oss/ids-components/.ai/guides/get-started-content-security-policy.md` for details (requires `@iress-oss/ids-components` to be installed).
|
|
@@ -494,7 +494,7 @@ function Dashboard() {
|
|
|
494
494
|
## Best Practices
|
|
495
495
|
|
|
496
496
|
1. **Minimise component nesting** — Use the fewest components possible to achieve the layout. Every wrapper component should earn its place. Before adding `IressInline` or `IressStack`, check whether the parent component already handles the layout (e.g. `IressCard` has `heading` and `footer` props; `IressModal` has `actions`; `IressButtonGroup` handles horizontal button layout). See the "Unnecessary layout wrappers" section in Common Mistakes below.
|
|
497
|
-
2. **Always wrap in IressProvider** — Required at the root of your app for fonts and CSS variables. `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, and `IressIconProvider` — do not add these separately. If using `IressShadow`, no additional providers are needed as it includes `IressProvider` internally.
|
|
497
|
+
2. **Always wrap in IressProvider** — Required at the root of your app for fonts and CSS variables. `IressProvider` already includes `IressModalProvider`, `IressSlideoutProvider`, `IressToasterProvider`, `IressPopoverProvider`, and `IressIconProvider` — do not add these separately. If using `IressShadow`, no additional providers are needed as it includes `IressProvider` internally.
|
|
498
498
|
3. **Use IressField for all form inputs** — Provides consistent labels, hints, and validation display
|
|
499
499
|
4. **Use IressStack/IressInline only when needed** — Prefer these over custom CSS flex/grid, but don't add them when the parent already provides spacing or layout
|
|
500
500
|
5. **Use correct spacing token format** — Always prefix with the token category: `gap="spacing.4"`, `p="spacing.6"`. Alias tokens (`"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`) are also valid. Never use bare numbers like `gap="4"`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { p as e, u as t } from "./constants-D0UW4Ewm.js";
|
|
2
|
+
import { IressIconProvider as n } from "./components/Icon/IconProvider.js";
|
|
3
|
+
import { IressPopoverProvider as r } from "./components/Popover/PopoverProvider.js";
|
|
4
|
+
import { IressModalProvider as i } from "./components/Modal/ModalProvider.js";
|
|
5
|
+
import { IressToasterProvider as a } from "./components/Toaster/ToasterProvider.js";
|
|
6
|
+
import { IressSlideoutProvider as o } from "./components/Slideout/SlideoutProvider.js";
|
|
7
|
+
import { useEffect as s } from "react";
|
|
8
|
+
import { createPortal as c } from "react-dom";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
//#region ../tokens/dist/enums.js
|
|
11
|
+
var d = /* @__PURE__ */ function(e) {
|
|
12
|
+
return e.Color = "color", e.Dimension = "dimension", e.FontFamily = "fontFamily", e.FontSize = "fontSize", e.Background = "background", e.Border = "border", e.Radius = "radius", e.Shadow = "shadow", e.Typography = "typography", e;
|
|
13
|
+
}({}), f = ".875rem", p = "Ubuntu, Helvetica, sans-serif", m = "Inter, Helvetica, sans-serif", h = ["https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"];
|
|
14
|
+
d.FontSize, d.FontFamily, d.FontFamily, d.Typography, `${p}`, `${f}`, d.Typography, `${p}`, `${f}`, d.Typography, `${p}`, `${f}`, d.Typography, `${p}`, `${f}`, d.Typography, `${p}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${m}`, `${f}`, d.Typography, `${f}`;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/Provider/Provider.tsx
|
|
17
|
+
var g = ({ children: d, container: f, noDefaultFont: p, noIconProvider: m, noSubsetting: g, popoverContainer: _, position: v, zIndexOffset: y, toasterOffset: b, ...x }) => {
|
|
18
|
+
s(() => {
|
|
19
|
+
if (y === void 0) return;
|
|
20
|
+
let t = document.documentElement, n = t.style.getPropertyValue(e), r = String(y);
|
|
21
|
+
return t.style.setProperty(e, r), () => {
|
|
22
|
+
t.style.getPropertyValue(e) === r && (n ? t.style.setProperty(e, n) : t.style.removeProperty(e));
|
|
23
|
+
};
|
|
24
|
+
}, [y]), s(() => {
|
|
25
|
+
if (b === void 0) return;
|
|
26
|
+
let e = document.documentElement, n = e.style.getPropertyValue(t);
|
|
27
|
+
return e.style.setProperty(t, b), () => {
|
|
28
|
+
e.style.getPropertyValue("--iress-toaster-offset") === b && (n ? e.style.setProperty(t, n) : e.style.removeProperty(t));
|
|
29
|
+
};
|
|
30
|
+
}, [b]);
|
|
31
|
+
let S = /* @__PURE__ */ l(r, {
|
|
32
|
+
container: _ === "container" ? f : _,
|
|
33
|
+
children: /* @__PURE__ */ u(i, {
|
|
34
|
+
container: f,
|
|
35
|
+
children: [/* @__PURE__ */ l(a, {
|
|
36
|
+
container: f,
|
|
37
|
+
position: v,
|
|
38
|
+
children: /* @__PURE__ */ l(o, {
|
|
39
|
+
container: f,
|
|
40
|
+
...x,
|
|
41
|
+
children: d
|
|
42
|
+
})
|
|
43
|
+
}), !p && c(h.map((e) => /* @__PURE__ */ l("link", {
|
|
44
|
+
rel: "stylesheet",
|
|
45
|
+
href: e,
|
|
46
|
+
"data-iress-design-system-font": !0
|
|
47
|
+
}, e)), document.head, "design-system-font")]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
return m ? S : /* @__PURE__ */ l(n, {
|
|
51
|
+
container: f,
|
|
52
|
+
noSubsetting: g,
|
|
53
|
+
children: S
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
g.displayName = "IressProvider";
|
|
57
|
+
//#endregion
|
|
58
|
+
export { h as n, g as t };
|