@phillips/seldon 1.72.2 → 1.73.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/components/Detail/Detail.d.ts +4 -4
- package/dist/components/Detail/Detail.js +11 -10
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/patterns/DetailList/DetailList.d.ts +4 -4
- package/dist/patterns/DetailList/DetailList.js +20 -20
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
|
2
2
|
export interface DetailProps extends ComponentProps<'div'> {
|
|
3
|
-
label:
|
|
4
|
-
value:
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
value: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* ## Overview
|
|
@@ -13,6 +13,6 @@ export interface DetailProps extends ComponentProps<'div'> {
|
|
|
13
13
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-detail--overview)
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
declare const Detail:
|
|
16
|
+
declare const Detail: React.ForwardRefExoticComponent<Omit<DetailProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
export type DetailComponent = ReturnType<typeof Detail>;
|
|
18
18
|
export default Detail;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { getCommonProps as d } from "../../utils/index.js";
|
|
4
|
+
import n from "../../node_modules/classnames/index.js";
|
|
5
|
+
const f = c(({ className: m = "", label: l, value: o, ...s }, r) => {
|
|
6
|
+
const { className: a, ...t } = d(s, "Detail");
|
|
7
|
+
return /* @__PURE__ */ i("div", { ...t, className: n(a, m), ...s, ref: r, children: [
|
|
8
|
+
/* @__PURE__ */ e("dt", { className: `${a}__label`, children: l }),
|
|
9
|
+
/* @__PURE__ */ e("dd", { className: `${a}__value`, children: o })
|
|
9
10
|
] });
|
|
10
11
|
});
|
|
11
|
-
|
|
12
|
+
f.displayName = "Detail";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
f as default
|
|
14
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index6.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
4
|
var r;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
-
import { DetailComponent } from '../../components/Detail';
|
|
3
2
|
import { DetailListAlignment } from './types';
|
|
3
|
+
import { DetailComponent } from '../../components/Detail';
|
|
4
4
|
export interface DetailListProps extends ComponentProps<'dl'> {
|
|
5
5
|
/**
|
|
6
6
|
* Determines whether each Details' label and value are aligned in columns or justified
|
|
7
7
|
*/
|
|
8
|
-
alignment
|
|
8
|
+
alignment?: DetailListAlignment;
|
|
9
9
|
/**
|
|
10
10
|
* The Detail components to render
|
|
11
11
|
*/
|
|
12
|
-
children: DetailComponent[];
|
|
12
|
+
children: DetailComponent[] | DetailComponent;
|
|
13
13
|
/**
|
|
14
14
|
* Whether to render separators between each Detail component
|
|
15
15
|
*/
|
|
16
|
-
hasSeparators
|
|
16
|
+
hasSeparators?: boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* ## Overview
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N } from "react";
|
|
3
|
-
import
|
|
3
|
+
import l from "../../node_modules/classnames/index.js";
|
|
4
4
|
import { getCommonProps as $, px as s } from "../../utils/index.js";
|
|
5
|
-
import { DetailListAlignment as
|
|
6
|
-
import { getDetailKey as
|
|
5
|
+
import { DetailListAlignment as o } from "./types.js";
|
|
6
|
+
import { getDetailKey as n } from "./utils.js";
|
|
7
7
|
const D = N(
|
|
8
|
-
({ alignment: o, className: p, children:
|
|
9
|
-
const { className:
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
({ alignment: t = o.justified, className: p, children: a, hasSeparators: u = !1, ...e }, c) => {
|
|
9
|
+
const { className: i, ...d } = $(e, "DetailList"), m = Array.isArray(a) ? a : [a];
|
|
10
|
+
return /* @__PURE__ */ f(
|
|
11
11
|
"dl",
|
|
12
12
|
{
|
|
13
|
-
...
|
|
14
|
-
className:
|
|
15
|
-
[`${s}-columns`]:
|
|
16
|
-
[`${s}-justified`]:
|
|
13
|
+
...d,
|
|
14
|
+
className: l(i, p, {
|
|
15
|
+
[`${s}-columns`]: t === o.columns,
|
|
16
|
+
[`${s}-justified`]: t === o.justified
|
|
17
17
|
}),
|
|
18
|
-
...
|
|
19
|
-
ref:
|
|
20
|
-
children:
|
|
18
|
+
...e,
|
|
19
|
+
ref: c,
|
|
20
|
+
children: m == null ? void 0 : m.map((r, j) => /* @__PURE__ */ f(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
className:
|
|
24
|
-
[`${s}-has-separators`]:
|
|
25
|
-
[`${s}-columns`]:
|
|
26
|
-
[`${s}-justified`]:
|
|
23
|
+
className: l(`${i}-wrapper`, {
|
|
24
|
+
[`${s}-has-separators`]: u,
|
|
25
|
+
[`${s}-columns`]: t === o.columns,
|
|
26
|
+
[`${s}-justified`]: t === o.justified
|
|
27
27
|
}),
|
|
28
|
-
children:
|
|
28
|
+
children: r
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
n(r, j)
|
|
31
31
|
))
|
|
32
32
|
}
|
|
33
33
|
);
|