@westpac/ui 1.8.0 → 1.9.1

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
1
  import { tv } from 'tailwind-variants';
2
2
  export const styles = tv({
3
3
  slots: {
4
- base: 'relative mb-5 typography-body-10 xsl:flex',
4
+ base: 'relative mb-5 flex typography-body-10',
5
5
  icon: 'float-left flex-none',
6
6
  body: 'relative flex-1 xsl:top-[0.125rem] [&_:focus-visible]:focus-outline [&_a]:underline',
7
7
  heading: 'mb-1 typography-body-9 font-bold',
@@ -2,7 +2,7 @@
2
2
  import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
3
3
  import { Input } from '../index.js';
4
4
  import { styles as passCodeStyles } from './pass-code.styles.js';
5
- export const PassCode = forwardRef(({ length, value, onChange, onComplete, onPasteComplete, className, type = 'alphanumeric', onBlur, oneTimeCode, ...props }, ref)=>{
5
+ export const PassCode = forwardRef(({ length, value, onChange, onComplete, onPasteComplete, className, type = 'alphanumeric', onBlur, oneTimeCode, id, ...props }, ref)=>{
6
6
  const [internalPasscode, setInternalPasscode] = useState(Array.from({
7
7
  length
8
8
  }).map(()=>''));
@@ -144,7 +144,8 @@ export const PassCode = forwardRef(({ length, value, onChange, onComplete, onPas
144
144
  className: styles.input({}),
145
145
  "aria-label": `Passcode digit ${index + 1}`,
146
146
  inputMode: type === 'numbers' ? 'numeric' : 'text',
147
- autoComplete: oneTimeCode ? 'one-time-code' : undefined
147
+ autoComplete: oneTimeCode ? 'one-time-code' : undefined,
148
+ id: id && `${id}-${index + 1}`
148
149
  })));
149
150
  });
150
151
  PassCode.displayName = 'PassCode';
@@ -4619,11 +4619,6 @@
4619
4619
  margin-right: calc(0.375rem * 2);
4620
4620
  }
4621
4621
  }
4622
- .xsl\:flex {
4623
- @media (width >= 576px) {
4624
- display: flex;
4625
- }
4626
- }
4627
4622
  .xsl\:max-w-xsl {
4628
4623
  @media (width >= 576px) {
4629
4624
  max-width: 47.25rem;
@@ -4619,11 +4619,6 @@
4619
4619
  margin-right: calc(0.375rem * 2);
4620
4620
  }
4621
4621
  }
4622
- .xsl\:flex {
4623
- @media (width >= 576px) {
4624
- display: flex;
4625
- }
4626
- }
4627
4622
  .xsl\:max-w-xsl {
4628
4623
  @media (width >= 576px) {
4629
4624
  max-width: 47.25rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westpac/ui",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -253,9 +253,9 @@
253
253
  "typescript": "^5.5.4",
254
254
  "vite": "^7.3.5",
255
255
  "vitest": "^3.2.6",
256
- "@westpac/eslint-config": "~1.1.0",
257
- "@westpac/test-config": "~0.0.0",
258
256
  "@westpac/style-config": "~1.0.2",
257
+ "@westpac/test-config": "~0.0.0",
258
+ "@westpac/eslint-config": "~1.1.0",
259
259
  "@westpac/ts-config": "~0.0.0"
260
260
  },
261
261
  "dependencies": {
@@ -2,7 +2,7 @@ import { tv } from 'tailwind-variants';
2
2
 
3
3
  export const styles = tv({
4
4
  slots: {
5
- base: 'relative mb-5 typography-body-10 xsl:flex',
5
+ base: 'relative mb-5 flex typography-body-10',
6
6
  icon: 'float-left flex-none',
7
7
  body: 'relative flex-1 xsl:top-[0.125rem] [&_:focus-visible]:focus-outline [&_a]:underline',
8
8
  heading: 'mb-1 typography-body-9 font-bold',
@@ -29,6 +29,7 @@ export const PassCode = forwardRef<PassCodeRef, PassCodeProps>(
29
29
  type = 'alphanumeric',
30
30
  onBlur,
31
31
  oneTimeCode,
32
+ id,
32
33
  ...props
33
34
  },
34
35
  ref,
@@ -165,6 +166,7 @@ export const PassCode = forwardRef<PassCodeRef, PassCodeProps>(
165
166
  aria-label={`Passcode digit ${index + 1}`}
166
167
  inputMode={type === 'numbers' ? 'numeric' : 'text'}
167
168
  autoComplete={oneTimeCode ? 'one-time-code' : undefined}
169
+ id={id && `${id}-${index + 1}`}
168
170
  />
169
171
  ))}
170
172
  </div>