@sonic-equipment/ui 133.0.0 → 134.0.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.
Files changed (66) hide show
  1. package/dist/algolia/{algolia-intialization.js → algolia-initialization.js} +7 -0
  2. package/dist/algolia/algolia-insights-provider.js +7 -0
  3. package/dist/algolia/algolia-search-provider.js +19 -0
  4. package/dist/algolia/use-algolia-insights.d.ts +13 -6
  5. package/dist/algolia/use-algolia-insights.js +93 -10
  6. package/dist/buttons/button/button.d.ts +4 -1
  7. package/dist/buttons/button/button.js +2 -2
  8. package/dist/country-selector/country-select/country-select.d.ts +1 -0
  9. package/dist/country-selector/country-select/country-select.js +2 -2
  10. package/dist/delivery-time/delivery-time.js +1 -1
  11. package/dist/exports.d.ts +7 -2
  12. package/dist/forms/checkbox/checkbox.d.ts +2 -1
  13. package/dist/forms/checkbox/checkbox.js +2 -2
  14. package/dist/forms/field-error/field-error.d.ts +2 -1
  15. package/dist/forms/field-error/field-error.js +3 -2
  16. package/dist/forms/input/input.d.ts +1 -0
  17. package/dist/forms/input/input.js +2 -2
  18. package/dist/forms/label/label.d.ts +3 -1
  19. package/dist/forms/label/label.js +3 -2
  20. package/dist/forms/switch/switch.d.ts +2 -1
  21. package/dist/forms/switch/switch.js +2 -2
  22. package/dist/forms/text-field/text-field.d.ts +3 -1
  23. package/dist/forms/text-field/text-field.js +4 -3
  24. package/dist/forms/text-field/text-field.module.css.js +1 -1
  25. package/dist/forms/textarea/textarea.d.ts +1 -0
  26. package/dist/forms/textarea/textarea.js +3 -2
  27. package/dist/global-search/plugins/categories-plugin.js +2 -1
  28. package/dist/global-search/plugins/popular-categories-plugin.js +2 -0
  29. package/dist/global-search/plugins/query-suggestions-plugin.js +1 -0
  30. package/dist/global-search/plugins/quick-access-plugin.js +2 -2
  31. package/dist/global-search/search-result-panel/sections/with-results.js +0 -1
  32. package/dist/index.js +8 -3
  33. package/dist/info-icon-tooltip/info-icon-tooltip.d.ts +7 -0
  34. package/dist/info-icon-tooltip/info-icon-tooltip.js +20 -0
  35. package/dist/info-icon-tooltip/info-icon-tooltip.module.css.js +3 -0
  36. package/dist/intl/translation-id.d.ts +1 -1
  37. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.d.ts +5 -0
  38. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +83 -0
  39. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.js +3 -77
  40. package/dist/pages/checkout/payment-page/components/payment.js +49 -4
  41. package/dist/pages/checkout/payment-page/payment-page-content.d.ts +15 -0
  42. package/dist/pages/checkout/payment-page/payment-page-content.js +43 -0
  43. package/dist/pages/checkout/payment-page/payment-page.js +3 -37
  44. package/dist/pages/checkout/shipping-page/components/edit-address.js +3 -3
  45. package/dist/pages/checkout/shipping-page/shipping-page-content.d.ts +14 -0
  46. package/dist/pages/checkout/shipping-page/shipping-page-content.js +40 -0
  47. package/dist/pages/checkout/shipping-page/shipping-page.js +45 -54
  48. package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.js +11 -1
  49. package/dist/pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +0 -1
  50. package/dist/pages/product/search-result-page/search-result-product-overview/search-result-product-overview.js +0 -1
  51. package/dist/shared/fetch/request.d.ts +18 -13
  52. package/dist/shared/fetch/request.js +22 -9
  53. package/dist/shared/ga/use-data-layer.d.ts +7 -3
  54. package/dist/shared/ga/use-data-layer.js +6 -1
  55. package/dist/shared/utils/promise.d.ts +2 -0
  56. package/dist/shared/utils/promise.js +9 -0
  57. package/dist/sign-in-form/sign-in-form.d.ts +19 -0
  58. package/dist/sign-in-form/sign-in-form.js +49 -0
  59. package/dist/sign-in-form/sign-in-form.module.css.js +3 -0
  60. package/dist/styles.css +192 -44
  61. package/dist/tooltip/tooltip.d.ts +3 -2
  62. package/dist/tooltip/tooltip.js +5 -4
  63. package/package.json +1 -1
  64. package/dist/shared/utils/wait.d.ts +0 -1
  65. package/dist/shared/utils/wait.js +0 -5
  66. /package/dist/algolia/{algolia-intialization.d.ts → algolia-initialization.d.ts} +0 -0
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { Form } from 'react-aria-components';
4
+ import clsx from 'clsx';
5
+ import { Button } from '../buttons/button/button.js';
6
+ import { Link } from '../buttons/link/link.js';
7
+ import { Switch } from '../forms/switch/switch.js';
8
+ import { TextField } from '../forms/text-field/text-field.js';
9
+ import { useFormattedMessage } from '../intl/use-formatted-message.js';
10
+ import { Heading } from '../typography/heading/heading.js';
11
+ import styles from './sign-in-form.module.css.js';
12
+
13
+ const GUEST_SIGN_IN_BUTTON_NAME = 'guestSignin';
14
+ function SignInForm({ allowGuestSignIn = false, initialEmail, initialRemember, onSubmit = () => { }, }) {
15
+ const t = useFormattedMessage();
16
+ const handleSubmit = (event) => {
17
+ event.preventDefault();
18
+ const form = event.currentTarget;
19
+ const formData = new FormData(form);
20
+ // in case of guest sign-in submit
21
+ const submitter = event.nativeEvent.submitter;
22
+ if (submitter?.name === GUEST_SIGN_IN_BUTTON_NAME) {
23
+ return onSubmit({
24
+ data: {
25
+ guestSignin: true,
26
+ },
27
+ });
28
+ }
29
+ // regular sign-in
30
+ const email = formData.get('email')?.toString();
31
+ const password = formData.get('password')?.toString();
32
+ const remember = Boolean(formData.get('remember'));
33
+ if (!email)
34
+ throw new Error('Email value is required');
35
+ if (!password)
36
+ throw new Error('Password value is required');
37
+ onSubmit({
38
+ data: {
39
+ email,
40
+ guestSignin: false,
41
+ password,
42
+ remember,
43
+ },
44
+ });
45
+ };
46
+ return (jsxs(Form, { "aria-label": t('sign in'), autoComplete: "off", className: clsx(styles['sign-in-form'], styles['form']), onSubmit: handleSubmit, validationBehavior: "native", children: [jsx("header", { className: styles['form-header'], children: jsx(Heading, { "data-test-selector": "PageTitle", italic: true, size: "m", tag: "h1", uppercase: true, children: t('sign in') }) }), jsxs("fieldset", { className: clsx(styles['form-fieldset'], styles['columns']), children: [jsx("div", { className: styles['form-segment'], children: jsx(TextField, { "data-test-selector": "signIn_userName", defaultValue: initialEmail, isRequired: true, label: t('Email'), name: "email", showLabel: true, type: "email" }) }), jsx("div", { className: styles['form-segment'], children: jsx(TextField, { "data-test-selector": "signIn_password", isRequired: true, label: t('Password'), name: "password", showLabel: true, type: "password" }) })] }), jsxs("footer", { className: styles['form-footer'], children: [jsx("div", { className: styles['form-segment'], children: jsx(Switch, { className: styles['floating'], defaultSelected: initialRemember, name: "remember", value: "true", children: t('Remember me') }) }), jsx("div", { className: styles['form-segment'], children: jsx(Button, { "data-test-selector": "signIn_submit", type: "submit", withArrow: true, children: t('sign in') }) }), jsxs("div", { className: styles['form-segment'], children: [jsx("p", { children: jsx(Link, { "data-test-selector": "signIn_forgotPassword", hasUnderline: true, href: "#", children: t('Forgot password?') }) }), jsxs("p", { children: [t('New user?'), ' ', jsx(Link, { "data-test-selector": "signInCreateNewAccount_createNewAccount", hasUnderline: true, href: "#", children: t('create account') })] })] }), allowGuestSignIn && (jsx("div", { className: styles['form-segment'], children: jsx(Button, { color: "secondary", isValidating: false, name: GUEST_SIGN_IN_BUTTON_NAME, type: "submit", value: "true", variant: "outline", children: t('Or sign in as guest') }) }))] })] }));
47
+ }
48
+
49
+ export { SignInForm };
@@ -0,0 +1,3 @@
1
+ var styles = {"sign-in-form":"sign-in-form-module-4DkkP","form":"sign-in-form-module-bGXUd","form-segment":"sign-in-form-module-TumIz","floating":"sign-in-form-module-bIzyz","form-fieldset":"sign-in-form-module-EoTYu","columns":"sign-in-form-module-9eIx-","form-footer":"sign-in-form-module-aYBAy"};
2
+
3
+ export { styles as default };
package/dist/styles.css CHANGED
@@ -998,13 +998,9 @@
998
998
  .checkbox-module-YNVdd {
999
999
  --selected-color: var(--color-brand-red);
1000
1000
  --selected-color-pressed: var(--color-brand-dark-red);
1001
- --disabled-color: color-mix(in srgb, var(--selected-color) 20%, transparent);
1001
+ --disabled-color: var(--color-brand-dark-gray);
1002
1002
  --checkmark-color: var(--color-white);
1003
- --disabled-checkmark-color: color-mix(
1004
- in srgb,
1005
- var(--checkmark-color) 40%,
1006
- transparent
1007
- );
1003
+ --disabled-checkmark-color: var(--color-white);
1008
1004
 
1009
1005
  all: unset;
1010
1006
  display: flex;
@@ -1031,15 +1027,17 @@
1031
1027
  }
