@phillips/seldon 1.136.0 → 1.137.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,76 +1,73 @@
1
- import { jsxs as k, Fragment as $, jsx as o } from "react/jsx-runtime";
2
- import v from "../../node_modules/classnames/index.js";
1
+ import { jsxs as N, Fragment as k, jsx as o } from "react/jsx-runtime";
2
+ import $ from "../../node_modules/classnames/index.js";
3
3
  import { getCommonProps as b, px as P } from "../../utils/index.js";
4
4
  import { ButtonVariants as j } from "./types.js";
5
5
  import { forwardRef as y, useState as H } from "react";
6
6
  const L = y(
7
7
  ({
8
8
  variant: s = j.primary,
9
- children: l,
10
- className: a,
11
- isIconLast: i = !1,
12
- type: x = "button",
13
- isDisabled: n = !1,
14
- href: t,
15
- target: m,
16
- prefetch: d = "none",
17
- isSkeletonLoading: B,
9
+ children: a,
10
+ className: l,
11
+ isIconLast: m = !1,
12
+ type: v = "button",
13
+ isDisabled: t = !1,
14
+ href: n,
15
+ target: i,
16
+ prefetch: c = "none",
17
+ isSkeletonLoading: x,
18
18
  ...r
19
- }, u) => {
20
- const { className: e, ...c } = b(r, "Button"), [C, N] = H(!1);
21
- if (t) {
22
- const f = () => /* @__PURE__ */ k($, { children: [
23
- /* @__PURE__ */ o("link", { "data-testid": "prefetch-link", rel: "prefetch", href: t }),
24
- /* @__PURE__ */ o("link", { "data-testid": "modulepreload-link", rel: "modulepreload", href: t })
25
- ] });
26
- return /* @__PURE__ */ k($, { children: [
19
+ }, f) => {
20
+ const { className: e, ...u } = b(r, "Button"), [B, C] = H(!1);
21
+ if (n) {
22
+ const d = () => /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o("link", { "data-testid": "prefetch-link", rel: "prefetch", href: n }) });
23
+ return /* @__PURE__ */ N(k, { children: [
27
24
  /* @__PURE__ */ o(
28
25
  "a",
29
26
  {
30
- ...c,
31
- ref: u,
32
- href: t,
33
- className: v(
27
+ ...u,
28
+ ref: f,
29
+ href: n,
30
+ className: $(
34
31
  `${e}`,
35
32
  `${e}--${s}`,
36
33
  {
37
- [`${e}--icon-last`]: i
34
+ [`${e}--icon-last`]: m
38
35
  },
39
- a
36
+ l
40
37
  ),
41
- target: m,
42
- rel: m === "_blank" ? "noopener noreferrer" : void 0,
38
+ target: i,
39
+ rel: i === "_blank" ? "noopener noreferrer" : void 0,
43
40
  onMouseOver: () => {
44
- n || N(!0);
41
+ t || C(!0);
45
42
  },
46
43
  onClick: (p) => {
47
- n ? p.preventDefault() : r.onClick?.(p);
44
+ t ? p.preventDefault() : r.onClick?.(p);
48
45
  },
49
- children: l
46
+ children: a
50
47
  }
51
48
  ),
52
- d === "intent" && C && /* @__PURE__ */ o(f, {}),
53
- d === "render" && /* @__PURE__ */ o(f, {})
49
+ c === "intent" && B && /* @__PURE__ */ o(d, {}),
50
+ c === "render" && /* @__PURE__ */ o(d, {})
54
51
  ] });
55
52
  } else
56
53
  return /* @__PURE__ */ o(
57
54
  "button",
58
55
  {
59
- ...c,
60
- ref: u,
61
- type: x,
62
- className: v(
56
+ ...u,
57
+ ref: f,
58
+ type: v,
59
+ className: $(
63
60
  `${e}`,
64
61
  `${e}--${s}`,
65
62
  {
66
- [`${e}--icon-last`]: i,
67
- [`${P}-skeleton`]: B
63
+ [`${e}--icon-last`]: m,
64
+ [`${P}-skeleton`]: x
68
65
  },
69
- a
66
+ l
70
67
  ),
71
- disabled: n,
68
+ disabled: t,
72
69
  ...r,
73
- children: l
70
+ children: a
74
71
  }
75
72
  );
76
73
  }
@@ -0,0 +1,10 @@
1
+ export interface LoaderProps {
2
+ /** Prop for centering Loader component */
3
+ isCentered?: boolean;
4
+ /** Accessible label for the loader */
5
+ 'aria-label'?: string;
6
+ /** Additional class names for the loader */
7
+ className?: string;
8
+ }
9
+ declare const Loader: import('react').ForwardRefExoticComponent<LoaderProps & import('react').RefAttributes<HTMLSpanElement>>;
10
+ export default Loader;
@@ -0,0 +1,24 @@
1
+ declare const meta: {
2
+ title: string;
3
+ component: import('react').ForwardRefExoticComponent<import('./Loader').LoaderProps & import('react').RefAttributes<HTMLSpanElement>>;
4
+ argTypes: {
5
+ isCentered: {
6
+ control: "boolean";
7
+ };
8
+ };
9
+ };
10
+ export default meta;
11
+ export declare const LoaderDefault: () => import("react/jsx-runtime").JSX.Element;
12
+ export declare const LoaderNotCentered: {
13
+ (args: {
14
+ isCentered: boolean;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ args: {
17
+ isCentered: boolean;
18
+ };
19
+ argTypes: {
20
+ isCentered: {
21
+ control: string;
22
+ };
23
+ };
24
+ };
@@ -24,6 +24,7 @@
24
24
  @use 'components/Toggle/toggle';
25
25
  @use 'components/Link/link';
26
26
  @use 'components/LinkBlock/linkBlock';
27
+ @use 'components/Loader/loader';
27
28
  @use 'components/LinkList/linkList';
28
29
  @use 'components/Text/text';
29
30
  @use 'components/TextSymbol/textSymbol';
@@ -0,0 +1,26 @@
1
+ @use '../../allPartials' as *;
2
+
3
+ .#{$px}-loader {
4
+ animation: rotation 1s linear infinite;
5
+ border: 2px solid $primary-black;
6
+ border-bottom-color: transparent;
7
+ border-radius: 50%;
8
+ box-sizing: border-box;
9
+ display: flex;
10
+ height: var(--button-label-line-height);
11
+ width: var(--button-label-line-height);
12
+
13
+ &--centered {
14
+ margin: auto;
15
+ }
16
+
17
+ @keyframes rotation {
18
+ 0% {
19
+ transform: rotate(0deg);
20
+ }
21
+
22
+ 100% {
23
+ transform: rotate(360deg);
24
+ }
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.136.0",
3
+ "version": "1.137.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"