@yahoo/uds 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/cli/PropsToClass.mock.tsx +14 -0
  2. package/cli/bin/uds-darwin-arm64-baseline +0 -0
  3. package/cli/bin/uds-linux-arm64 +0 -0
  4. package/cli/bin/uds-linux-x64-baseline +0 -0
  5. package/cli/cli.ts +1 -2
  6. package/cli/utils/auth.ts +39 -202
  7. package/dist/Text-CwmyqrBk.d.cts +243 -0
  8. package/dist/Text-CwmyqrBk.d.ts +243 -0
  9. package/dist/client/index.cjs +2 -2
  10. package/dist/client/index.d.cts +46 -6
  11. package/dist/client/index.d.ts +46 -6
  12. package/dist/client/index.js +3 -3
  13. package/dist/experimental/client/index.cjs +3 -0
  14. package/dist/experimental/client/index.d.cts +146 -0
  15. package/dist/experimental/client/index.d.ts +146 -0
  16. package/dist/experimental/client/index.js +3 -0
  17. package/dist/experimental/index.cjs +2 -2
  18. package/dist/experimental/index.d.cts +5 -387
  19. package/dist/experimental/index.d.ts +5 -387
  20. package/dist/experimental/index.js +1 -2
  21. package/dist/fixtures.cjs +1 -1
  22. package/dist/fixtures.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.cts +4 -42
  25. package/dist/index.d.ts +4 -42
  26. package/dist/index.js +1 -1
  27. package/dist/metafile-cjs.json +1 -1
  28. package/dist/metafile-esm.json +1 -1
  29. package/dist/tailwind/plugin.cjs +2 -2
  30. package/dist/tailwind/plugin.d.cts +1 -1
  31. package/dist/tailwind/plugin.d.ts +1 -1
  32. package/dist/tailwind/plugin.js +2 -2
  33. package/dist/tailwind/purger.cjs +1 -1
  34. package/dist/tailwind/purger.js +1 -1
  35. package/dist/tailwind/utils.d.cts +1 -1
  36. package/dist/tailwind/utils.d.ts +1 -1
  37. package/dist/tokens/index.d.cts +2 -2
  38. package/dist/tokens/index.d.ts +2 -2
  39. package/dist/tokens/parseTokens.d.cts +1 -1
  40. package/dist/tokens/parseTokens.d.ts +1 -1
  41. package/dist/{types-Pyccco5Q.d.cts → types-DsMvZpWN.d.cts} +1 -1
  42. package/dist/{types-Pyccco5Q.d.ts → types-DsMvZpWN.d.ts} +1 -1
  43. package/package.json +13 -6
  44. package/cli/README.md +0 -208
  45. package/cli/utils/client_secrets.json +0 -23
  46. package/cli/utils/client_secrets.json.enc +0 -0
  47. package/cli/utils/secrets.ts +0 -40