1032
1028
 
1033
1029
  .checkbox-module-YNVdd .checkbox-module-pHIwh {
1034
- width: 1rem;
1035
- height: 1rem;
1030
+ aspect-ratio: 11/8;
1036
1031
  fill: none;
1032
+ inline-size: 10px;
1033
+ margin-block-start: 1px;
1037
1034
  stroke: currentcolor;
1038
1035
  stroke-dasharray: 22px;
1039
1036
  stroke-dashoffset: 66;
1040
1037
  stroke-linecap: round;
1041
- stroke-width: 2px;
1042
- transition: all 200ms;
1038
+ stroke-linejoin: round;
1039
+ stroke-width: 1.45;
1040
+ transition: all 200ms, stroke-dashoffset 600ms;
1043
1041
  }
1044
1042
 
1045
1043
  .checkbox-module-YNVdd[data-disabled] {
@@ -1047,12 +1045,6 @@
1047
1045
  opacity: 0.4;
1048
1046
  }
1049
1047
 
1050
- .checkbox-module-YNVdd[data-disabled] .checkbox-module-UKoyf {
1051
- border-color: var(--color-transparent);
1052
- background-color: var(--disabled-color);
1053
- color: var(--disabled-checkmark-color);
1054
- }
1055
-
1056
1048
  .checkbox-module-YNVdd[data-pressed] .checkbox-module-UKoyf {
1057
1049
  border-color: var(--color-brand-dark-gray);
1058
1050
  }
