@phillips/seldon 1.210.0 → 1.210.2

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.
@@ -39,7 +39,14 @@ export declare const Seconds: {
39
39
  };
40
40
  };
41
41
  };
42
- export declare const Compact: (props: CountdownProps) => import("react/jsx-runtime").JSX.Element;
42
+ export declare const Compact: {
43
+ (props: CountdownProps): import("react/jsx-runtime").JSX.Element;
44
+ parameters: {
45
+ chromatic: {
46
+ disableSnapshot: boolean;
47
+ };
48
+ };
49
+ };
43
50
  export declare const ClosingCountdown: {
44
51
  (props: CountdownProps): import("react/jsx-runtime").JSX.Element;
45
52
  argTypes: {
@@ -48,4 +55,9 @@ export declare const ClosingCountdown: {
48
55
  options: CountdownVariants[];
49
56
  };
50
57
  };
58
+ parameters: {
59
+ chromatic: {
60
+ disableSnapshot: boolean;
61
+ };
62
+ };
51
63
  };
@@ -32,6 +32,11 @@ export declare const TextWithSkeleton: {
32
32
  variant: TextVariants;
33
33
  isSkeletonLoading: boolean;
34
34
  };
35
+ parameters: {
36
+ chromatic: {
37
+ disableSnapshot: boolean;
38
+ };
39
+ };
35
40
  argTypes: {
36
41
  variant: {
37
42
  options: typeof TextVariants;
@@ -12,3 +12,7 @@ export declare const Playground: {
12
12
  };
13
13
  };
14
14
  export declare const CountryPhoneCodePicker: (props: CountryPickerProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const PreSelectedCountry: {
16
+ (): import("react/jsx-runtime").JSX.Element;
17
+ storyName: string;
18
+ };
@@ -0,0 +1,16 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { default as CountryPickerModal, CountryPickerModalProps } from './CountryPickerModal';
3
+ import { ModalBaseProps } from './types';
4
+ declare const meta: Meta<typeof CountryPickerModal>;
5
+ export default meta;
6
+ export declare const DefaultOpen: {
7
+ (props: ModalBaseProps & CountryPickerModalProps): import("react/jsx-runtime").JSX.Element;
8
+ args: {
9
+ modalTitle: string;
10
+ searchInputLabel: string;
11
+ searchInputPlaceholder: string;
12
+ selectButtonLabel: string;
13
+ baseClassName: string;
14
+ isOpen: boolean;
15
+ };
16
+ };
@@ -1,36 +1,36 @@
1
- import { jsxs as _, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as _, jsx as r } from "react/jsx-runtime";
2
2
  import $ from "../../components/Text/Text.js";
3
- import { TextVariants as d } from "../../components/Text/types.js";
4
- import e from "../../node_modules/classnames/index.js";
5
- import { getSafeCountryCallingCode as g } from "./utils.js";
6
- const v = ({
3
+ import { TextVariants as g } from "../../components/Text/types.js";
4
+ import d from "../../node_modules/classnames/index.js";
5
+ import { getSafeCountryCallingCode as h } from "./utils.js";
6
+ const y = ({
7
7
  code: t,
8
8
  name: n,
9
- isChecked: r,
10
- inputName: f,
9
+ isChecked: p,
10
+ inputName: e,
11
11
  baseClassName: o,
12
- variantConfig: h
12
+ variantConfig: f
13
13
  }) => {
14
- const c = `${o}__radio-${t}`, { isPhone: i, onChange: l } = h;
14
+ const c = `${o}__radio-${t}`, { isPhone: i, onChange: l } = f;
15
15
  return /* @__PURE__ */ _(
16
16
  "label",
17
17
  {
18
18
  htmlFor: c,
19
- className: e(`${o}__option`, {
20
- [`${o}__option--selected`]: r,
19
+ className: d(`${o}__option`, {
20
+ [`${o}__option--selected`]: p,
21
21
  [`${o}__option--is-phone`]: i
22
22
  }),
23
- "aria-label": i ? `${n} +${g(t)}` : n,
23
+ "aria-label": i ? `${n} +${h(t)}` : n,
24
24
  children: [
25
- /* @__PURE__ */ p(
25
+ /* @__PURE__ */ r(
26
26
  "input",
27
27
  {
28
28
  type: "radio",
29
29
  id: c,
30
- name: f,
31
- checked: r,
32
- className: e(`${o}__radio`, {
33
- [`${o}__radio--selected`]: r,
30
+ name: e,
31
+ checked: p,
32
+ className: d(`${o}__radio`, {
33
+ [`${o}__radio--selected`]: p,
34
34
  [`${o}__radio--visually-hidden`]: i
35
35
  }),
36
36
  onChange: () => {
@@ -39,24 +39,25 @@ const v = ({
39
39
  }
40
40
  ),
41
41
  /* @__PURE__ */ _("span", { className: `${o}__option-content`, children: [
42
- /* @__PURE__ */ p($, { variant: d.string2, className: `${o}__option-name`, children: n }),
43
- i && /* @__PURE__ */ _($, { variant: d.string2, className: `${o}__option-code`, children: [
42
+ /* @__PURE__ */ r($, { variant: g.string2, className: `${o}__option-name`, children: n }),
43
+ i && /* @__PURE__ */ _($, { variant: g.string2, className: `${o}__option-code`, children: [
44
44
  "+",
45
- g(t)
45
+ h(t)
46
46
  ] })
47
47
  ] }),
48
- /* @__PURE__ */ p(
48
+ /* @__PURE__ */ r("span", { className: `${o}__option-flag`, children: /* @__PURE__ */ r(
49
49
  "img",
50
50
  {
51
- src: `https://flagcdn.com/24x18/${t.toLowerCase()}.png`,
51
+ src: `https://flagcdn.com/h20/${t.toLowerCase()}.png`,
52
+ srcSet: `https://flagcdn.com/h40/${t.toLowerCase()}.png 2x`,
52
53
  alt: `${n} flag`,
53
- className: `${o}__option-flag`
54
+ className: `${o}__option-flag-img`
54
55
  }
55
- )
56
+ ) })
56
57
  ]
57
58
  }
58
59
  );
59
60
  };
60
61
  export {
61
- v as CountryPickerOption
62
+ y as CountryPickerOption
62
63
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
2
  import y from "../../components/Icon/Icon.js";
3
3
  import { TextVariants as k } from "../../components/Text/types.js";
4
- import P from "../../components/Text/Text.js";
4
+ import w from "../../components/Text/Text.js";
5
5
  import t from "../../node_modules/classnames/index.js";
6
- import { countries as w } from "./constants.js";
6
+ import { countries as P } from "./constants.js";
7
7
  import { forwardRef as I } from "react";
8
8
  import { useNormalizedInputProps as T, px as b } from "../../utils/index.js";
9
9
  const j = I(
@@ -17,17 +17,17 @@ const j = I(
17
17
  id: e,
18
18
  className: f,
19
19
  baseClassName: r,
20
- variantConfig: u
21
- }, v) => {
22
- const { isPhone: a, value: c } = u, n = T({
20
+ variantConfig: h
21
+ }, u) => {
22
+ const { isPhone: c, value: a } = h, n = T({
23
23
  id: "country-picker-trigger-input",
24
24
  invalid: o,
25
25
  invalidText: s,
26
26
  type: "text"
27
- }), $ = n.invalidId, g = a ? c : w.filter((x) => x.name === c)?.[0]?.code, h = () => n.validation ? n.validation : /* @__PURE__ */ i("p", { className: `${b}-input__validation`, children: " " });
27
+ }), $ = n.invalidId, g = c ? a : P.filter((x) => x.name === a)?.[0]?.code, v = () => n.validation ? n.validation : /* @__PURE__ */ i("p", { className: `${b}-input__validation`, children: " " });
28
28
  return /* @__PURE__ */ d("div", { className: t(`${r}__trigger`, f), children: [
29
29
  /* @__PURE__ */ i(
30
- P,
30
+ w,
31
31
  {
32
32
  variant: k.string2,
33
33
  className: t(`${r}__trigger-label`, {
@@ -40,33 +40,34 @@ const j = I(
40
40
  /* @__PURE__ */ d(
41
41
  "button",
42
42
  {
43
- ref: v,
43
+ ref: u,
44
44
  type: "button",
45
45
  "aria-label": p,
46
46
  "aria-invalid": n.invalid,
47
47
  "aria-describedby": $,
48
48
  className: t(`${r}__trigger-btn`, {
49
49
  [`${r}__trigger-btn--error`]: o,
50
- [`${r}__trigger-btn--is-phone`]: a
50
+ [`${r}__trigger-btn--is-phone`]: c
51
51
  }),
52
52
  onClick: _,
53
53
  "data-testid": "country-picker-trigger",
54
54
  id: e,
55
55
  children: [
56
- g && /* @__PURE__ */ i(
56
+ g && /* @__PURE__ */ i("span", { className: `${r}__trigger-flag`, children: /* @__PURE__ */ i(
57
57
  "img",
58
58
  {
59
- src: `https://flagcdn.com/24x18/${g.toLowerCase()}.png`,
60
- alt: `${c} flag`,
61
- className: `${r}__trigger-flag`
59
+ src: `https://flagcdn.com/h20/${g.toLowerCase()}.png`,
60
+ srcSet: `https://flagcdn.com/h40/${g.toLowerCase()}.png 2x`,
61
+ alt: `${a} flag`,
62
+ className: `${r}__trigger-flag-img`
62
63
  }
63
- ),
64
+ ) }),
64
65
  /* @__PURE__ */ i("span", { className: t(`${r}__trigger-text`), children: m }),
65
66
  /* @__PURE__ */ i("span", { className: t(`${r}__trigger-icon`), children: /* @__PURE__ */ i(y, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
66
67
  ]
67
68
  }
68
69
  ),
69
- !a && h()
70
+ !c && v()
70
71
  ] });
71
72
  }
72
73
  );
@@ -39,9 +39,24 @@
39
39
  }
40
40
 
41
41
  &-flag {
42
+ align-items: center;
43
+ display: flex;
42
44
  height: 1rem;
45
+ justify-content: center;
43
46
  margin-right: $spacing-sm;
44
- vertical-align: middle;
47
+ overflow: hidden;
48
+ width: 1.5rem;
49
+
50
+ @media (min-width: $breakpoint-md) {
51
+ height: 1.25rem;
52
+ width: 1.75rem;
53
+ }
54
+
55
+ &-img {
56
+ display: block;
57
+ height: 100%;
58
+ width: auto;
59
+ }
45
60
  }
46
61
  }
47
62
  .#{$px}-country-picker__radio {
@@ -74,8 +74,24 @@
74
74
  }
75
75
 
76
76
  &-flag {
77
+ align-items: center;
78
+ display: flex;
77
79
  height: 1rem;
80
+ justify-content: center;
78
81
  margin-right: $spacing-sm;
82
+ overflow: hidden;
83
+ width: 1.5rem;
84
+
85
+ @media (min-width: $breakpoint-md) {
86
+ height: 1.25rem;
87
+ width: 1.75rem;
88
+ }
89
+
90
+ &-img {
91
+ display: block;
92
+ height: 100%;
93
+ width: auto;
94
+ }
79
95
  }
80
96
  }
81
97
  }
@@ -1,5 +1,7 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
+ $dropdown-height: 240px;
4
+
3
5
  .#{$px}-filter-dropdown-menu {
4
6
  background: $white-100;
5
7
  border-radius: $radius-sm;
@@ -7,18 +9,24 @@
7
9
  display: flex;
8
10
  flex-direction: column;
9
11
  min-width: 100%;
10
- padding: $spacing-md;
12
+ padding: $spacing-sm 0;
11
13
 
12
14
  &__filters {
13
15
  display: flex;
14
16
  flex-direction: column;
15
- gap: $spacing-xsm;
16
- max-height: 25vh;
17
+ gap: $spacing-sm;
18
+ max-height: $dropdown-height;
17
19
  overflow-y: auto;
20
+ padding: 0 $spacing-sm;
21
+ padding-bottom: $spacing-sm;
18
22
 
19
23
  &--mobile {
20
24
  padding: 0 $spacing-md $spacing-md;
21
25
  }
26
+
27
+ @media (min-width: $breakpoint-xl) {
28
+ max-height: calc($dropdown-height + $spacing-sm);
29
+ }
22
30
  }
23
31
 
24
32
  &__button-wrap {
@@ -27,10 +35,11 @@
27
35
  }
28
36
 
29
37
  &__buttons-wrap {
38
+ border-top: 1px solid $bg-border;
30
39
  display: flex;
31
40
  gap: $spacing-sm;
32
41
  justify-content: space-between;
33
- margin-top: $spacing-sm;
42
+ padding: $spacing-sm $spacing-sm 0 $spacing-sm;
34
43
 
35
44
  &--drawer {
36
45
  box-shadow: 0 -4px 8px -4px $medium-gray;
@@ -117,6 +126,7 @@
117
126
  display: flex;
118
127
  flex-direction: row;
119
128
  justify-content: space-between;
129
+ max-height: 2rem;
120
130
  }
121
131
 
122
132
  &__label {
@@ -134,6 +144,10 @@
134
144
  }
135
145
  }
136
146
 
147
+ .#{$px}-filter-dropdown-menu .#{$px}-filter-input__input__wrapper {
148
+ max-height: 2rem;
149
+ }
150
+
137
151
  .#{$px}-filter-drawer-mobile {
138
152
  padding: 0;
139
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.210.0",
3
+ "version": "1.210.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"