@@ -0,0 +1,243 @@
1
+ import { PropsWithChildren, Ref } from 'react';
2
+ import { SvgIcon, IconSize, IconVariant } from '@yahoo/uds-icons/types';
3
+
4
+ declare const alwaysPalette: {
5
+ white: string;
6
+ black: string;
7
+ transparent: string;
8
+ current: string;
9
+ };
10
+
11
+ type CorePaletteAlias = 'brand' | 'accent' | 'alert' | 'positive' | 'warning';
12
+ type BackgroundPaletteAlias = 'primary' | 'secondary';
13
+ type ForegroundPaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted' | 'on-color';
14
+ type LinePaletteAlias = 'primary' | 'secondary' | 'tertiary' | 'muted';
15
+ type AlwaysPalette = typeof alwaysPalette;
16
+ type AlwaysPaletteAlias = keyof AlwaysPalette;
17
+ type ForegroundColor = CorePaletteAlias | ForegroundPaletteAlias | AlwaysPaletteAlias;
18
+ type LineColor = CorePaletteAlias | LinePaletteAlias | AlwaysPaletteAlias;
19
+ type BackgroundColor = CorePaletteAlias | BackgroundPaletteAlias | AlwaysPaletteAlias;
20
+ type TextVariant = 'display1' | 'display2' | 'display3' | 'title1' | 'title2' | 'title3' | 'title4' | 'headline1' | 'body1' | 'label1' | 'label2' | 'caption1' | 'caption2' | 'legal1';
21
+ type FontAlias = 'sans' | 'sans-alt' | 'serif' | 'serif-alt' | 'mono';
22
+ type FontWeightDescriptive = 'thin' | 'extralight' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
23
+ type TextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
24
+ type TShirtSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
25
+ type TShirtSizeCommon = Extract<TShirtSize, 'sm' | 'md' | 'lg'>;
26
+ type AvatarSize = TShirtSizeCommon;
27
+ type SpacingAlias = '0' | 'px' | '0.5' | '1' | '1.5' | '2' | '2.5' | '3' | '3.5' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '14' | '16' | '20' | '24' | '28' | '32' | '36' | '40' | '44' | '48' | '52' | '56' | '60' | '64' | '72' | '80' | '96';
28
+ type BorderRadius = TShirtSize;
29
+ type BorderWidth = 'none' | 'thin' | 'medium' | 'thick';
30
+ type Flex = '1' | 'auto' | 'initial' | 'none';
31
+ type FlexGrow = '0' | '1' | '2' | '3';
32
+ type FlexShrink = '0' | '1';
33
+ type FlexAlignContent = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
34
+ type FlexAlignItems = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
35
+ type FlexAlignSelf = 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
36
+ type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
37
+ type FlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
38
+ type FlexJustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
39
+ type FlexBasis = 'min-content';
40
+ type Display = 'block' | 'inline-block' | 'inline' | 'flex' | 'inline-flex' | 'table' | 'inline-table' | 'table-caption' | 'table-cell' | 'table-column' | 'table-column-group' | 'table-footer-group' | 'table-header-group' | 'table-row-group' | 'table-row' | 'flow-root' | 'grid' | 'contents';
41
+ type Overflow = 'auto' | 'hidden' | 'clip' | 'visible' | 'scroll';
42
+ type Position = 'static' | 'fixed' | 'absolute' | 'relative' | 'sticky';
43
+ type ImageStyleProps = {
44
+ /**
45
+ * Determines how the image should be resized to fit its container.
46
+ */
47
+ contentFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
48
+ };
49
+ interface BorderStyleProps {
50
+ /** Add a border radius to all corners of the box. */
51
+ borderRadius?: BorderRadius;
52
+ /** Add a border radius to top left corner of the box. */
53
+ borderTopStartRadius?: BorderRadius;
54
+ /** Add a border radius to top right corner of the box. */
55
+ borderTopEndRadius?: BorderRadius;
56
+ /** Add a border radius to bottom left corner of the box. */
57
+ borderBottomStartRadius?: BorderRadius;
58
+ /** Add a border radius to bottom right corner of the box. */
59
+ borderBottomEndRadius?: BorderRadius;
60
+ /** Adds a custom border color from the palette */
61
+ borderColor?: LineColor;
62
+ /** Start border color */
63
+ borderStartColor?: LineColor;
64
+ /** End border color */
65
+ borderEndColor?: LineColor;
66
+ /** Top border color */
67
+ borderTopColor?: LineColor;
68
+ /** Bottom border color */
69
+ borderBottomColor?: LineColor;
70
+ /** Shorthand property to the width of an element's border. */
71
+ borderWidth?: BorderWidth;
72
+ /** Sets the width of the top and bottom border of an element. */
73
+ borderVerticalWidth?: BorderWidth;
74
+ /** Sets the width of the start (left) and end (right) border of an element. */
75
+ borderHorizontalWidth?: BorderWidth;
76
+ /** Sets the width of the start (left) border of an element. */
77
+ borderStartWidth?: BorderWidth;
78
+ /** Sets the width of the end (right) border of an element. */
79
+ borderEndWidth?: BorderWidth;
80
+ /** Sets the width of the top border of an element. */
81
+ borderTopWidth?: BorderWidth;
82
+ /** Sets the width of the bottom border of an element. */
83
+ borderBottomWidth?: BorderWidth;
84
+ }
85
+ interface LayoutStyleProps {
86
+ /** Sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
87
+ display?: Display;
88
+ /** Shorthand property which sets the desired behavior when content does not fit in the parent element box (overflows) in the horizontal and/or vertical direction. */
89
+ overflow?: Overflow;
90
+ /** Sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the overflow shorthand property. */
91
+ overflowX?: Overflow;
92
+ /** sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the overflow shorthand property. */
93
+ overflowY?: Overflow;
94
+ /** Sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements. */
95
+ position?: Position;
96
+ }
97
+ interface SpacingStyleProps {
98
+ /** Apply inner spacing on all sides. */
99
+ spacing?: SpacingAlias;
100
+ /** Apply inner spacing on the leading and trailing sides. */
101
+ spacingHorizontal?: SpacingAlias;
102
+ /** Apply inner spacing on the top and bottom sides. */
103
+ spacingVertical?: SpacingAlias;
104
+ /** Apply inner spacing on the bottom side. */
105
+ spacingBottom?: SpacingAlias;
106
+ /** Apply inner spacing on the trailing side. */
107
+ spacingEnd?: SpacingAlias;
108
+ /** Apply inner spacing on the leading side. */
109
+ spacingStart?: SpacingAlias;
110
+ /** Apply inner spacing on the top side. */
111
+ spacingTop?: SpacingAlias;
112
+ /** Apply negative outer spacing on all sides. */
113
+ offset?: SpacingAlias;
114
+ /** Apply negative outer spacing on the top and bottom sides. */
115
+ offsetVertical?: SpacingAlias;
116
+ /** Apply negative outer spacing on the leading and trailing sides. */
117
+ offsetHorizontal?: SpacingAlias;
118
+ /** Apply negative outer spacing on the bottom side. */
119
+ offsetBottom?: SpacingAlias;
120
+ /** Apply negative outer spacing on the trailing side. */
121
+ offsetEnd?: SpacingAlias;
122
+ /** Apply negative outer spacing on the leading side. */
123
+ offsetStart?: SpacingAlias;
124
+ /** Apply negative outer spacing on the top side. */
125
+ offsetTop?: SpacingAlias;
126
+ /** Control the horizontal gutters between grid and flexbox items. */
127
+ columnGap?: SpacingAlias;
128
+ /** Control the vertical gutters between grid and flexbox items. */
129
+ rowGap?: SpacingAlias;
130
+ }
131
+ interface FlexStyleProps {
132
+ /** Sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. */
133
+ alignContent?: FlexAlignContent;
134
+ /** Sets the align-self value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. */
135
+ alignItems?: FlexAlignItems;
136
+ /** Overrides a grid or flex item's align-items value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. */
137
+ alignSelf?: FlexAlignSelf;
138
+ /** Sets how a flex item will grow or shrink to fit the space available in its flex container. */
139
+ flex?: Flex;
140
+ /** Sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed). */
141
+ flexDirection?: FlexDirection;
142
+ /** Sets the flex grow factor, which specifies how much of the flex container's remaining space should be assigned to the flex item's main size. */
143
+ flexGrow?: FlexGrow;
144
+ /** Sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to flex-shrink. */
145
+ flexShrink?: FlexShrink;
146
+ /** Sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. */
147
+ flexWrap?: FlexWrap;
148
+ /** Defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. */
149
+ justifyContent?: FlexJustifyContent;
150
+ /** Sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with box-sizing. https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis */
151
+ flexBasis?: FlexBasis;
152
+ }
153
+ interface TextStyleProps {
154
+ /** Color of a Text or Icon element */
155
+ color?: ForegroundColor;
156
+ /** Color of placeholder text */
157
+ placeholderColor?: ForegroundColor;
158
+ /** Font family for the text */
159
+ fontFamily?: TextVariant | FontAlias;
160
+ /** Font size of the text */
161
+ fontSize?: TextVariant;
162
+ /** Font weight of the text */
163
+ fontWeight?: TextVariant | FontWeightDescriptive;
164
+ /** Line height of the text */
165
+ lineHeight?: TextVariant;
166
+ /** Text alignment of the text */
167
+ textAlign?: 'center' | 'justify' | 'start' | 'end';
168
+ /** Sets the text transform for the text */
169
+ textTransform?: TextVariant | TextTransform;
170
+ }
171
+ interface BackgroundStyleProps {
172
+ /** Sets the background color. */
173
+ backgroundColor?: BackgroundColor;
174
+ }
175
+ interface UniversalBoxProps extends PropsWithChildren, BackgroundStyleProps, BorderStyleProps, FlexStyleProps, LayoutStyleProps, SpacingStyleProps {
176
+ /**
177
+ * When asChild is set to true, the component's child will be cloned and passed
178
+ * the props and behavior required to make it functional.
179
+ */
180
+ asChild?: boolean;
181
+ }
182
+ interface UniversalStackProps extends Omit<UniversalBoxProps, 'flexDirection'> {
183
+ gap?: SpacingAlias;
184
+ }
185
+ interface UniversalTextProps extends PropsWithChildren, TextStyleProps, UniversalBoxProps {
186
+ /** Style of text. */
187
+ variant?: TextVariant;
188
+ /** Color of the text. */
189
+ color?: ForegroundColor;
190
+ }
191
+ interface UniversalIconProps {
192
+ /** Icon to render from the icons package. */
193
+ name: SvgIcon;
194
+ /** Size of the icon. */
195
+ size?: IconSize;
196
+ /** Variant for icon. Either fill or outline. */
197
+ variant?: IconVariant;
198
+ /** Color of the icon. */
199
+ color?: ForegroundColor;
200
+ }
201
+ interface UniversalImageProps extends Omit<UniversalBoxProps, 'width' | 'height'>, ImageStyleProps {
202
+ /** The source URL of the image. */
203
+ src: string;
204
+ /** Provides fallback (alternate) text to display when the image specified by the Image element is not loaded. */
205
+ alt?: string;
206
+ /** Width of the image in px. */
207
+ width?: number;
208
+ /** Height of the image in pixel. */
209
+ height?: number;
210
+ }
211
+ interface UniversalAvatarProps extends UniversalImageProps {
212
+ /** The size of the Avatar. */
213
+ size?: AvatarSize;
214
+ /** The shape of the Avatar. */
215
+ shape?: BorderRadius;
216
+ }
217
+ interface UniversalTextInputProps {
218
+ disabled?: boolean;
219
+ required?: boolean;
220
+ backgroundColor?: BackgroundColor;
221
+ borderColor?: LineColor;
222
+ borderWidth?: BorderWidth;
223
+ borderRadius?: BorderRadius;
224
+ color?: ForegroundColor;
225
+ fontSize?: TextVariant;
226
+ placeholderColor?: ForegroundColor;
227
+ spacingVertical?: SpacingAlias;
228
+ spacingHorizontal?: SpacingAlias;
229
+ }
230
+
231
+ type DivProps = React.HTMLAttributes<HTMLDivElement>;
232
+ interface BoxProps extends UniversalBoxProps, DivProps {
233
+ }
234
+
235
+ type TextElementTagName = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'p' | 'strong' | 'span' | 'label' | 'li';
236
+ type TextProps<TagName extends TextElementTagName = TextElementTagName> = {
237
+ /** Ref passed to the inner container. */
238
+ ref?: Ref<HTMLElement>;
239
+ /** Changes the HTML tag used to render text. Uses the most appropriate semantic tag based on the text style variant. */
240
+ as?: TagName;
241
+ } & JSX.IntrinsicElements[TagName] & UniversalTextProps;
242
+
243
+ export type { BoxProps as B, DivProps as D, Overflow as O, TextProps as T, UniversalAvatarProps as U, UniversalTextProps as a, UniversalIconProps as b, UniversalStackProps as c, UniversalTextInputProps as d };
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";var e=require("../chunk-JGIKFUBH.cjs"),t=require("../chunk-YUHY3FXT.cjs"),n=require("../chunk-DMMTEAJW.cjs"),i=require("../chunk-5WBROFT5.cjs"),a=require("@yahoo/uds/fixtures"),o=require("react/jsx-runtime"),r=require("framer-motion"),s=require("react"),c={scale:.7,opacity:0},l={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},u={icon:l,hide:c,loading:c},d={loading:l,hide:c,icon:c},m=`var(${i.BUTTON_CSS_VAR_MAP.columnGap})`,h=`var(${i.BUTTON_CSS_VAR_MAP.iconSize})`,p={rest:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.rest})`},hover:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.hover})`},pressed:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:m}},g={hide:{width:"0px",opacity:0,display:"none"},loading:{width:h,display:"flex",opacity:1},icon:{width:h,display:"flex",opacity:1}},x=({size:e,variant:t})=>{if("outline"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return o.jsx(o.Fragment,{})},f=()=>import("../motionFeatures-P3FQL2KP.cjs").then((({domAnimation:e})=>e));/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */function v({reducedMotion:e="user",children:i,layoutVariant:a="subtle",layoutSpeed:c="3",colorVariant:l="smooth",colorSpeed:u="3"}){const d=n.motion[a][c],m=n.motion[l][u],[h,p]=s.useState(d),[g,x]=s.useState(m),v={variant:l,speed:u},j=t.getMotionVar({...v,control:"stiffness"}),b=t.getMotionVar({...v,control:"damping"}),S={variant:a,speed:c},y=t.getMotionVar({...S,control:"stiffness"}),M=t.getMotionVar({...S,control:"damping"});s.useEffect((()=>{const e=getComputedStyle(document.documentElement),t={damping:Number(e.getPropertyValue(M)),stiffness:Number(e.getPropertyValue(y))},n={damping:Number(e.getPropertyValue(b)),stiffness:Number(e.getPropertyValue(j))};p(t),x(n)}),[b,j,M,y]);const I=s.useMemo((()=>({type:"spring",mass:1,...h,layout:h,opacity:g,color:g,borderColor:g,backgroundColor:g})),[g,h]);return o.jsx(r.LazyMotion,{features:f,strict:!0,children:o.jsx(r.MotionConfig,{transition:I,reducedMotion:e,children:i})})}var j=e.createSlot(),b=r.m.create(j),S=s.forwardRef((function({palette:t,variant:n,size:i,startIcon:c,endIcon:l,iconVariant:m,loading:h,disableEffects:f,children:j,asChild:S,className:y,...M},I){const N=s.useRef(null);s.useImperativeHandle(I,(()=>N.current));const C=l?"icon":"hide",w=(({startIcon:e,endIcon:t,loading:n})=>e||t||n?"withIcon":"withoutIcon")({startIcon:c,endIcon:l,loading:h}),V=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:h,startIcon:c}),A={button:e.getStyles({buttonSize:i,buttonVariant:n,buttonPalette:t,className:e.cx("uds-button","uds-ring","uds-hit-target",h&&"uds-button-loading",f&&"uds-button-without-effects","withIcon"===w&&"uds-button-with-gap",y)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},z=r.useReducedMotion()?"smooth":"subtle",P=s.useMemo((()=>o.jsx(r.m.span,{className:A.iconContainer,initial:!1,variants:g,animate:V,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[h&&o.jsx(r.m.span,{variants:d,initial:"hide",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:x,variant:m,color:"current",className:A.loading})},"loading"),c&&!h&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:c,variant:m,color:"current",className:A.start})},c.name)]})})),[A.iconContainer,A.loading,A.start,V,h,m,c]),T=s.useMemo((()=>o.jsx(r.m.span,{className:A.iconContainer,initial:!1,variants:g,animate:C,children:o.jsx(r.AnimatePresence,{initial:!1,mode:"popLayout",children:l&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:l,variant:m,color:"current",className:A.start})},l.name)})})),[A.iconContainer,A.start,l,C,m]),_=s.useMemo((()=>f?{...p,rest:{},hover:{},pressed:{}}:p),[f]);return S&&s.isValidElement(j)?o.jsx(v,{layoutSpeed:"3",layoutVariant:z,children:o.jsx(b,{className:A.button,initial:["hide",w],animate:w,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:s.cloneElement(j,j.props,o.jsxs(o.Fragment,{children:[P,o.jsx("span",{className:A.content,children:j.props.children}),T]}))})}):o.jsx(v,{layoutSpeed:"3",layoutVariant:z,children:o.jsxs(r.m.button,{ref:N,className:A.button,initial:["hide",w],animate:w,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:[P,o.jsx("span",{className:A.content,children:j}),T]})})})),y=s.forwardRef((function({palette:t,variant:n,size:i,iconVariant:c,loading:l,disableEffects:m,name:h,className:g,children:f,...j},b){const S=s.useRef(null);s.useImperativeHandle(b,(()=>S.current));const y=s.useMemo((()=>({button:e.getStyles({buttonVariant:n,buttonPalette:t,iconButtonSize:i,className:e.cx("uds-icon-button","uds-button","uds-ring","uds-hit-target",l&&"uds-button-loading",m&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,n,g,m,i,l]),M=r.useReducedMotion(),I=s.useMemo((()=>M?"smooth":"subtle"),[M]),N=s.useMemo((()=>{const{rest:e,hover:t,pressed:n}=p;return m?{rest:{},hover:{},pressed:{}}:{rest:e,hover:t,pressed:n}}),[m]);return o.jsx(v,{layoutSpeed:"3",layoutVariant:I,reducedMotion:m?"always":"user",children:o.jsx(r.m.button,{ref:S,className:y.button,initial:"icon",variants:N,whileHover:"hover",whileTap:"pressed",...j,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[l&&o.jsx(r.m.span,{variants:d,initial:"loading",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:x,variant:c,color:"current",className:y.loading})},"loading"),h&&!l&&o.jsx(r.m.span,{variants:u,initial:"icon",animate:"icon",exit:"hide",children:f||o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:h,variant:c,color:"current",className:y.icon})},h.name)]})})})}));
3
- /*! © 2025 Yahoo, Inc. UDS v0.0.0-development */exports.Button=S,exports.IconButton=y,exports.SpringMotionConfig=v;
2
+ "use strict";var e=require("../chunk-JGIKFUBH.cjs"),t=require("../chunk-YUHY3FXT.cjs"),o=require("../chunk-DMMTEAJW.cjs"),n=require("../chunk-5WBROFT5.cjs"),r=require("@yahoo/uds/fixtures"),i=require("react/jsx-runtime"),a=require("framer-motion"),s=require("react"),c={scale:.7,opacity:0},l={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},d={icon:l,hide:c,loading:c},u={loading:l,hide:c,icon:c},m=`var(${n.BUTTON_CSS_VAR_MAP.columnGap})`,p=`var(${n.BUTTON_CSS_VAR_MAP.iconSize})`,h={rest:{scale:`var(${n.BUTTON_CSS_VAR_MAP.effects.scale.rest})`},hover:{scale:`var(${n.BUTTON_CSS_VAR_MAP.effects.scale.hover})`},pressed:{scale:`var(${n.BUTTON_CSS_VAR_MAP.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:m}},f={hide:{width:"0px",opacity:0,display:"none"},loading:{width:p,display:"flex",opacity:1},icon:{width:p,display:"flex",opacity:1}},g=({size:e,variant:t})=>{if("outline"===t)switch(e){case"sm":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===t)switch(e){case"sm":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return i.jsx(i.Fragment,{children:i.jsx("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return i.jsx(i.Fragment,{})},b=()=>import("../motionFeatures-P3FQL2KP.cjs").then((({domAnimation:e})=>e));/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */function x({reducedMotion:e="user",children:n,layoutVariant:r="subtle",layoutSpeed:c="3",colorVariant:l="smooth",colorSpeed:d="3"}){const u=o.motion[r][c],m=o.motion[l][d],[p,h]=s.useState(u),[f,g]=s.useState(m),x={variant:l,speed:d},S=t.getMotionVar({...x,control:"stiffness"}),v=t.getMotionVar({...x,control:"damping"}),j={variant:r,speed:c},C=t.getMotionVar({...j,control:"stiffness"}),y=t.getMotionVar({...j,control:"damping"});s.useEffect((()=>{const e=getComputedStyle(document.documentElement),t={damping:Number(e.getPropertyValue(y)),stiffness:Number(e.getPropertyValue(C))},o={damping:Number(e.getPropertyValue(v)),stiffness:Number(e.getPropertyValue(S))};h(t),g(o)}),[v,S,y,C]);const w=s.useMemo((()=>({type:"spring",mass:1,...p,layout:p,opacity:f,color:f,borderColor:f,backgroundColor:f})),[f,p]);return i.jsx(a.LazyMotion,{features:b,strict:!0,children:i.jsx(a.MotionConfig,{transition:w,reducedMotion:e,children:n})})}var S=e.createSlot(),v=a.m.create(S),j=s.forwardRef((function({palette:t,variant:o,size:n,startIcon:c,endIcon:l,iconVariant:m,loading:p,disableEffects:b,children:S,asChild:j,className:C,...y},w){const M=s.useRef(null);s.useImperativeHandle(w,(()=>M.current));const I=l?"icon":"hide",V=(({startIcon:e,endIcon:t,loading:o})=>e||t||o?"withIcon":"withoutIcon")({startIcon:c,endIcon:l,loading:p}),N=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:p,startIcon:c}),T={button:e.getStyles({buttonSize:n,buttonVariant:o,buttonPalette:t,className:e.cx("uds-button","uds-ring","uds-hit-target",p&&"uds-button-loading",b&&"uds-button-without-effects","withIcon"===V&&"uds-button-with-gap",C)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},B=a.useReducedMotion()?"smooth":"subtle",z=s.useMemo((()=>i.jsx(a.m.span,{className:T.iconContainer,initial:!1,variants:f,animate:N,children:i.jsxs(a.AnimatePresence,{initial:!1,mode:"popLayout",children:[p&&i.jsx(a.m.span,{variants:u,initial:"hide",animate:"loading",exit:"hide",children:i.jsx(e.Icon,{size:r.buttonIconSvgSize,name:g,variant:m,color:"current",className:T.loading})},"loading"),c&&!p&&i.jsx(a.m.span,{variants:d,initial:"hide",animate:"icon",exit:"hide",children:i.jsx(e.Icon,{size:r.buttonIconSvgSize,name:c,variant:m,color:"current",className:T.start})},c.name)]})})),[T.iconContainer,T.loading,T.start,N,p,m,c]),R=s.useMemo((()=>i.jsx(a.m.span,{className:T.iconContainer,initial:!1,variants:f,animate:I,children:i.jsx(a.AnimatePresence,{initial:!1,mode:"popLayout",children:l&&i.jsx(a.m.span,{variants:d,initial:"hide",animate:"icon",exit:"hide",children:i.jsx(e.Icon,{size:r.buttonIconSvgSize,name:l,variant:m,color:"current",className:T.start})},l.name)})})),[T.iconContainer,T.start,l,I,m]),E=s.useMemo((()=>b?{...h,rest:{},hover:{},pressed:{}}:h),[b]);return j&&s.isValidElement(S)?i.jsx(x,{layoutSpeed:"3",layoutVariant:B,children:i.jsx(v,{className:T.button,initial:["hide",V],animate:V,variants:E,whileHover:"hover",whileTap:"pressed",...y,children:s.cloneElement(S,S.props,i.jsxs(i.Fragment,{children:[z,i.jsx("span",{className:T.content,children:S.props.children}),R]}))})}):i.jsx(x,{layoutSpeed:"3",layoutVariant:B,children:i.jsxs(a.m.button,{ref:M,className:T.button,initial:["hide",V],animate:V,variants:E,whileHover:"hover",whileTap:"pressed",...y,children:[z,i.jsx("span",{className:T.content,children:S}),R]})})})),C=s.forwardRef((function({palette:t,variant:o,size:n,iconVariant:c,loading:l,disableEffects:m,name:p,className:f,children:b,...S},v){const j=s.useRef(null);s.useImperativeHandle(v,(()=>j.current));const C=s.useMemo((()=>({button:e.getStyles({buttonVariant:o,buttonPalette:t,iconButtonSize:n,className:e.cx("uds-icon-button","uds-button","uds-ring","uds-hit-target",l&&"uds-button-loading",m&&"uds-button-without-effects",f)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,o,f,m,n,l]),y=a.useReducedMotion(),w=s.useMemo((()=>y?"smooth":"subtle"),[y]),M=s.useMemo((()=>{const{rest:e,hover:t,pressed:o}=h;return m?{rest:{},hover:{},pressed:{}}:{rest:e,hover:t,pressed:o}}),[m]);return i.jsx(x,{layoutSpeed:"3",layoutVariant:w,reducedMotion:m?"always":"user",children:i.jsx(a.m.button,{ref:j,className:C.button,initial:"icon",variants:M,whileHover:"hover",whileTap:"pressed",...S,children:i.jsxs(a.AnimatePresence,{initial:!1,mode:"popLayout",children:[l&&i.jsx(a.m.span,{variants:u,initial:"loading",animate:"loading",exit:"hide",children:i.jsx(e.Icon,{size:r.buttonIconSvgSize,name:g,variant:c,color:"current",className:C.loading})},"loading"),p&&!l&&i.jsx(a.m.span,{variants:d,initial:"icon",animate:"icon",exit:"hide",children:b||i.jsx(e.Icon,{size:r.buttonIconSvgSize,name:p,variant:c,color:"current",className:C.icon})},p.name)]})})})})),y=e.createSlot(),w=s.forwardRef((function({className:t,asChild:o,onPress:n,onClick:r=n,backgroundColor:a,borderRadius:s,borderTopStartRadius:c,borderTopEndRadius:l,borderBottomStartRadius:d,borderBottomEndRadius:u,borderColor:m,borderStartColor:p,borderEndColor:h,borderTopColor:f,borderBottomColor:g,borderWidth:b,borderVerticalWidth:x,borderHorizontalWidth:S,borderStartWidth:v,borderEndWidth:j,borderTopWidth:C,borderBottomWidth:w,alignContent:M,alignItems:I,alignSelf:V,flex:N,flexDirection:T,flexGrow:B,flexShrink:z,flexWrap:R,justifyContent:E,flexBasis:A,display:P,overflow:W,overflowX:_,overflowY:F,position:H,spacing:k,spacingHorizontal:G,spacingVertical:q,spacingBottom:U,spacingEnd:O,spacingStart:L,spacingTop:$,offset:Y,offsetVertical:D,offsetHorizontal:X,offsetBottom:J,offsetEnd:K,offsetStart:Q,offsetTop:Z,columnGap:ee,rowGap:te,...oe},ne){const re=e.getStyles({backgroundColor:a,borderRadius:s,borderTopStartRadius:c,borderTopEndRadius:l,borderBottomStartRadius:d,borderBottomEndRadius:u,borderColor:m,borderStartColor:p,borderEndColor:h,borderTopColor:f,borderBottomColor:g,borderWidth:b,borderVerticalWidth:x,borderHorizontalWidth:S,borderStartWidth:v,borderEndWidth:j,borderTopWidth:C,borderBottomWidth:w,alignContent:M,alignItems:I,alignSelf:V,flex:N,flexDirection:T,flexGrow:B,flexShrink:z,flexWrap:R,justifyContent:E,flexBasis:A,display:P,overflow:W,overflowX:_,overflowY:F,position:H,spacing:k,spacingHorizontal:G,spacingVertical:q,spacingBottom:U,spacingEnd:O,spacingStart:L,spacingTop:$,offset:Y,offsetVertical:D,offsetHorizontal:X,offsetBottom:J,offsetEnd:K,offsetStart:Q,offsetTop:Z,columnGap:ee,rowGap:te,className:t}),ie=o?y:"button";return i.jsx(ie,{className:re,ref:ne,onClick:r,...oe})}));
3
+ /*! © 2025 Yahoo, Inc. UDS v0.0.0-development */exports.Button=j,exports.IconButton=C,exports.Pressable=w,exports.SpringMotionConfig=x;
@@ -1,12 +1,12 @@
1
- import { e as UniversalButtonProps, f as UniversalIconButtonProps, M as MotionVariant, g as MotionVariantSpeed } from '../types-Pyccco5Q.cjs';
1
+ import { e as UniversalButtonProps, f as UniversalIconButtonProps, g as UniversalPressableProps, M as MotionVariant, h as MotionVariantSpeed } from '../types-DsMvZpWN.cjs';
2
2
  import { HTMLMotionProps, MotionConfigProps } from 'framer-motion';
3
3
  import * as react from 'react';
4
4
  import react__default from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import '@yahoo/uds-icons/types';
7
7
 
8
- type HtmlButtonProps$1 = Omit<HTMLMotionProps<'button'>, 'color' | 'name'> & Omit<react__default.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
9
- interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
8
+ type HtmlButtonProps$2 = Omit<HTMLMotionProps<'button'>, 'color' | 'name'> & Omit<react__default.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
9
+ interface ButtonProps extends HtmlButtonProps$2, UniversalButtonProps {
10
10
  }
11
11
  /**
12
12
  * **🖲️ A button element that can be used to trigger an action**
@@ -42,8 +42,8 @@ interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
42
42
  **/
43
43
  declare const Button: react__default.ForwardRefExoticComponent<ButtonProps & react__default.RefAttributes<HTMLButtonElement>>;
44
44
 
45
- type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
46
- interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
45
+ type HtmlButtonProps$1 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
46
+ interface IconButtonProps extends HtmlButtonProps$1, UniversalIconButtonProps {
47
47
  }
48
48
  /**
49
49
  * **⚙️️ An icon button element that can be used to trigger an action**
@@ -77,6 +77,46 @@ interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
77
77
  **/
78
78
  declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
79
79
 
80
+ type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
81
+ interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
82
+ }
83
+ /**
84
+ * **🖲️ A primitive component for creating button interactions with accessibility support**
85
+ *
86
+ * @type Client component
87
+ *
88
+ * @description
89
+ * The Pressable component is a primitive component that can be used
90
+ * to create button interactions with accessibility support. It can be used
91
+ * to trigger an action, such as submitting a form, navigating to a new page,
92
+ * or adding interactivity to a section or card.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * import { Pressable } from '@yahoo/uds';
97
+ *
98
+ * <Pressable
99
+ * backgroundColor="secondary"
100
+ * borderWidth="thin"
101
+ * borderColor="primary"
102
+ * borderRadius="lg"
103
+ * onPress={() => console.log('Pressed!')}
104
+ * >
105
+ * <Text variant="body1" color="primary" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
106
+ * </Pressable>
107
+ * ```
108
+ *
109
+ * @usage
110
+ * - If you need to add interactivity to a section or card.
111
+ * - If you need a highly customized version of [Button](./button)
112
+ *
113
+ * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
114
+ *
115
+ * @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
116
+ *
117
+ */
118
+ declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
119
+
80
120
  interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | 'reducedMotion'> {
81
121
  layoutVariant?: MotionVariant;
82
122
  layoutSpeed?: MotionVariantSpeed;
@@ -94,4 +134,4 @@ interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | '
94
134
  */
95
135
  declare function SpringMotionConfig({ reducedMotion, children, layoutVariant, layoutSpeed, colorVariant, colorSpeed, }: SpringMotionConfigProps): react_jsx_runtime.JSX.Element;
96
136
 
97
- export { Button, type ButtonProps, IconButton, type IconButtonProps, SpringMotionConfig, type SpringMotionConfigProps };
137
+ export { Button, type ButtonProps, IconButton, type IconButtonProps, Pressable, type PressableProps, SpringMotionConfig, type SpringMotionConfigProps };
@@ -1,12 +1,12 @@
1
- import { e as UniversalButtonProps, f as UniversalIconButtonProps, M as MotionVariant, g as MotionVariantSpeed } from '../types-Pyccco5Q.js';
1
+ import { e as UniversalButtonProps, f as UniversalIconButtonProps, g as UniversalPressableProps, M as MotionVariant, h as MotionVariantSpeed } from '../types-DsMvZpWN.js';
2
2
  import { HTMLMotionProps, MotionConfigProps } from 'framer-motion';
3
3
  import * as react from 'react';
4
4
  import react__default from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import '@yahoo/uds-icons/types';
7
7
 
8
- type HtmlButtonProps$1 = Omit<HTMLMotionProps<'button'>, 'color' | 'name'> & Omit<react__default.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
9
- interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
8
+ type HtmlButtonProps$2 = Omit<HTMLMotionProps<'button'>, 'color' | 'name'> & Omit<react__default.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>;
9
+ interface ButtonProps extends HtmlButtonProps$2, UniversalButtonProps {
10
10
  }
11
11
  /**
12
12
  * **🖲️ A button element that can be used to trigger an action**
@@ -42,8 +42,8 @@ interface ButtonProps extends HtmlButtonProps$1, UniversalButtonProps {
42
42
  **/
43
43
  declare const Button: react__default.ForwardRefExoticComponent<ButtonProps & react__default.RefAttributes<HTMLButtonElement>>;
44
44
 
45
- type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
46
- interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
45
+ type HtmlButtonProps$1 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'> & Omit<HTMLMotionProps<'button'>, 'name'>;
46
+ interface IconButtonProps extends HtmlButtonProps$1, UniversalIconButtonProps {
47
47
  }
48
48
  /**
49
49
  * **⚙️️ An icon button element that can be used to trigger an action**
@@ -77,6 +77,46 @@ interface IconButtonProps extends HtmlButtonProps, UniversalIconButtonProps {
77
77
  **/
78
78
  declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
79
79
 
80
+ type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
81
+ interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
82
+ }
83
+ /**
84
+ * **🖲️ A primitive component for creating button interactions with accessibility support**
85
+ *
86
+ * @type Client component
87
+ *
88
+ * @description
89
+ * The Pressable component is a primitive component that can be used
90
+ * to create button interactions with accessibility support. It can be used
91
+ * to trigger an action, such as submitting a form, navigating to a new page,
92
+ * or adding interactivity to a section or card.
93
+ *
94
+ * @example
95
+ * ```tsx
96
+ * import { Pressable } from '@yahoo/uds';
97
+ *
98
+ * <Pressable
99
+ * backgroundColor="secondary"
100
+ * borderWidth="thin"
101
+ * borderColor="primary"
102
+ * borderRadius="lg"
103
+ * onPress={() => console.log('Pressed!')}
104
+ * >
105
+ * <Text variant="body1" color="primary" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
106
+ * </Pressable>
107
+ * ```
108
+ *
109
+ * @usage
110
+ * - If you need to add interactivity to a section or card.
111
+ * - If you need a highly customized version of [Button](./button)
112
+ *
113
+ * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
114
+ *
115
+ * @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
116
+ *
117
+ */
118
+ declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
119
+
80
120
  interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | 'reducedMotion'> {
81
121
  layoutVariant?: MotionVariant;
82
122
  layoutSpeed?: MotionVariantSpeed;
@@ -94,4 +134,4 @@ interface SpringMotionConfigProps extends Pick<MotionConfigProps, 'children' | '
94
134
  */
95
135
  declare function SpringMotionConfig({ reducedMotion, children, layoutVariant, layoutSpeed, colorVariant, colorSpeed, }: SpringMotionConfigProps): react_jsx_runtime.JSX.Element;
96
136
 
97
- export { Button, type ButtonProps, IconButton, type IconButtonProps, SpringMotionConfig, type SpringMotionConfigProps };
137
+ export { Button, type ButtonProps, IconButton, type IconButtonProps, Pressable, type PressableProps, SpringMotionConfig, type SpringMotionConfigProps };
@@ -1,4 +1,4 @@
1
1
  "use client";
2
- import{createSlot as t,getStyles as n,cx as e,Icon as i}from"../chunk-P5B5IOMM.js";import{getMotionVar as a}from"../chunk-ZV62SW5G.js";import{motion as o}from"../chunk-3PK6DOFO.js";import{BUTTON_CSS_VAR_MAP as r}from"../chunk-PE2P7J44.js";import{buttonIconSvgSize as s}from"@yahoo/uds/fixtures";import{jsx as c,jsxs as l,Fragment as d}from"react/jsx-runtime";import{m as u,useReducedMotion as h,AnimatePresence as m,LazyMotion as p,MotionConfig as f}from"framer-motion";import{forwardRef as g,useRef as v,useImperativeHandle as b,useMemo as y,isValidElement as w,cloneElement as N,useState as C,useEffect as S}from"react";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
3
- var I={scale:.7,opacity:0},V={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},x={icon:V,hide:I,loading:I},z={loading:V,hide:I,icon:I},M=`var(${r.columnGap})`,P=`var(${r.iconSize})`,j={rest:{scale:`var(${r.effects.scale.rest})`},hover:{scale:`var(${r.effects.scale.hover})`},pressed:{scale:`var(${r.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:M}},k={hide:{width:"0px",opacity:0,display:"none"},loading:{width:P,display:"flex",opacity:1},icon:{width:P,display:"flex",opacity:1}},$=({size:t,variant:n})=>{if("outline"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return c(d,{})},A=()=>import("../motionFeatures-I76FFCTS.js").then((({domAnimation:t})=>t));function E({reducedMotion:t="user",children:n,layoutVariant:e="subtle",layoutSpeed:i="3",colorVariant:r="smooth",colorSpeed:s="3"}){const l=o[e][i],d=o[r][s],[u,h]=C(l),[m,g]=C(d),v={variant:r,speed:s},b=a({...v,control:"stiffness"}),w=a({...v,control:"damping"}),N={variant:e,speed:i},I=a({...N,control:"stiffness"}),V=a({...N,control:"damping"});S((()=>{const t=getComputedStyle(document.documentElement),n={damping:Number(t.getPropertyValue(V)),stiffness:Number(t.getPropertyValue(I))},e={damping:Number(t.getPropertyValue(w)),stiffness:Number(t.getPropertyValue(b))};h(n),g(e)}),[w,b,V,I]);const x=y((()=>({type:"spring",mass:1,...u,layout:u,opacity:m,color:m,borderColor:m,backgroundColor:m})),[m,u]);return c(p,{features:A,strict:!0,children:c(f,{transition:x,reducedMotion:t,children:n})})}var F=t(),G=u.create(F),T=g((function({palette:t,variant:a,size:o,startIcon:r,endIcon:p,iconVariant:f,loading:g,disableEffects:C,children:S,asChild:I,className:V,...M},P){const A=v(null);b(P,(()=>A.current));const F=p?"icon":"hide",T=(({startIcon:t,endIcon:n,loading:e})=>t||n||e?"withIcon":"withoutIcon")({startIcon:r,endIcon:p,loading:g}),H=(({loading:t,startIcon:n})=>t?"loading":n?"icon":"hide")({loading:g,startIcon:r}),L={button:n({buttonSize:o,buttonVariant:a,buttonPalette:t,className:e("uds-button","uds-ring","uds-hit-target",g&&"uds-button-loading",C&&"uds-button-without-effects","withIcon"===T&&"uds-button-with-gap",V)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},O=h()?"smooth":"subtle",B=y((()=>c(u.span,{className:L.iconContainer,initial:!1,variants:k,animate:H,children:l(m,{initial:!1,mode:"popLayout",children:[g&&c(u.span,{variants:z,initial:"hide",animate:"loading",exit:"hide",children:c(i,{size:s,name:$,variant:f,color:"current",className:L.loading})},"loading"),r&&!g&&c(u.span,{variants:x,initial:"hide",animate:"icon",exit:"hide",children:c(i,{size:s,name:r,variant:f,color:"current",className:L.start})},r.name)]})})),[L.iconContainer,L.loading,L.start,H,g,f,r]),D=y((()=>c(u.span,{className:L.iconContainer,initial:!1,variants:k,animate:F,children:c(m,{initial:!1,mode:"popLayout",children:p&&c(u.span,{variants:x,initial:"hide",animate:"icon",exit:"hide",children:c(i,{size:s,name:p,variant:f,color:"current",className:L.start})},p.name)})})),[L.iconContainer,L.start,p,F,f]),J=y((()=>C?{...j,rest:{},hover:{},pressed:{}}:j),[C]);return I&&w(S)?c(E,{layoutSpeed:"3",layoutVariant:O,children:c(G,{className:L.button,initial:["hide",T],animate:T,variants:J,whileHover:"hover",whileTap:"pressed",...M,children:N(S,S.props,l(d,{children:[B,c("span",{className:L.content,children:S.props.children}),D]}))})}):c(E,{layoutSpeed:"3",layoutVariant:O,children:l(u.button,{ref:A,className:L.button,initial:["hide",T],animate:T,variants:J,whileHover:"hover",whileTap:"pressed",...M,children:[B,c("span",{className:L.content,children:S}),D]})})})),H=g((function({palette:t,variant:a,size:o,iconVariant:r,loading:d,disableEffects:p,name:f,className:g,children:w,...N},C){const S=v(null);b(C,(()=>S.current));const I=y((()=>({button:n({buttonVariant:a,buttonPalette:t,iconButtonSize:o,className:e("uds-icon-button","uds-button","uds-ring","uds-hit-target",d&&"uds-button-loading",p&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,a,g,p,o,d]),V=h(),M=y((()=>V?"smooth":"subtle"),[V]),P=y((()=>{const{rest:t,hover:n,pressed:e}=j;return p?{rest:{},hover:{},pressed:{}}:{rest:t,hover:n,pressed:e}}),[p]);return c(E,{layoutSpeed:"3",layoutVariant:M,reducedMotion:p?"always":"user",children:c(u.button,{ref:S,className:I.button,initial:"icon",variants:P,whileHover:"hover",whileTap:"pressed",...N,children:l(m,{initial:!1,mode:"popLayout",children:[d&&c(u.span,{variants:z,initial:"loading",animate:"loading",exit:"hide",children:c(i,{size:s,name:$,variant:r,color:"current",className:I.loading})},"loading"),f&&!d&&c(u.span,{variants:x,initial:"icon",animate:"icon",exit:"hide",children:w||c(i,{size:s,name:f,variant:r,color:"current",className:I.icon})},f.name)]})})})}));
4
- /*! © 2025 Yahoo, Inc. UDS v0.0.0-development */export{T as Button,H as IconButton,E as SpringMotionConfig};
2
+ import{createSlot as t,getStyles as o,cx as e,Icon as n}from"../chunk-P5B5IOMM.js";import{getMotionVar as r}from"../chunk-ZV62SW5G.js";import{motion as i}from"../chunk-3PK6DOFO.js";import{BUTTON_CSS_VAR_MAP as a}from"../chunk-PE2P7J44.js";import{buttonIconSvgSize as s}from"@yahoo/uds/fixtures";import{jsx as l,jsxs as d,Fragment as c}from"react/jsx-runtime";import{m as u,useReducedMotion as p,AnimatePresence as h,LazyMotion as m,MotionConfig as f}from"framer-motion";import{forwardRef as b,useRef as g,useImperativeHandle as v,useMemo as C,isValidElement as y,cloneElement as S,useState as w,useEffect as x}from"react";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
3
+ var N={scale:.7,opacity:0},V={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},z={icon:V,hide:N,loading:N},I={loading:V,hide:N,icon:N},W=`var(${a.columnGap})`,B=`var(${a.iconSize})`,E={rest:{scale:`var(${a.effects.scale.rest})`},hover:{scale:`var(${a.effects.scale.hover})`},pressed:{scale:`var(${a.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:W}},T={hide:{width:"0px",opacity:0,display:"none"},loading:{width:B,display:"flex",opacity:1},icon:{width:B,display:"flex",opacity:1}},k=({size:t,variant:o})=>{if("outline"===o)switch(t){case"sm":return l(c,{children:l("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return l(c,{children:l("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return l(c,{children:l("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===o)switch(t){case"sm":return l(c,{children:l("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return l(c,{children:l("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return l(c,{children:l("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return l(c,{})},M=()=>import("../motionFeatures-I76FFCTS.js").then((({domAnimation:t})=>t));function P({reducedMotion:t="user",children:o,layoutVariant:e="subtle",layoutSpeed:n="3",colorVariant:a="smooth",colorSpeed:s="3"}){const d=i[e][n],c=i[a][s],[u,p]=w(d),[h,b]=w(c),g={variant:a,speed:s},v=r({...g,control:"stiffness"}),y=r({...g,control:"damping"}),S={variant:e,speed:n},N=r({...S,control:"stiffness"}),V=r({...S,control:"damping"});x((()=>{const t=getComputedStyle(document.documentElement),o={damping:Number(t.getPropertyValue(V)),stiffness:Number(t.getPropertyValue(N))},e={damping:Number(t.getPropertyValue(y)),stiffness:Number(t.getPropertyValue(v))};p(o),b(e)}),[y,v,V,N]);const z=C((()=>({type:"spring",mass:1,...u,layout:u,opacity:h,color:h,borderColor:h,backgroundColor:h})),[h,u]);return l(m,{features:M,strict:!0,children:l(f,{transition:z,reducedMotion:t,children:o})})}var G=t(),R=u.create(G),H=b((function({palette:t,variant:r,size:i,startIcon:a,endIcon:m,iconVariant:f,loading:b,disableEffects:w,children:x,asChild:N,className:V,...W},B){const M=g(null);v(B,(()=>M.current));const G=m?"icon":"hide",H=(({startIcon:t,endIcon:o,loading:e})=>t||o||e?"withIcon":"withoutIcon")({startIcon:a,endIcon:m,loading:b}),j=(({loading:t,startIcon:o})=>t?"loading":o?"icon":"hide")({loading:b,startIcon:a}),$={button:o({buttonSize:i,buttonVariant:r,buttonPalette:t,className:e("uds-button","uds-ring","uds-hit-target",b&&"uds-button-loading",w&&"uds-button-without-effects","withIcon"===H&&"uds-button-with-gap",V)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},A=p()?"smooth":"subtle",F=C((()=>l(u.span,{className:$.iconContainer,initial:!1,variants:T,animate:j,children:d(h,{initial:!1,mode:"popLayout",children:[b&&l(u.span,{variants:I,initial:"hide",animate:"loading",exit:"hide",children:l(n,{size:s,name:k,variant:f,color:"current",className:$.loading})},"loading"),a&&!b&&l(u.span,{variants:z,initial:"hide",animate:"icon",exit:"hide",children:l(n,{size:s,name:a,variant:f,color:"current",className:$.start})},a.name)]})})),[$.iconContainer,$.loading,$.start,j,b,f,a]),D=C((()=>l(u.span,{className:$.iconContainer,initial:!1,variants:T,animate:G,children:l(h,{initial:!1,mode:"popLayout",children:m&&l(u.span,{variants:z,initial:"hide",animate:"icon",exit:"hide",children:l(n,{size:s,name:m,variant:f,color:"current",className:$.start})},m.name)})})),[$.iconContainer,$.start,m,G,f]),L=C((()=>w?{...E,rest:{},hover:{},pressed:{}}:E),[w]);return N&&y(x)?l(P,{layoutSpeed:"3",layoutVariant:A,children:l(R,{className:$.button,initial:["hide",H],animate:H,variants:L,whileHover:"hover",whileTap:"pressed",...W,children:S(x,x.props,d(c,{children:[F,l("span",{className:$.content,children:x.props.children}),D]}))})}):l(P,{layoutSpeed:"3",layoutVariant:A,children:d(u.button,{ref:M,className:$.button,initial:["hide",H],animate:H,variants:L,whileHover:"hover",whileTap:"pressed",...W,children:[F,l("span",{className:$.content,children:x}),D]})})})),j=b((function({palette:t,variant:r,size:i,iconVariant:a,loading:c,disableEffects:m,name:f,className:b,children:y,...S},w){const x=g(null);v(w,(()=>x.current));const N=C((()=>({button:o({buttonVariant:r,buttonPalette:t,iconButtonSize:i,className:e("uds-icon-button","uds-button","uds-ring","uds-hit-target",c&&"uds-button-loading",m&&"uds-button-without-effects",b)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,r,b,m,i,c]),V=p(),W=C((()=>V?"smooth":"subtle"),[V]),B=C((()=>{const{rest:t,hover:o,pressed:e}=E;return m?{rest:{},hover:{},pressed:{}}:{rest:t,hover:o,pressed:e}}),[m]);return l(P,{layoutSpeed:"3",layoutVariant:W,reducedMotion:m?"always":"user",children:l(u.button,{ref:x,className:N.button,initial:"icon",variants:B,whileHover:"hover",whileTap:"pressed",...S,children:d(h,{initial:!1,mode:"popLayout",children:[c&&l(u.span,{variants:I,initial:"loading",animate:"loading",exit:"hide",children:l(n,{size:s,name:k,variant:a,color:"current",className:N.loading})},"loading"),f&&!c&&l(u.span,{variants:z,initial:"icon",animate:"icon",exit:"hide",children:y||l(n,{size:s,name:f,variant:a,color:"current",className:N.icon})},f.name)]})})})})),$=t(),A=b((function({className:t,asChild:e,onPress:n,onClick:r=n,backgroundColor:i,borderRadius:a,borderTopStartRadius:s,borderTopEndRadius:d,borderBottomStartRadius:c,borderBottomEndRadius:u,borderColor:p,borderStartColor:h,borderEndColor:m,borderTopColor:f,borderBottomColor:b,borderWidth:g,borderVerticalWidth:v,borderHorizontalWidth:C,borderStartWidth:y,borderEndWidth:S,borderTopWidth:w,borderBottomWidth:x,alignContent:N,alignItems:V,alignSelf:z,flex:I,flexDirection:W,flexGrow:B,flexShrink:E,flexWrap:T,justifyContent:k,flexBasis:M,display:P,overflow:G,overflowX:R,overflowY:H,position:j,spacing:A,spacingHorizontal:F,spacingVertical:D,spacingBottom:L,spacingEnd:O,spacingStart:X,spacingTop:Y,offset:J,offsetVertical:K,offsetHorizontal:Z,offsetBottom:q,offsetEnd:Q,offsetStart:U,offsetTop:_,columnGap:tt,rowGap:ot,...et},nt){const rt=o({backgroundColor:i,borderRadius:a,borderTopStartRadius:s,borderTopEndRadius:d,borderBottomStartRadius:c,borderBottomEndRadius:u,borderColor:p,borderStartColor:h,borderEndColor:m,borderTopColor:f,borderBottomColor:b,borderWidth:g,borderVerticalWidth:v,borderHorizontalWidth:C,borderStartWidth:y,borderEndWidth:S,borderTopWidth:w,borderBottomWidth:x,alignContent:N,alignItems:V,alignSelf:z,flex:I,flexDirection:W,flexGrow:B,flexShrink:E,flexWrap:T,justifyContent:k,flexBasis:M,display:P,overflow:G,overflowX:R,overflowY:H,position:j,spacing:A,spacingHorizontal:F,spacingVertical:D,spacingBottom:L,spacingEnd:O,spacingStart:X,spacingTop:Y,offset:J,offsetVertical:K,offsetHorizontal:Z,offsetBottom:q,offsetEnd:Q,offsetStart:U,offsetTop:_,columnGap:tt,rowGap:ot,className:t});return l(e?$:"button",{className:rt,ref:nt,onClick:r,...et})}));
4
+ /*! © 2025 Yahoo, Inc. UDS v0.0.0-development */export{H as Button,j as IconButton,A as Pressable,P as SpringMotionConfig};