@@ -1077,6 +1069,11 @@
1077
1069
  stroke-dashoffset: 44;
1078
1070
  }
1079
1071
 
1072
+ .checkbox-module-YNVdd[data-selected][data-disabled] .checkbox-module-UKoyf, .checkbox-module-YNVdd[data-indeterminate][data-disabled] .checkbox-module-UKoyf {
1073
+ border-color: transparent;
1074
+ background: var(--disabled-color);
1075
+ }
1076
+
1080
1077
  .checkbox-module-YNVdd[data-indeterminate] .checkbox-module-pHIwh {
1081
1078
  fill: var(--checkmark-color);
1082
1079
  stroke: none;
@@ -1087,7 +1084,6 @@
1087
1084
  .checkbox-module-YNVdd.checkbox-module-nEhvW .checkbox-module-UKoyf {
1088
1085
  border: none;
1089
1086
  background: var(--selected-color);
1090
- background-size: 16px 16px;
1091
1087
  transition: none;
1092
1088
  }
1093
1089
 
@@ -1099,9 +1095,7 @@
1099
1095
  var(--selected-color)
1100
1096
  ),
1101
1097
  linear-gradient(var(--selected-color), var(--selected-color));
1102
- background-position:
1103
- 2px 2px,
1104
- 14px 14px;
1098
+ background-position: 2px 2px, 14px 14px;
1105
1099
  background-repeat: no-repeat;
1106
1100
  background-size: 10px 10px;
1107
1101
  }
