@descope/flow-components 3.27.1 → 3.27.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.
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.27.1",
8
+ "buildVersion": "3.27.2",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.27.1",
8
+ "buildVersion": "3.27.2",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
package/dist/index.cjs.js CHANGED
@@ -83604,7 +83604,7 @@ function requireIndex_cjs () {
83604
83604
  padding: 0;
83605
83605
  }
83606
83606
  `,
83607
- excludeAttrsSync: ['tabindex', 'class', 'style'],
83607
+ excludeAttrsSync: ['tabindex', 'class', 'style', 'role'],
83608
83608
  componentName: componentName$1u,
83609
83609
  }),
83610
83610
  );
@@ -92153,6 +92153,10 @@ function requireIndex_cjs () {
92153
92153
  this,
92154
92154
  );
92155
92155
 
92156
+ // vaadin links the target via aria-describedby to its sr-label, which lives in our shadow root,
92157
+ // so a slotted target would reference an ID from another DOM tree.
92158
+ this.tooltip.ariaTarget = this.anchored;
92159
+
92156
92160
  this.defaultSlot.addEventListener('slotchange', () =>
92157
92161
  this.#setTooltipTarget(),
92158
92162
  );
@@ -102269,6 +102273,7 @@ descope-enriched-text {
102269
102273
  tabindex="-1"
102270
102274
  slot="input"
102271
102275
  role="textbox"
102276
+ aria-label="passcode"
102272
102277
  ><slot></slot></${componentName$F}>
102273
102278
  `;
102274
102279
 
@@ -105226,7 +105231,7 @@ descope-enriched-text {
105226
105231
  </div>
105227
105232
  <div class="description"></div>
105228
105233
  <div class="button-wrapper">
105229
- <input type="file" tabindex="-1" aria-labelledby="button"/>
105234
+ <input type="file" tabindex="-1" aria-hidden="true"/>
105230
105235
  <descope-button id="button"></descope-button>
105231
105236
  </div>
105232
105237
  </div>
@@ -114173,12 +114178,19 @@ const Tooltip = React__default.default.forwardRef(({ text, hideDelay = 0, hoverD
114173
114178
 
114174
114179
  const Button = React__default.default.forwardRef(({
114175
114180
  // Button props
114176
- children, startIcon, startIconDark, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName,
114181
+ children, startIcon, startIconDark, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName, ariaLabel,
114177
114182
  // Tooltip props
114178
114183
  hasTooltip, tooltipText, tooltipPosition, tooltipHoverDelay, tooltipHideDelay, tooltipOpened, tooltipReadOnly, ...props }, ref) => {
114179
114184
  const isSquare = React.useMemo(() => !!(startIcon && !children), [startIcon, children]);
114185
+ const tooltipLabel = tooltipText?.trim();
114186
+ const fallbackLabel = isSquare &&
114187
+ hasTooltip &&
114188
+ tooltipLabel &&
114189
+ !/[*_`~[\]<>#\\]/.test(tooltipLabel)
114190
+ ? tooltipLabel
114191
+ : undefined;
114180
114192
  return (React__default.default.createElement(Tooltip, { text: hasTooltip ? tooltipText : undefined, position: tooltipPosition, hoverDelay: tooltipHoverDelay, hideDelay: tooltipHideDelay, opened: tooltipOpened, readonly: tooltipReadOnly },
114181
- React__default.default.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName },
114193
+ React__default.default.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName, "aria-label": ariaLabel || props['aria-label'] || fallbackLabel },
114182
114194
  startIcon != null && (React__default.default.createElement(Icon, { "data-name": `${dataName}-icon`, icon: startIcon, "src-dark": startIconDark, noColor: startIconColorText })),
114183
114195
  children)));
114184
114196
  });
package/dist/index.d.ts CHANGED
@@ -196,6 +196,7 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
196
196
  startIconColorText?: boolean;
197
197
  'full-width'?: boolean;
198
198
  'data-name'?: string;
199
+ ariaLabel?: string;
199
200
  } & ITooltip, "ref"> & React.RefAttributes<HTMLButtonElement>>;
200
201
 
201
202
  type Props$R = {
package/dist/index.esm.js CHANGED
@@ -167,12 +167,19 @@ const Tooltip = React.forwardRef(({ text, hideDelay = 0, hoverDelay = 0, childre
167
167
 
168
168
  const Button = React.forwardRef(({
169
169
  // Button props
170
- children, startIcon, startIconDark, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName,
170
+ children, startIcon, startIconDark, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName, ariaLabel,
171
171
  // Tooltip props
172
172
  hasTooltip, tooltipText, tooltipPosition, tooltipHoverDelay, tooltipHideDelay, tooltipOpened, tooltipReadOnly, ...props }, ref) => {
173
173
  const isSquare = useMemo(() => !!(startIcon && !children), [startIcon, children]);
174
+ const tooltipLabel = tooltipText?.trim();
175
+ const fallbackLabel = isSquare &&
176
+ hasTooltip &&
177
+ tooltipLabel &&
178
+ !/[*_`~[\]<>#\\]/.test(tooltipLabel)
179
+ ? tooltipLabel
180
+ : undefined;
174
181
  return (React.createElement(Tooltip, { text: hasTooltip ? tooltipText : undefined, position: tooltipPosition, hoverDelay: tooltipHoverDelay, hideDelay: tooltipHideDelay, opened: tooltipOpened, readonly: tooltipReadOnly },
175
- React.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName },
182
+ React.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName, "aria-label": ariaLabel || props['aria-label'] || fallbackLabel },
176
183
  startIcon != null && (React.createElement(Icon, { "data-name": `${dataName}-icon`, icon: startIcon, "src-dark": startIconDark, noColor: startIconColorText })),
177
184
  children)));
178
185
  });
@@ -22,5 +22,6 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
22
22
  startIconColorText?: boolean;
23
23
  'full-width'?: boolean;
24
24
  'data-name'?: string;
25
+ ariaLabel?: string;
25
26
  } & ITooltip, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
27
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "3.27.1",
3
+ "version": "3.27.2",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -98,7 +98,7 @@
98
98
  "webpack-subresource-integrity": "5.2.0-rc.1"
99
99
  },
100
100
  "dependencies": {
101
- "@descope/web-components-ui": "3.27.1"
101
+ "@descope/web-components-ui": "3.27.2"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "react": ">= 18"