@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.
@@ -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: string;
4
- value: string;
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: import("react").ForwardRefExoticComponent<Omit<DetailProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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 r, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import { getCommonProps as i } from "../../utils/index.js";
4
- const c = t(({ className: s, ...a }, m) => {
5
- const { className: e, ...o } = i(a, "Detail");
6
- return /* @__PURE__ */ r("div", { ...o, className: `${e} ${s}`, ...a, ref: m, children: [
7
- /* @__PURE__ */ l("dt", { className: `${e}__label`, children: a.label }),
8
- /* @__PURE__ */ l("dd", { className: `${e}__value`, children: a.value })
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
- c.displayName = "Detail";
12
+ f.displayName = "Detail";
12
13
  export {
13
- c as default
14
+ f as default
14
15
  };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index6.js";
1
+ import { __module as t } from "../../_virtual/index5.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index5.js";
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: DetailListAlignment;
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: boolean;
16
+ hasSeparators?: boolean;
17
17
  }
18
18
  /**
19
19
  * ## Overview
@@ -1,33 +1,33 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as f } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
- import f from "../../node_modules/classnames/index.js";
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 m } from "./types.js";
6
- import { getDetailKey as j } from "./utils.js";
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: t, hasSeparators: l, ...a }, u) => {
9
- const { className: e, ...c } = $(a, "DetailList");
10
- return /* @__PURE__ */ r(
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
- ...c,
14
- className: f(e, p, {
15
- [`${s}-columns`]: o === m.columns,
16
- [`${s}-justified`]: o === m.justified
13
+ ...d,
14
+ className: l(i, p, {
15
+ [`${s}-columns`]: t === o.columns,
16
+ [`${s}-justified`]: t === o.justified
17
17
  }),
18
- ...a,
19
- ref: u,
20
- children: t == null ? void 0 : t.map((i, d) => /* @__PURE__ */ r(
18
+ ...e,
19
+ ref: c,
20
+ children: m == null ? void 0 : m.map((r, j) => /* @__PURE__ */ f(
21
21
  "div",
22
22
  {
23
- className: f(`${e}-wrapper`, {
24
- [`${s}-has-separators`]: l,
25
- [`${s}-columns`]: o === m.columns,
26
- [`${s}-justified`]: o === m.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: i
28
+ children: r
29
29
  },
30
- j(i, d)
30
+ n(r, j)
31
31
  ))
32
32
  }
33
33
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.72.2",
3
+ "version": "1.73.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"