@@ -1204,6 +1198,7 @@
1204
1198
  }
1205
1199
  .input-module-2woJR .input-module-zjVxG {
1206
1200
  display: inline-grid;
1201
+ width: 100%;
1207
1202
  align-items: center;
1208
1203
  grid-template-columns: 1fr 0;
1209
1204
  }
@@ -1217,23 +1212,28 @@
1217
1212
  color: var(--color-brand-dark-gray);
1218
1213
  }
1219
1214
  /* Don't show value-reveal button on empty password fields */
1220
- .input-module-2woJR .input-module-zjVxG input[type="password"] + .input-module-oeAz2 {
1215
+ .input-module-2woJR .input-module-zjVxG input[type='password'] + .input-module-oeAz2 {
1221
1216
  transition: all 0.2s ease;
1222
1217
  }
1223
- .input-module-2woJR .input-module-zjVxG input[type="password"][value=""] + .input-module-oeAz2 {
1218
+ .input-module-2woJR .input-module-zjVxG input[type='password'][value=''] + .input-module-oeAz2 {
1224
1219
  opacity: 0;
1225
1220
  visibility: hidden;
1226
1221
  }
1227
- .input-module-2woJR .input-module-zjVxG input[type="password"]:not([value=""]) + .input-module-oeAz2 {
1222
+ .input-module-2woJR .input-module-zjVxG input[type='password']:not([value='']) + .input-module-oeAz2 {
1228
1223
  opacity: 1;
1229
1224
  visibility: visible;
1230
1225
  }
1226
+
1231
1227
  .label-module-LGfJt {
1232
1228
  all: unset;
1233
1229
  cursor: pointer;
1234
1230
  font-weight: var(--font-weight-bold);
1235
1231
  }
1236
1232
 
1233
+ .label-module-LGfJt:has(+ div [data-disabled]) {
1234
+ cursor: default;
1235
+ }
1236
+
1237
1237
  .label-module-LGfJt :where(.label-module-oTWaS) {
1238
1238
  color: var(--color-brand-red);
1239
1239
  margin-inline-start: var(--space-4);
@@ -2437,13 +2437,13 @@
2437
2437
  --tooltip-bg-color: var(--color-gray-800);
2438
2438
 
2439
2439
  display: inline-block;
2440
- max-width: 250px;
2441
- padding: 10px;
2442
- border: 1px solid var(--tooltip-bg-color);
2443
- border-radius: 6px;
2440
+ padding: var(--space-12) var(--space-16);
2441
+ border-radius: var(--border-radius-8);
2444
2442
  background: var(--tooltip-bg-color);
2445
2443
  color: var(--color-white);
2446
- outline: none;
2444
+ font-size: var(--font-size-14);
2445
+ line-height: 1.14;
2446
+ max-inline-size: 250px;
2447
2447
  overflow-wrap: break-word;
2448
2448
  }
2449
2449
 
@@ -2455,11 +2455,11 @@
2455
2455
  }
2456
2456
 
2457
2457
  .tooltip-module-T-DtX[data-placement='top']:has(.tooltip-module-CBW5f) {
2458
- margin-bottom: 6px;
2458
+ margin-block-end: 6px;
2459
2459
  }
2460
2460
 
2461
2461
  .tooltip-module-T-DtX[data-placement='bottom']:has(.tooltip-module-CBW5f) {
2462
- margin-top: 6px;
2462
+ margin-block-start: 6px;
2463
2463
  }
2464
2464
 
2465
2465
  .tooltip-module-T-DtX[data-placement='bottom'] .tooltip-module-CBW5f svg {
@@ -2467,7 +2467,7 @@
2467
2467
  }
2468
2468
 
2469
2469
  .tooltip-module-T-DtX[data-placement='right']:has(.tooltip-module-CBW5f) {
2470
- margin-left: 6px;
2470
+ margin-inline-start: 6px;
2471
2471
  }
2472
2472
 
2473
2473
  .tooltip-module-T-DtX[data-placement='right'] .tooltip-module-CBW5f svg {
@@ -2475,7 +2475,7 @@
2475
2475
  }
2476
2476
 
2477
2477
  .tooltip-module-T-DtX[data-placement='left']:has(.tooltip-module-CBW5f) {
2478
- margin-right: 6px;
2478
+ margin-inline-end: 6px;
2479
2479
  }
2480
2480
 
2481
2481
  .tooltip-module-T-DtX[data-placement='left'] .tooltip-module-CBW5f svg {
@@ -2495,9 +2495,9 @@
2495
2495
  }
2496
2496
 
2497
2497
  .tooltip-module-DRHoc .tooltip-module-3q6nr {
2498
- min-width: unset;
2499
- min-height: unset;
2500
2498
  color: currentcolor;
2499
+ min-block-size: unset;
2500
+ min-inline-size: unset;
2501
2501
  }
2502
2502
 
2503
2503
  .tooltip-module-DRHoc .tooltip-module-3q6nr:hover {
@@ -4109,7 +4109,8 @@ button.swiper-pagination-bullet {
4109
4109
  box-sizing: border-box;
4110
4110
  border-radius: 12px;
4111
4111
  background: var(--box-color);
4112
- transition: all 200ms;
4112
+ transition-duration: 200ms;
4113
+ transition-property: background;
4113
4114
  }
4114
4115
 
4115
4116
  .switch-module-ywpXc .switch-module-2e1rG::before {
@@ -4174,6 +4175,39 @@ button.swiper-pagination-bullet {
4174
4175
  .password-reveal-toggle-module-uUQbW span {
4175
4176
  height: var(--space-24);
4176
4177
  }
4178
+ .info-icon-tooltip-module-oR4nD {
4179
+ --color-trigger: var(--color-brand-medium-gray);
4180
+ --color-trigger-hover: var(--color-brand-dark-gray);
4181
+ --color-trigger-active: var(--color-brand-dark-gray);
4182
+
4183
+ display: inline-flex;
4184
+ }
4185
+
4186
+ .info-icon-tooltip-module-oR4nD.info-icon-tooltip-module-5zfDr {
4187
+ --color-trigger: currentcolor;
4188
+ --color-trigger-hover: color-mix(in srgb, currentcolor, #000 20%);
4189
+ --color-trigger-active: color-mix(in srgb, currentcolor, #000 20%);
4190
+ }
4191
+
4192
+ .info-icon-tooltip-module-oR4nD .info-icon-tooltip-module-0lY-K {
4193
+ border-radius: 50%;
4194
+ color: var(--color-trigger);
4195
+ min-block-size: unset;
4196
+ min-inline-size: unset;
4197
+ }
4198
+
4199
+ .info-icon-tooltip-module-oR4nD .info-icon-tooltip-module-0lY-K:hover {
4200
+ color: var(--color-trigger-hover);
4201
+ }
4202
+
4203
+ .info-icon-tooltip-module-oR4nD .info-icon-tooltip-module-0lY-K:focus-visible {
4204
+ box-shadow: var(--shadow-focus-outline);
4205
+ }
4206
+
4207
+ .info-icon-tooltip-module-oR4nD[data-active] .info-icon-tooltip-module-0lY-K {
4208
+ color: var(--color-trigger-active);
4209
+ }
4210
+
4177
4211
  .textarea-module-C6Xr1 {
4178
4212
  position: relative;
4179
4213
  display: inline-block;
@@ -4184,8 +4218,7 @@ button.swiper-pagination-bullet {
4184
4218
  }
4185
4219
 
4186
4220
  .textarea-module-C6Xr1:has([data-disabled]) {
4187
- background-color: var(--color-brand-light-gray);
4188
- color: var(--color-brand-medium-gray);
4221
+ opacity: 0.4;
4189
4222
  }
4190
4223
 
4191
4224
  .textarea-module-C6Xr1:has([data-focused]) {
@@ -4233,19 +4266,37 @@ button.swiper-pagination-bullet {
4233
4266
 
4234
4267
  .text-field-module-JeaK0 {
4235
4268
  all: unset;
4236
- display: inline-flex;
4237
- flex-direction: column;
4238
- align-items: normal;
4239
- gap: var(--space-4);
4269
+ display: grid;
4270
+ grid-template-areas:
4271
+ 'label .'
4272
+ 'field info'
4273
+ 'error .';
4274
+ grid-template-columns: 1fr auto;
4240
4275
  }
4241
4276
 
4242
4277
  .text-field-module-JeaK0 span:empty {
4243
4278
  display: none;
4244
4279
  }
4245
4280
 
4246
- .text-field-module-JeaK0 input[type="password"] {
4247
- letter-spacing: 4px;
4248
- }
4281
+ .text-field-module-hFl0f {
4282
+ grid-area: label;
4283
+ margin-block-end: var(--space-4);
4284
+ }
4285
+
4286
+ .text-field-module-nHYDe {
4287
+ grid-area: field;
4288
+ }
4289
+
4290
+ .text-field-module-kHn5y {
4291
+ align-self: center;
4292
+ grid-area: info;
4293
+ margin-inline-start: var(--space-4);
4294
+ }
4295
+
4296
+ .text-field-module-8XbgH {
4297
+ grid-area: error;
4298
+ margin-block-start: var(--space-4);
4299
+ }
4249
4300
 
4250
4301
  .categories-grid-module-C751R {
4251
4302
  --amount-of-columns: 2;
@@ -5901,6 +5952,103 @@ button.swiper-pagination-bullet {
5901
5952
  --transition-duration: 0.3s;
5902
5953
  }
5903
5954
 
5955
+ .sign-in-form-module-4DkkP {
5956
+ min-inline-size: 300px;
5957
+ }
5958
+
5959
+ /* generic utility styles that we could reuse */
5960
+
5961
+ .sign-in-form-module-bGXUd {
5962
+ --tooltip-size: 24px;
5963
+ --info-icon-offset: calc((var(--tooltip-size) + var(--space-4)) * -1);
5964
+
5965
+ display: grid;
5966
+ container-type: inline-size;
5967
+ gap: var(--space-16);
5968
+ }
5969
+
5970
+ .sign-in-form-module-bGXUd p {
5971
+ margin: 0 0 var(--space-4);
5972
+ }
5973
+
5974
+ .sign-in-form-module-TumIz {
5975
+ display: grid;
5976
+ }
5977
+
5978
+ .sign-in-form-module-TumIz .sign-in-form-module-bIzyz {
5979
+ justify-self: flex-start;
5980
+ }
5981
+
5982
+ .sign-in-form-module-EoTYu {
5983
+ display: grid;
5984
+ padding: 0;
5985
+ border: 0;
5986
+ margin: 0;
5987
+ gap: var(--space-16);
5988
+ }
5989
+
5990
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- {
5991
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
5992
+ }
5993
+
5994
+ /* above 1314, where - with a minimum width of 250px and 16px gap - 5 columns would appear, we restrict it to max 4 columns */
5995
+
5996
+ @container (min-inline-size: 1314px) {
5997
+
5998
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- {
5999
+ --minimum-width: calc((100% - 3 * var(--space-16)) / 4);
6000
+
6001
+ grid-template-columns: repeat(
6002
+ auto-fit,
6003
+ minmax(var(--minimum-width), 1fr)
6004
+ )
6005
+ }
6006
+ }
6007
+
6008
+ /* info icon rules: when (visually) the last segment on a row with an icon, needs to have a negative margin */
6009
+
6010
+ .sign-in-form-module-EoTYu .sign-in-form-module-TumIz:has([data-info]) {
6011
+ margin-inline-end: var(--info-icon-offset);
6012
+ }
6013
+
6014
+ /* 2 * 250px + 16px = 516px; space for 2 columns */
6015
+
6016
+ @container (min-inline-size: 516px) {
6017
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):not(:only-child) {
6018
+ margin-inline-end: 0;
6019
+ }
6020
+ }
6021
+
6022
+ @container (min-inline-size: 516px) and (max-inline-size: 781px) {
6023
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(2n) {
6024
+ margin-inline-end: var(--info-icon-offset);
6025
+ }
6026
+ }
6027
+
6028
+ /* 3 * 250px + 2 * 16px = 782px; space for 3 columns */
6029
+
6030
+ @container (min-inline-size: 782px) and (max-inline-size: 1047px) {
6031
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(3n),
6032
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(2):last-child {
6033
+ margin-inline-end: var(--info-icon-offset);
6034
+ }
6035
+ }
6036
+
6037
+ /* 4 * 250px + 3 * 16px = 1048px; space for 4 columns */
6038
+
6039
+ @container (min-inline-size: 1048px) {
6040
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(4n),
6041
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(3):last-child,
6042
+ .sign-in-form-module-EoTYu.sign-in-form-module-9eIx- .sign-in-form-module-TumIz:has([data-info]):nth-child(2):last-child {
6043
+ margin-inline-end: var(--info-icon-offset);
6044
+ }
6045
+ }
6046
+
6047
+ .sign-in-form-module-aYBAy {
6048
+ display: grid;
6049
+ gap: var(--space-16);
6050
+ }
6051
+
5904
6052
  :root {
5905
6053
  --toastify-color-light: #fff;
5906
6054
  --toastify-color-dark: #121212;
@@ -1,9 +1,10 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import { Placement } from 'react-aria';
3
3
  export interface TooltipProps {
4
+ children: ReactNode;
5
+ className?: string;
4
6
  offset?: number;
5
7
  placement?: Placement;
6
- text: string | ReactNode;
7
8
  trigger?: ReactElement;
8
9
  }
9
- export declare function Tooltip({ offset, placement, text, trigger, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function Tooltip({ children, className, offset, placement, trigger, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ import { useRef, useMemo, cloneElement } from 'react';
3
3
  import { usePress } from 'react-aria';
4
4
  import { DialogTrigger, Popover, OverlayArrow, Dialog } from 'react-aria-components';
5
5
  import { IconButton } from '../buttons/icon-button/icon-button.js';
6
+ import clsx from 'clsx';
6
7
  import { StrokeInformationIcon } from '../icons/stroke/stroke-information-icon.js';
7
8
  import { useDisclosure } from '../shared/hooks/use-disclosure.js';
8
9
  import styles from './tooltip.module.css.js';
@@ -10,17 +11,17 @@ import styles from './tooltip.module.css.js';
10
11
  function InfoIcon(props) {
11
12
  return (jsx(IconButton, { ...props, className: styles.trigger, children: jsx(StrokeInformationIcon, {}) }));
12
13
  }
13
- function TriggerButton({ buttonRef, trigger, }) {
14
+ function TriggerButton({ buttonRef, className, trigger, }) {
14
15
  const { pressProps } = usePress({ ref: buttonRef });
15
16
  const triggerWithHandler = useMemo(() => cloneElement(trigger, {
16
17
  ...pressProps,
17
18
  }), [trigger, pressProps]);
18
- return (jsx("div", { ref: buttonRef, className: styles['trigger-wrapper'], children: triggerWithHandler }));
19
+ return (jsx("div", { ref: buttonRef, className: clsx(className, styles['trigger-wrapper']), children: triggerWithHandler }));
19
20
  }
20
- function Tooltip({ offset, placement = 'bottom', text, trigger = jsx(InfoIcon, {}), }) {
21
+ function Tooltip({ children, className, offset, placement = 'bottom', trigger = jsx(InfoIcon, {}), }) {
21
22
  const { isOpen, setIsOpen } = useDisclosure();
22
23
  const triggerRef = useRef(null);
23
- return (jsxs(DialogTrigger, { isOpen: isOpen, onOpenChange: setIsOpen, children: [jsx(TriggerButton, { buttonRef: triggerRef, trigger: trigger }), jsxs(Popover, { className: styles.popover, offset: offset, placement: placement, triggerRef: triggerRef, children: [jsx(OverlayArrow, { className: styles.arrow, children: jsx("svg", { height: 12, viewBox: "0 0 12 12", width: 12, children: jsx("path", { d: "M0 0 L6 6 L12 0" }) }) }), jsx(Dialog, { className: styles.dialog, children: text })] })] }));
24
+ return (jsxs(DialogTrigger, { isOpen: isOpen, onOpenChange: setIsOpen, children: [jsx(TriggerButton, { buttonRef: triggerRef, className: className, trigger: trigger }), jsxs(Popover, { className: styles.popover, offset: offset, placement: placement, triggerRef: triggerRef, children: [jsx(OverlayArrow, { className: styles.arrow, children: jsx("svg", { height: 12, viewBox: "0 0 12 12", width: 12, children: jsx("path", { d: "M0 0 L6 6 L12 0" }) }) }), jsx(Dialog, { className: styles.dialog, children: children })] })] }));
24
25
  }
25
26
 
26
27
  export { Tooltip };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "133.0.0",
3
+ "version": "134.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -1 +0,0 @@
1
- export declare function wait(ms: number): Promise<unknown>;
@@ -1,5 +0,0 @@
1
- function wait(ms) {
2
- return new Promise(resolve => setTimeout(resolve, ms));
3
- }
4
-
5
- export { wait };