@number10/jsx-components 5.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.
- package/LICENSE +667 -0
- package/README.md +43 -0
- package/dist/Accordion.cjs +1 -0
- package/dist/Accordion.d.ts +43 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +71 -0
- package/dist/Accordion.test.d.ts +2 -0
- package/dist/Accordion.test.d.ts.map +1 -0
- package/dist/ActivityIndicator.cjs +1 -0
- package/dist/ActivityIndicator.d.ts +21 -0
- package/dist/ActivityIndicator.d.ts.map +1 -0
- package/dist/ActivityIndicator.js +133 -0
- package/dist/AlertDialog.cjs +1 -0
- package/dist/AlertDialog.d.ts +53 -0
- package/dist/AlertDialog.d.ts.map +1 -0
- package/dist/AlertDialog.js +76 -0
- package/dist/Badge.cjs +1 -0
- package/dist/Badge.d.ts +96 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +238 -0
- package/dist/Badge.test.d.ts +2 -0
- package/dist/Badge.test.d.ts.map +1 -0
- package/dist/BottomSheet.cjs +1 -0
- package/dist/BottomSheet.d.ts +72 -0
- package/dist/BottomSheet.d.ts.map +1 -0
- package/dist/BottomSheet.js +132 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.d.ts +61 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +251 -0
- package/dist/Checkbox.cjs +1 -0
- package/dist/Checkbox.d.ts +40 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +84 -0
- package/dist/Checkbox.test.d.ts +2 -0
- package/dist/Checkbox.test.d.ts.map +1 -0
- package/dist/ColorPicker.cjs +1 -0
- package/dist/ColorPicker.d.ts +48 -0
- package/dist/ColorPicker.d.ts.map +1 -0
- package/dist/ColorPicker.js +256 -0
- package/dist/DebugPanel.cjs +1 -0
- package/dist/DebugPanel.d.ts +63 -0
- package/dist/DebugPanel.d.ts.map +1 -0
- package/dist/DebugPanel.js +116 -0
- package/dist/Dialog.cjs +1 -0
- package/dist/Dialog.d.ts +59 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +142 -0
- package/dist/Divider.cjs +1 -0
- package/dist/Divider.d.ts +19 -0
- package/dist/Divider.d.ts.map +1 -0
- package/dist/Divider.js +15 -0
- package/dist/Divider.test.d.ts +2 -0
- package/dist/Divider.test.d.ts.map +1 -0
- package/dist/Dropdown.cjs +1 -0
- package/dist/Dropdown.d.ts +35 -0
- package/dist/Dropdown.d.ts.map +1 -0
- package/dist/Dropdown.js +222 -0
- package/dist/Icon.cjs +1 -0
- package/dist/Icon.d.ts +71 -0
- package/dist/Icon.d.ts.map +1 -0
- package/dist/Icon.js +57 -0
- package/dist/Icon.test.d.ts +2 -0
- package/dist/Icon.test.d.ts.map +1 -0
- package/dist/Image.cjs +1 -0
- package/dist/Image.d.ts +10 -0
- package/dist/Image.d.ts.map +1 -0
- package/dist/Image.js +18 -0
- package/dist/Joystick.cjs +1 -0
- package/dist/Joystick.d.ts +32 -0
- package/dist/Joystick.d.ts.map +1 -0
- package/dist/Joystick.js +185 -0
- package/dist/ListBox.cjs +1 -0
- package/dist/ListBox.d.ts +67 -0
- package/dist/ListBox.d.ts.map +1 -0
- package/dist/ListBox.js +104 -0
- package/dist/ListBox.test.d.ts +2 -0
- package/dist/ListBox.test.d.ts.map +1 -0
- package/dist/MenuButton.cjs +1 -0
- package/dist/MenuButton.d.ts +33 -0
- package/dist/MenuButton.d.ts.map +1 -0
- package/dist/MenuButton.js +63 -0
- package/dist/Modal.cjs +1 -0
- package/dist/Modal.d.ts +27 -0
- package/dist/Modal.d.ts.map +1 -0
- package/dist/Modal.js +174 -0
- package/dist/Modal.test.d.ts +2 -0
- package/dist/Modal.test.d.ts.map +1 -0
- package/dist/NineSlice.cjs +1 -0
- package/dist/NineSlice.d.ts +40 -0
- package/dist/NineSlice.d.ts.map +1 -0
- package/dist/NineSlice.js +314 -0
- package/dist/NineSlice.props.test.d.ts +2 -0
- package/dist/NineSlice.props.test.d.ts.map +1 -0
- package/dist/NineSlice.test.d.ts +2 -0
- package/dist/NineSlice.test.d.ts.map +1 -0
- package/dist/NineSliceButton.cjs +1 -0
- package/dist/NineSliceButton.d.ts +94 -0
- package/dist/NineSliceButton.d.ts.map +1 -0
- package/dist/NineSliceButton.js +61 -0
- package/dist/NineSliceButton.test.d.ts +2 -0
- package/dist/NineSliceButton.test.d.ts.map +1 -0
- package/dist/NumberInput.cjs +1 -0
- package/dist/NumberInput.d.ts +90 -0
- package/dist/NumberInput.d.ts.map +1 -0
- package/dist/NumberInput.js +222 -0
- package/dist/NumberInput.test.d.ts +2 -0
- package/dist/NumberInput.test.d.ts.map +1 -0
- package/dist/PalettePicker.cjs +1 -0
- package/dist/PalettePicker.d.ts +49 -0
- package/dist/PalettePicker.d.ts.map +1 -0
- package/dist/PalettePicker.js +152 -0
- package/dist/PalettePicker.test.d.ts +2 -0
- package/dist/PalettePicker.test.d.ts.map +1 -0
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.d.ts +95 -0
- package/dist/Popover.d.ts.map +1 -0
- package/dist/Popover.js +267 -0
- package/dist/Portal.cjs +1 -0
- package/dist/Portal.d.ts +30 -0
- package/dist/Portal.d.ts.map +1 -0
- package/dist/Portal.js +64 -0
- package/dist/Portal.test.d.ts +2 -0
- package/dist/Portal.test.d.ts.map +1 -0
- package/dist/ProgressBar.cjs +1 -0
- package/dist/ProgressBar.d.ts +61 -0
- package/dist/ProgressBar.d.ts.map +1 -0
- package/dist/ProgressBar.js +80 -0
- package/dist/ProgressBar.test.d.ts +2 -0
- package/dist/ProgressBar.test.d.ts.map +1 -0
- package/dist/ProgressView.cjs +1 -0
- package/dist/ProgressView.d.ts +37 -0
- package/dist/ProgressView.d.ts.map +1 -0
- package/dist/ProgressView.js +71 -0
- package/dist/RadioButton.cjs +1 -0
- package/dist/RadioButton.d.ts +21 -0
- package/dist/RadioButton.d.ts.map +1 -0
- package/dist/RadioButton.js +53 -0
- package/dist/RadioGroup.cjs +1 -0
- package/dist/RadioGroup.d.ts +26 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +32 -0
- package/dist/RatingBar.cjs +1 -0
- package/dist/RatingBar.d.ts +24 -0
- package/dist/RatingBar.d.ts.map +1 -0
- package/dist/RatingBar.js +84 -0
- package/dist/ScrollSlider.cjs +1 -0
- package/dist/ScrollSlider.d.ts +48 -0
- package/dist/ScrollSlider.d.ts.map +1 -0
- package/dist/ScrollSlider.js +93 -0
- package/dist/ScrollView.cjs +1 -0
- package/dist/ScrollView.d.ts +121 -0
- package/dist/ScrollView.d.ts.map +1 -0
- package/dist/ScrollView.js +541 -0
- package/dist/ScrollView.test.d.ts +2 -0
- package/dist/ScrollView.test.d.ts.map +1 -0
- package/dist/SegmentedControl.cjs +1 -0
- package/dist/SegmentedControl.d.ts +50 -0
- package/dist/SegmentedControl.d.ts.map +1 -0
- package/dist/SegmentedControl.js +201 -0
- package/dist/SegmentedControl.test.d.ts +2 -0
- package/dist/SegmentedControl.test.d.ts.map +1 -0
- package/dist/Sidebar.cjs +1 -0
- package/dist/Sidebar.d.ts +36 -0
- package/dist/Sidebar.d.ts.map +1 -0
- package/dist/Sidebar.js +122 -0
- package/dist/Slider.cjs +1 -0
- package/dist/Slider.d.ts +80 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.js +233 -0
- package/dist/Tabs.cjs +1 -0
- package/dist/Tabs.d.ts +23 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.js +101 -0
- package/dist/TextInput.cjs +17 -0
- package/dist/TextInput.d.ts +82 -0
- package/dist/TextInput.d.ts.map +1 -0
- package/dist/TextInput.js +441 -0
- package/dist/Toast.cjs +1 -0
- package/dist/Toast.d.ts +66 -0
- package/dist/Toast.d.ts.map +1 -0
- package/dist/Toast.js +188 -0
- package/dist/Toast.test.d.ts +2 -0
- package/dist/Toast.test.d.ts.map +1 -0
- package/dist/Toggle.cjs +1 -0
- package/dist/Toggle.d.ts +14 -0
- package/dist/Toggle.d.ts.map +1 -0
- package/dist/Toggle.js +135 -0
- package/dist/Toolbar.cjs +1 -0
- package/dist/Toolbar.d.ts +129 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/Toolbar.js +159 -0
- package/dist/Toolbar.test.d.ts +2 -0
- package/dist/Toolbar.test.d.ts.map +1 -0
- package/dist/TransformOriginView.cjs +1 -0
- package/dist/TransformOriginView.d.ts +8 -0
- package/dist/TransformOriginView.d.ts.map +1 -0
- package/dist/TransformOriginView.js +38 -0
- package/dist/WheelPicker.cjs +1 -0
- package/dist/WheelPicker.d.ts +58 -0
- package/dist/WheelPicker.d.ts.map +1 -0
- package/dist/WheelPicker.js +167 -0
- package/dist/WrapText.cjs +1 -0
- package/dist/WrapText.d.ts +83 -0
- package/dist/WrapText.d.ts.map +1 -0
- package/dist/WrapText.js +93 -0
- package/dist/WrapText.test.d.ts +2 -0
- package/dist/WrapText.test.d.ts.map +1 -0
- package/dist/contrast-slot-map.d.ts +33 -0
- package/dist/contrast-slot-map.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/primitives/Image.cjs +1 -0
- package/dist/primitives/Image.d.ts +11 -0
- package/dist/primitives/Image.d.ts.map +1 -0
- package/dist/primitives/Image.js +7 -0
- package/dist/primitives/Sprite.cjs +1 -0
- package/dist/primitives/Sprite.d.ts +11 -0
- package/dist/primitives/Sprite.d.ts.map +1 -0
- package/dist/primitives/Sprite.js +7 -0
- package/dist/primitives/Text.cjs +1 -0
- package/dist/primitives/Text.d.ts +14 -0
- package/dist/primitives/Text.d.ts.map +1 -0
- package/dist/primitives/Text.js +15 -0
- package/dist/primitives/VectorDrawContent.cjs +1 -0
- package/dist/primitives/VectorDrawContent.d.ts +3 -0
- package/dist/primitives/VectorDrawContent.d.ts.map +1 -0
- package/dist/primitives/VectorDrawContent.js +7 -0
- package/dist/primitives/View.cjs +1 -0
- package/dist/primitives/View.d.ts +13 -0
- package/dist/primitives/View.d.ts.map +1 -0
- package/dist/primitives/View.js +7 -0
- package/dist/primitives/index.d.ts +13 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/primitives.test.d.ts +2 -0
- package/dist/primitives/primitives.test.d.ts.map +1 -0
- package/dist/primitives.cjs +1 -0
- package/dist/primitives.d.ts +2 -0
- package/dist/primitives.js +6 -0
- package/dist/theme-defaults.cjs +1 -0
- package/dist/theme-defaults.d.ts +12 -0
- package/dist/theme-defaults.d.ts.map +1 -0
- package/dist/theme-defaults.js +1288 -0
- package/dist/theme-defaults.test.d.ts +2 -0
- package/dist/theme-defaults.test.d.ts.map +1 -0
- package/dist/theme-types.cjs +0 -0
- package/dist/theme-types.d.ts +708 -0
- package/dist/theme-types.d.ts.map +1 -0
- package/dist/theme-types.js +0 -0
- package/dist/useOverlayPresence.cjs +1 -0
- package/dist/useOverlayPresence.d.ts +24 -0
- package/dist/useOverlayPresence.d.ts.map +1 -0
- package/dist/useOverlayPresence.js +19 -0
- package/package.json +83 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewPrimitivePropsComplete, VNodeLike } from '@number10/jsx-core';
|
|
2
|
+
export interface TransformOriginViewProps extends Omit<ViewPrimitivePropsComplete, 'children'> {
|
|
3
|
+
originX?: number;
|
|
4
|
+
originY?: number;
|
|
5
|
+
children?: VNodeLike;
|
|
6
|
+
}
|
|
7
|
+
export declare function TransformOriginView({ originX, originY, width, height, x, y, children, rotation, scale, scaleX, scaleY, backgroundColor, backgroundAlpha, cornerRadius, borderWidth, borderColor, borderAlpha, ...outerViewProps }: TransformOriginViewProps): VNodeLike;
|
|
8
|
+
//# sourceMappingURL=TransformOriginView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransformOriginView.d.ts","sourceRoot":"","sources":["../src/TransformOriginView.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG/E,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAa,EACb,OAAa,EACb,KAAK,EACL,MAAM,EACN,CAAK,EACL,CAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,GAAG,cAAc,EAClB,EAAE,wBAAwB,GAAG,SAAS,CAqDtC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { View as e } from "./primitives/View.js";
|
|
2
|
+
import "./primitives.js";
|
|
3
|
+
import { jsx as t } from "@number10/jsx-core/jsx-runtime";
|
|
4
|
+
//#region src/TransformOriginView.tsx
|
|
5
|
+
function n({ originX: n = .5, originY: r = .5, width: i, height: a, x: o = 0, y: s = 0, children: c, rotation: l, scale: u, scaleX: d, scaleY: f, backgroundColor: p, backgroundAlpha: m, cornerRadius: h, borderWidth: g, borderColor: _, borderAlpha: v, ...y }) {
|
|
6
|
+
if (typeof i != "number" || typeof a != "number") throw Error("TransformOriginView requires numeric width and height");
|
|
7
|
+
let b = i * n, x = a * r, S = {};
|
|
8
|
+
return l !== void 0 && (S.rotation = l), u !== void 0 && (S.scale = u), d !== void 0 && (S.scaleX = d), f !== void 0 && (S.scaleY = f), p !== void 0 && (S.backgroundColor = p), m !== void 0 && (S.backgroundAlpha = m), h !== void 0 && (S.cornerRadius = h), g !== void 0 && (S.borderWidth = g), _ !== void 0 && (S.borderColor = _), v !== void 0 && (S.borderAlpha = v), /* @__PURE__ */ t(e, {
|
|
9
|
+
x: o,
|
|
10
|
+
y: s,
|
|
11
|
+
width: i,
|
|
12
|
+
height: a,
|
|
13
|
+
padding: 0,
|
|
14
|
+
direction: "stack",
|
|
15
|
+
...y,
|
|
16
|
+
children: /* @__PURE__ */ t(e, {
|
|
17
|
+
x: b,
|
|
18
|
+
y: x,
|
|
19
|
+
width: i,
|
|
20
|
+
height: a,
|
|
21
|
+
padding: 0,
|
|
22
|
+
direction: "stack",
|
|
23
|
+
...S,
|
|
24
|
+
children: /* @__PURE__ */ t(e, {
|
|
25
|
+
x: -b,
|
|
26
|
+
y: -x,
|
|
27
|
+
width: i,
|
|
28
|
+
height: a,
|
|
29
|
+
padding: 0,
|
|
30
|
+
direction: "stack",
|
|
31
|
+
backgroundAlpha: 0,
|
|
32
|
+
children: c
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as TransformOriginView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./primitives/Text.cjs`),t=require(`./primitives/View.cjs`);require(`./primitives.cjs`);const n=require(`./ScrollView.cjs`);let r=require(`@number10/jsx-core`),i=require(`@number10/jsx-core/jsx-runtime`);function a(e,t){if(t!==void 0)return e.find(e=>e.value===t)}function o(...e){let t=Object.assign({},...e.filter(Boolean));return Object.keys(t).length>0?t:void 0}function s(e){switch(e){case`small`:return{itemHeight:30,textFontSize:`13px`,selectedTextFontSize:`14px`};case`large`:return{itemHeight:52,textFontSize:`20px`,selectedTextFontSize:`22px`};default:return{itemHeight:40,textFontSize:`16px`,selectedTextFontSize:`18px`}}}function c(c){let{items:l,value:u,defaultValue:d,onChange:f,visibleItems:p=5,size:m,renderItem:h,labels:g,disabled:_=!1,theme:v,alpha:y,width:b}=c,x=(0,r.useTheme)(),S=v?(0,r.mergeThemes)(x??{},v):x,{props:C,nestedTheme:w}=(0,r.resolveComponentTheme)({componentName:`WheelPicker`,globalTheme:(0,r.getGlobalThemeDefaults)(),localTheme:S,knownComponents:r.KNOWN_COMPONENTS}),T=s(m??C.size??`medium`),E=C.itemHeight??T.itemHeight,D=p*E,O=Math.floor(p/2),k=u!==void 0,A=u??d??l[0]?.value??``,[j,M]=(0,r.useState)(A);(0,r.useEffect)(()=>{k&&M(u??``)},[k,u]);let N=k?u??``:j,P={...C.labels??{},...g??{}},F=o({fontSize:T.textFontSize,...C.textColor?{color:C.textColor}:{}},C.textStyle),I=F,L=o(F,C.disabledTextStyle),R=O*E,z=(0,r.useMemo)(()=>l.map((e,t)=>R+t*E),[l,R,E]),B=(0,r.useMemo)(()=>l.findIndex(e=>e.value===A),[l,A]),V=(0,r.useRef)(!1),H=(0,r.useMemo)(()=>l.findIndex(e=>e.value===N),[l,N]),U=(0,r.useRef)(k?N:void 0),[W,G]=(0,r.useState)(void 0),K=(0,r.useMemo)(()=>{if(W!==void 0)return{snapIndex:W};if(!V.current)return V.current=!0,{snapIndex:B>=0?B:0};if(k&&N!==U.current)return U.current=N,{snapIndex:H>=0?H:0};U.current=k?N:void 0},[W,B,k,N,H]),q=(e,t)=>{let n=a(l,e);!n||n.disabled||_||(t!==void 0&&G(t),k||M(e),f?.(e))},J=e=>{G(void 0);let t=l[e];t&&!t.disabled&&!_&&(k||M(t.value),f?.(t.value))},Y=(n,r)=>{let a=n.value===N,o=_||!!n.disabled,s=o?L:a?I:F,c=h?.({item:n,selected:a,disabled:o,index:r,distanceFromCenter:0,...s?{textStyle:s}:{}});return(0,i.jsx)(t.View,{width:`fill`,height:E,direction:`row`,alignItems:`center`,justifyContent:`center`,padding:C.itemPadding,enableGestures:!o,onTouch:()=>q(n.value,r),children:c??(0,i.jsx)(e.Text,{text:n.label,...s?{style:s}:{}})},n.value)},X=_?C.disabledAlpha??.5:y,Z=P.empty??`No items`;return(0,i.jsx)(t.View,{width:b??`fill`,height:D,overflow:`hidden`,cornerRadius:C.cornerRadius??8,backgroundColor:C.backgroundColor,backgroundAlpha:C.backgroundAlpha,borderColor:C.borderColor,borderWidth:C.borderWidth,direction:`stack`,...X===void 0?{}:{alpha:X},theme:w,children:l.length===0?(0,i.jsx)(t.View,{width:`fill`,height:`fill`,alignItems:`center`,justifyContent:`center`,children:(0,i.jsx)(e.Text,{text:Z,...F?{style:F}:{}})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.ScrollView,{width:`fill`,height:`fill`,showVerticalSlider:!1,showHorizontalSlider:!1,momentum:!0,...K?{scroll:K}:{},snap:{positions:z,threshold:E},snapAlignment:`center`,onSnap:J,theme:w,children:[(0,i.jsx)(t.View,{width:`fill`,height:R}),(0,i.jsx)(t.View,{direction:`column`,width:`fill`,theme:w,children:l.map(Y)}),(0,i.jsx)(t.View,{width:`fill`,height:R})]}),(0,i.jsx)(t.View,{width:`fill`,height:O*E,backgroundColor:C.backgroundColor??0,backgroundAlpha:C.overlayAlpha??.85,y:0}),(0,i.jsx)(t.View,{width:`fill`,height:O*E,backgroundColor:C.backgroundColor??0,backgroundAlpha:C.overlayAlpha??.85,y:D-O*E})]})})}exports.WheelPicker=c;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PortableTextStyle, SizeValue, VNodeLike } from '@number10/jsx-core';
|
|
2
|
+
import { PortableComponentPartialTheme } from './theme-types';
|
|
3
|
+
export interface WheelPickerLabels {
|
|
4
|
+
empty?: string;
|
|
5
|
+
}
|
|
6
|
+
export type WheelPickerSize = 'small' | 'medium' | 'large';
|
|
7
|
+
export interface WheelPickerItem {
|
|
8
|
+
/** Unique item value used for selection. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Visible label. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Disabled items cannot be selected. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface WheelPickerItemRenderProps {
|
|
16
|
+
item: WheelPickerItem;
|
|
17
|
+
selected: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
index: number;
|
|
20
|
+
/** 0 = center, 1 = far edge. */
|
|
21
|
+
distanceFromCenter: number;
|
|
22
|
+
textStyle?: PortableTextStyle;
|
|
23
|
+
}
|
|
24
|
+
export interface WheelPickerProps {
|
|
25
|
+
/** Available items. */
|
|
26
|
+
items: WheelPickerItem[];
|
|
27
|
+
/** Selected value in controlled mode. */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Initial selected value in uncontrolled mode. */
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
/** Called when the snapped item changes. */
|
|
32
|
+
onChange?: (value: string) => void;
|
|
33
|
+
/** Number of items visible at once (odd numbers look best: 3, 5, 7). */
|
|
34
|
+
visibleItems?: number;
|
|
35
|
+
/** Size preset controlling item height and text sizing. */
|
|
36
|
+
size?: WheelPickerSize;
|
|
37
|
+
/** Loop items infinitely. */
|
|
38
|
+
loop?: boolean;
|
|
39
|
+
/** Render custom item content. */
|
|
40
|
+
renderItem?: (props: WheelPickerItemRenderProps) => VNodeLike;
|
|
41
|
+
/** Localized labels. */
|
|
42
|
+
labels?: WheelPickerLabels;
|
|
43
|
+
/** Disabled state. */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Theme overrides. */
|
|
46
|
+
theme?: PortableComponentPartialTheme<'WheelPicker'>;
|
|
47
|
+
/** Width override. */
|
|
48
|
+
width?: SizeValue;
|
|
49
|
+
/** Alpha override. */
|
|
50
|
+
alpha?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* WheelPicker — scrollable snap-to-center picker with fade edges.
|
|
54
|
+
* @param props - The component props.
|
|
55
|
+
* @returns The rendered VNode tree.
|
|
56
|
+
*/
|
|
57
|
+
export declare function WheelPicker(props: WheelPickerProps): VNodeLike;
|
|
58
|
+
//# sourceMappingURL=WheelPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WheelPicker.d.ts","sourceRoot":"","sources":["../src/WheelPicker.tsx"],"names":[],"mappings":"AAAA,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,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uBAAuB;IACvB,KAAK,CAAC,EAAE,6BAA6B,CAAC,aAAa,CAAC,CAAA;IACpD,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAoDD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAoO9D"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Text as e } from "./primitives/Text.js";
|
|
2
|
+
import { View as t } from "./primitives/View.js";
|
|
3
|
+
import "./primitives.js";
|
|
4
|
+
import { ScrollView as n } from "./ScrollView.js";
|
|
5
|
+
import { KNOWN_COMPONENTS as r, getGlobalThemeDefaults as i, mergeThemes as a, resolveComponentTheme as o, useEffect as s, useMemo as c, useRef as l, useState as u, useTheme as d } from "@number10/jsx-core";
|
|
6
|
+
import { Fragment as f, jsx as p, jsxs as m } from "@number10/jsx-core/jsx-runtime";
|
|
7
|
+
//#region src/WheelPicker.tsx
|
|
8
|
+
function ee(e, t) {
|
|
9
|
+
if (t !== void 0) return e.find((e) => e.value === t);
|
|
10
|
+
}
|
|
11
|
+
function h(...e) {
|
|
12
|
+
let t = Object.assign({}, ...e.filter(Boolean));
|
|
13
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
14
|
+
}
|
|
15
|
+
function g(e) {
|
|
16
|
+
switch (e) {
|
|
17
|
+
case "small": return {
|
|
18
|
+
itemHeight: 30,
|
|
19
|
+
textFontSize: "13px",
|
|
20
|
+
selectedTextFontSize: "14px"
|
|
21
|
+
};
|
|
22
|
+
case "large": return {
|
|
23
|
+
itemHeight: 52,
|
|
24
|
+
textFontSize: "20px",
|
|
25
|
+
selectedTextFontSize: "22px"
|
|
26
|
+
};
|
|
27
|
+
default: return {
|
|
28
|
+
itemHeight: 40,
|
|
29
|
+
textFontSize: "16px",
|
|
30
|
+
selectedTextFontSize: "18px"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function _(_) {
|
|
35
|
+
let { items: v, value: y, defaultValue: b, onChange: x, visibleItems: S = 5, size: C, renderItem: w, labels: te, disabled: T = !1, theme: E, alpha: D, width: O } = _, k = d(), ne = E ? a(k ?? {}, E) : k, { props: A, nestedTheme: j } = o({
|
|
36
|
+
componentName: "WheelPicker",
|
|
37
|
+
globalTheme: i(),
|
|
38
|
+
localTheme: ne,
|
|
39
|
+
knownComponents: r
|
|
40
|
+
}), M = g(C ?? A.size ?? "medium"), N = A.itemHeight ?? M.itemHeight, P = S * N, F = Math.floor(S / 2), I = y !== void 0, L = y ?? b ?? v[0]?.value ?? "", [re, R] = u(L);
|
|
41
|
+
s(() => {
|
|
42
|
+
I && R(y ?? "");
|
|
43
|
+
}, [I, y]);
|
|
44
|
+
let z = I ? y ?? "" : re, B = {
|
|
45
|
+
...A.labels ?? {},
|
|
46
|
+
...te ?? {}
|
|
47
|
+
}, V = h({
|
|
48
|
+
fontSize: M.textFontSize,
|
|
49
|
+
...A.textColor ? { color: A.textColor } : {}
|
|
50
|
+
}, A.textStyle), H = V, U = h(V, A.disabledTextStyle), W = F * N, G = c(() => v.map((e, t) => W + t * N), [
|
|
51
|
+
v,
|
|
52
|
+
W,
|
|
53
|
+
N
|
|
54
|
+
]), K = c(() => v.findIndex((e) => e.value === L), [v, L]), q = l(!1), J = c(() => v.findIndex((e) => e.value === z), [v, z]), Y = l(I ? z : void 0), [X, Z] = u(void 0), Q = c(() => {
|
|
55
|
+
if (X !== void 0) return { snapIndex: X };
|
|
56
|
+
if (!q.current) return q.current = !0, { snapIndex: K >= 0 ? K : 0 };
|
|
57
|
+
if (I && z !== Y.current) return Y.current = z, { snapIndex: J >= 0 ? J : 0 };
|
|
58
|
+
Y.current = I ? z : void 0;
|
|
59
|
+
}, [
|
|
60
|
+
X,
|
|
61
|
+
K,
|
|
62
|
+
I,
|
|
63
|
+
z,
|
|
64
|
+
J
|
|
65
|
+
]), ie = (e, t) => {
|
|
66
|
+
let n = ee(v, e);
|
|
67
|
+
!n || n.disabled || T || (t !== void 0 && Z(t), I || R(e), x?.(e));
|
|
68
|
+
}, ae = (e) => {
|
|
69
|
+
Z(void 0);
|
|
70
|
+
let t = v[e];
|
|
71
|
+
t && !t.disabled && !T && (I || R(t.value), x?.(t.value));
|
|
72
|
+
}, oe = (n, r) => {
|
|
73
|
+
let i = n.value === z, a = T || !!n.disabled, o = a ? U : i ? H : V, s = w?.({
|
|
74
|
+
item: n,
|
|
75
|
+
selected: i,
|
|
76
|
+
disabled: a,
|
|
77
|
+
index: r,
|
|
78
|
+
distanceFromCenter: 0,
|
|
79
|
+
...o ? { textStyle: o } : {}
|
|
80
|
+
});
|
|
81
|
+
return /* @__PURE__ */ p(t, {
|
|
82
|
+
width: "fill",
|
|
83
|
+
height: N,
|
|
84
|
+
direction: "row",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
justifyContent: "center",
|
|
87
|
+
padding: A.itemPadding,
|
|
88
|
+
enableGestures: !a,
|
|
89
|
+
onTouch: () => ie(n.value, r),
|
|
90
|
+
children: s ?? /* @__PURE__ */ p(e, {
|
|
91
|
+
text: n.label,
|
|
92
|
+
...o ? { style: o } : {}
|
|
93
|
+
})
|
|
94
|
+
}, n.value);
|
|
95
|
+
}, $ = T ? A.disabledAlpha ?? .5 : D, se = B.empty ?? "No items";
|
|
96
|
+
return /* @__PURE__ */ p(t, {
|
|
97
|
+
width: O ?? "fill",
|
|
98
|
+
height: P,
|
|
99
|
+
overflow: "hidden",
|
|
100
|
+
cornerRadius: A.cornerRadius ?? 8,
|
|
101
|
+
backgroundColor: A.backgroundColor,
|
|
102
|
+
backgroundAlpha: A.backgroundAlpha,
|
|
103
|
+
borderColor: A.borderColor,
|
|
104
|
+
borderWidth: A.borderWidth,
|
|
105
|
+
direction: "stack",
|
|
106
|
+
...$ === void 0 ? {} : { alpha: $ },
|
|
107
|
+
theme: j,
|
|
108
|
+
children: v.length === 0 ? /* @__PURE__ */ p(t, {
|
|
109
|
+
width: "fill",
|
|
110
|
+
height: "fill",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
children: /* @__PURE__ */ p(e, {
|
|
114
|
+
text: se,
|
|
115
|
+
...V ? { style: V } : {}
|
|
116
|
+
})
|
|
117
|
+
}) : /* @__PURE__ */ m(f, { children: [
|
|
118
|
+
/* @__PURE__ */ m(n, {
|
|
119
|
+
width: "fill",
|
|
120
|
+
height: "fill",
|
|
121
|
+
showVerticalSlider: !1,
|
|
122
|
+
showHorizontalSlider: !1,
|
|
123
|
+
momentum: !0,
|
|
124
|
+
...Q ? { scroll: Q } : {},
|
|
125
|
+
snap: {
|
|
126
|
+
positions: G,
|
|
127
|
+
threshold: N
|
|
128
|
+
},
|
|
129
|
+
snapAlignment: "center",
|
|
130
|
+
onSnap: ae,
|
|
131
|
+
theme: j,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ p(t, {
|
|
134
|
+
width: "fill",
|
|
135
|
+
height: W
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ p(t, {
|
|
138
|
+
direction: "column",
|
|
139
|
+
width: "fill",
|
|
140
|
+
theme: j,
|
|
141
|
+
children: v.map(oe)
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ p(t, {
|
|
144
|
+
width: "fill",
|
|
145
|
+
height: W
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ p(t, {
|
|
150
|
+
width: "fill",
|
|
151
|
+
height: F * N,
|
|
152
|
+
backgroundColor: A.backgroundColor ?? 0,
|
|
153
|
+
backgroundAlpha: A.overlayAlpha ?? .85,
|
|
154
|
+
y: 0
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ p(t, {
|
|
157
|
+
width: "fill",
|
|
158
|
+
height: F * N,
|
|
159
|
+
backgroundColor: A.backgroundColor ?? 0,
|
|
160
|
+
backgroundAlpha: A.overlayAlpha ?? .85,
|
|
161
|
+
y: P - F * N
|
|
162
|
+
})
|
|
163
|
+
] })
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
export { _ as WheelPicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./primitives/Text.cjs`),t=require(`./primitives/View.cjs`);require(`./primitives.cjs`);let n=require(`@number10/jsx-core`),r=require(`@number10/jsx-core/jsx-runtime`);var i=new Map;function a(e){if(e.__layoutParent&&typeof e.__layoutParent==`object`)return e.__layoutParent;if(e.parent)return e.parent;let t=e.parentContainer;return t&&typeof t==`object`?t:null}function o(e){return e?(e.__getLayoutSize?.()??e.__cachedLayoutSize)?.width??0:0}function s(e){let t=o(e),r=a(e);for(;r;){let e=o(r);if(t<=0&&e>0&&(t=e),r.__layoutProps?.width!==void 0&&e>0){let t=(0,n.normalizePadding)(r.__layoutProps.padding);return Math.max(0,e-t.left-t.right)}r=a(r)}return t}function c(a){let o=(0,n.useTheme)(),{props:c,nestedTheme:l}=(0,n.resolveComponentTheme)({componentName:`WrapText`,globalTheme:(0,n.getGlobalThemeDefaults)(),localTheme:o,knownComponents:n.KNOWN_COMPONENTS}),u=(0,n.useViewportSize)(),d=a.wrap??c.wrap??!0,f=c.paddingOffset??0,p=typeof a.text==`string`?a.text:null,m=null;typeof a.cacheKey==`string`?m=a.cacheKey:typeof a.key==`string`?m=p?`${a.key}::${p}`:a.key:p&&(m=p);let h=m?i.get(m)??0:0,[g,_]=(0,n.useState)(h),v=(0,n.useRef)(h),y=(0,n.useRef)(null),b=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{if(!d)return;let t=()=>{let t=s(e);t>0&&t!==v.current&&t!==g&&(v.current=t,m&&i.set(m,t),_(t))};b.current===null&&(b.current=1,n.DeferredLayoutQueue.defer(()=>{b.current=null,t()}))},[m,g,d]),S=(0,n.useCallback)(e=>{let t=e;y.current!==t&&(y.current=t,!(!t||!d||g>0)&&x(t))},[g,x,d]);(0,n.useEffect)(()=>{if(!d||g>0)return;let e=y.current;e&&x(e)},[g,x,d]),(0,n.useLayoutEffect)(()=>{d&&y.current&&(v.current=0,_(0),n.DeferredLayoutQueue.defer(()=>{y.current&&x(y.current)}))},[u.width,u.height]),(0,n.useEffect)(()=>()=>{b.current=null},[]);let C=g>0?g:v.current,w=(0,n.normalizeEdgeInsets)(a.padding),T=(w.left??0)+(w.right??0),E=Math.max(0,(C>f?C-f:0)-T),D={...c.textStyle??{},...a.style??{}},O=d&&E>0,k={};return a.backgroundColor!==void 0&&(k.backgroundColor=a.backgroundColor),a.cornerRadius!==void 0&&(k.cornerRadius=a.cornerRadius),a.borderWidth!==void 0&&(k.borderWidth=a.borderWidth),a.borderColor!==void 0&&(k.borderColor=a.borderColor),a.borderAlpha!==void 0&&(k.borderAlpha=a.borderAlpha),a.enableGestures!==void 0&&(k.enableGestures=a.enableGestures),a.onTouch!==void 0&&(k.onTouch=a.onTouch),a.onTouchOutside!==void 0&&(k.onTouchOutside=a.onTouchOutside),a.onTouchMove!==void 0&&(k.onTouchMove=a.onTouchMove),a.onDoubleTap!==void 0&&(k.onDoubleTap=a.onDoubleTap),a.onLongPress!==void 0&&(k.onLongPress=a.onLongPress),a.onWheel!==void 0&&(k.onWheel=a.onWheel),a.longPressDuration!==void 0&&(k.longPressDuration=a.longPressDuration),a.doubleTapDelay!==void 0&&(k.doubleTapDelay=a.doubleTapDelay),a.maxTouchDuration!==void 0&&(k.maxTouchDuration=a.maxTouchDuration),a.margin!==void 0&&(k.margin=a.margin),a.padding!==void 0&&(k.padding=a.padding),a.visible!==void 0&&(k.visible=a.visible),(0,r.jsx)(t.View,{ref:S,width:`fill`,theme:l,...k,children:(0,r.jsx)(e.Text,{text:a.text,style:D,...O&&{maxWidth:E},...a.alpha!==void 0&&{alpha:a.alpha},...a.x!==void 0&&{x:a.x},...a.y!==void 0&&{y:a.y}})})}exports.WrapText=c;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { EdgeInsets, GestureEventData, LayoutContainer, PortableTextStyle, VNodeLike, WheelEventData } from '@number10/jsx-core';
|
|
2
|
+
/**
|
|
3
|
+
* WrapText component props
|
|
4
|
+
*/
|
|
5
|
+
export interface WrapTextProps {
|
|
6
|
+
/** Unique key for VDOM identification */
|
|
7
|
+
key?: string | undefined;
|
|
8
|
+
/** The text content to display */
|
|
9
|
+
text: string;
|
|
10
|
+
/** Enable/disable automatic wrapping (default: true) */
|
|
11
|
+
wrap?: boolean | undefined;
|
|
12
|
+
/** Optional cache key to persist measured width across remounts */
|
|
13
|
+
cacheKey?: string | undefined;
|
|
14
|
+
/** Text style overrides merged with theme defaults */
|
|
15
|
+
style?: Partial<PortableTextStyle> | undefined;
|
|
16
|
+
/** Passthrough alpha */
|
|
17
|
+
alpha?: number | undefined;
|
|
18
|
+
/** Passthrough x position */
|
|
19
|
+
x?: number | undefined;
|
|
20
|
+
/** Passthrough y position */
|
|
21
|
+
y?: number | undefined;
|
|
22
|
+
/** Background color behind the text */
|
|
23
|
+
backgroundColor?: number | undefined;
|
|
24
|
+
/** Corner radius for the background */
|
|
25
|
+
cornerRadius?: number | undefined;
|
|
26
|
+
/** Border width */
|
|
27
|
+
borderWidth?: number | undefined;
|
|
28
|
+
/** Border color */
|
|
29
|
+
borderColor?: number | undefined;
|
|
30
|
+
/** Border alpha */
|
|
31
|
+
borderAlpha?: number | undefined;
|
|
32
|
+
/** Enable gesture system (required for onTouch etc.) */
|
|
33
|
+
enableGestures?: boolean | undefined;
|
|
34
|
+
/** Called on tap/click */
|
|
35
|
+
onTouch?: ((data: GestureEventData) => void) | undefined;
|
|
36
|
+
/** Called on pointer up outside the target */
|
|
37
|
+
onTouchOutside?: ((data: GestureEventData) => void) | undefined;
|
|
38
|
+
/** Called during pointer movement */
|
|
39
|
+
onTouchMove?: ((data: GestureEventData) => void) | undefined;
|
|
40
|
+
/** Called on double tap/click */
|
|
41
|
+
onDoubleTap?: ((data: GestureEventData) => void) | undefined;
|
|
42
|
+
/** Called on long press */
|
|
43
|
+
onLongPress?: ((data: GestureEventData) => void) | undefined;
|
|
44
|
+
/** Called on mouse wheel over the target */
|
|
45
|
+
onWheel?: ((data: WheelEventData) => void) | undefined;
|
|
46
|
+
/** Duration in ms to trigger long press */
|
|
47
|
+
longPressDuration?: number | undefined;
|
|
48
|
+
/** Max time in ms between taps for double tap */
|
|
49
|
+
doubleTapDelay?: number | undefined;
|
|
50
|
+
/** Max time in ms for a valid touch */
|
|
51
|
+
maxTouchDuration?: number | undefined;
|
|
52
|
+
/** Outer spacing (margin) — forwarded to internal View */
|
|
53
|
+
margin?: number | EdgeInsets | undefined;
|
|
54
|
+
/** Inner spacing around the text (padding) — reduces available text width accordingly */
|
|
55
|
+
padding?: number | EdgeInsets | undefined;
|
|
56
|
+
/** Visibility — forwarded to internal View */
|
|
57
|
+
visible?: boolean | undefined;
|
|
58
|
+
}
|
|
59
|
+
export declare function resolveWrapMeasurementWidth(container: LayoutContainer): number;
|
|
60
|
+
/**
|
|
61
|
+
* WrapText component — text that automatically wraps to parent container width.
|
|
62
|
+
*
|
|
63
|
+
* **IMPORTANT:** WrapText needs an explicit width somewhere in its layout ancestry.
|
|
64
|
+
* - Prefer `width={300}` or `width="fill"` on the direct parent
|
|
65
|
+
* - Nested wrappers are supported if an ancestor resolves to an explicit width
|
|
66
|
+
* - `maxWidth` alone does NOT work (layout system limitation)
|
|
67
|
+
*
|
|
68
|
+
* @param props - WrapText props
|
|
69
|
+
* @returns WrapText JSX element
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <View width={400}>
|
|
74
|
+
* <WrapText text="This text will wrap at 400px" />
|
|
75
|
+
* </View>
|
|
76
|
+
*
|
|
77
|
+
* <View width={300}>
|
|
78
|
+
* <WrapText text="Styled text" style={{ fontSize: '16px', color: '#333' }} />
|
|
79
|
+
* </View>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function WrapText(props: WrapTextProps): VNodeLike;
|
|
83
|
+
//# sourceMappingURL=WrapText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrapText.d.ts","sourceRoot":"","sources":["../src/WrapText.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,cAAc,EACf,MAAM,oBAAoB,CAAA;AAuB3B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,sDAAsD;IACtD,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;IAC9C,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6BAA6B;IAC7B,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,6BAA6B;IAC7B,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAGtB,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,mBAAmB;IACnB,WAAW,CAAC,EAAE,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;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CA2JxD"}
|
package/dist/WrapText.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Text as e } from "./primitives/Text.js";
|
|
2
|
+
import { View as t } from "./primitives/View.js";
|
|
3
|
+
import "./primitives.js";
|
|
4
|
+
import { DeferredLayoutQueue as n, KNOWN_COMPONENTS as r, getGlobalThemeDefaults as i, normalizeEdgeInsets as a, normalizePadding as o, resolveComponentTheme as s, useCallback as c, useEffect as l, useLayoutEffect as u, useRef as d, useState as f, useTheme as p, useViewportSize as m } from "@number10/jsx-core";
|
|
5
|
+
import { jsx as h } from "@number10/jsx-core/jsx-runtime";
|
|
6
|
+
//#region src/WrapText.tsx
|
|
7
|
+
var g = /* @__PURE__ */ new Map();
|
|
8
|
+
function _(e) {
|
|
9
|
+
if (e.__layoutParent && typeof e.__layoutParent == "object") return e.__layoutParent;
|
|
10
|
+
if (e.parent) return e.parent;
|
|
11
|
+
let t = e.parentContainer;
|
|
12
|
+
return t && typeof t == "object" ? t : null;
|
|
13
|
+
}
|
|
14
|
+
function v(e) {
|
|
15
|
+
return e ? (e.__getLayoutSize?.() ?? e.__cachedLayoutSize)?.width ?? 0 : 0;
|
|
16
|
+
}
|
|
17
|
+
function y(e) {
|
|
18
|
+
let t = v(e), n = _(e);
|
|
19
|
+
for (; n;) {
|
|
20
|
+
let e = v(n);
|
|
21
|
+
if (t <= 0 && e > 0 && (t = e), n.__layoutProps?.width !== void 0 && e > 0) {
|
|
22
|
+
let t = o(n.__layoutProps.padding);
|
|
23
|
+
return Math.max(0, e - t.left - t.right);
|
|
24
|
+
}
|
|
25
|
+
n = _(n);
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
function b(o) {
|
|
30
|
+
let _ = p(), { props: v, nestedTheme: b } = s({
|
|
31
|
+
componentName: "WrapText",
|
|
32
|
+
globalTheme: i(),
|
|
33
|
+
localTheme: _,
|
|
34
|
+
knownComponents: r
|
|
35
|
+
}), x = m(), S = o.wrap ?? v.wrap ?? !0, C = v.paddingOffset ?? 0, w = typeof o.text == "string" ? o.text : null, T = null;
|
|
36
|
+
typeof o.cacheKey == "string" ? T = o.cacheKey : typeof o.key == "string" ? T = w ? `${o.key}::${w}` : o.key : w && (T = w);
|
|
37
|
+
let E = T ? g.get(T) ?? 0 : 0, [D, O] = f(E), k = d(E), A = d(null), j = d(null), M = c((e) => {
|
|
38
|
+
if (!S) return;
|
|
39
|
+
let t = () => {
|
|
40
|
+
let t = y(e);
|
|
41
|
+
t > 0 && t !== k.current && t !== D && (k.current = t, T && g.set(T, t), O(t));
|
|
42
|
+
};
|
|
43
|
+
j.current === null && (j.current = 1, n.defer(() => {
|
|
44
|
+
j.current = null, t();
|
|
45
|
+
}));
|
|
46
|
+
}, [
|
|
47
|
+
T,
|
|
48
|
+
D,
|
|
49
|
+
S
|
|
50
|
+
]), N = c((e) => {
|
|
51
|
+
let t = e;
|
|
52
|
+
A.current !== t && (A.current = t, !(!t || !S || D > 0) && M(t));
|
|
53
|
+
}, [
|
|
54
|
+
D,
|
|
55
|
+
M,
|
|
56
|
+
S
|
|
57
|
+
]);
|
|
58
|
+
l(() => {
|
|
59
|
+
if (!S || D > 0) return;
|
|
60
|
+
let e = A.current;
|
|
61
|
+
e && M(e);
|
|
62
|
+
}, [
|
|
63
|
+
D,
|
|
64
|
+
M,
|
|
65
|
+
S
|
|
66
|
+
]), u(() => {
|
|
67
|
+
S && A.current && (k.current = 0, O(0), n.defer(() => {
|
|
68
|
+
A.current && M(A.current);
|
|
69
|
+
}));
|
|
70
|
+
}, [x.width, x.height]), l(() => () => {
|
|
71
|
+
j.current = null;
|
|
72
|
+
}, []);
|
|
73
|
+
let P = D > 0 ? D : k.current, F = a(o.padding), I = (F.left ?? 0) + (F.right ?? 0), L = Math.max(0, (P > C ? P - C : 0) - I), R = {
|
|
74
|
+
...v.textStyle ?? {},
|
|
75
|
+
...o.style ?? {}
|
|
76
|
+
}, z = S && L > 0, B = {};
|
|
77
|
+
return o.backgroundColor !== void 0 && (B.backgroundColor = o.backgroundColor), o.cornerRadius !== void 0 && (B.cornerRadius = o.cornerRadius), o.borderWidth !== void 0 && (B.borderWidth = o.borderWidth), o.borderColor !== void 0 && (B.borderColor = o.borderColor), o.borderAlpha !== void 0 && (B.borderAlpha = o.borderAlpha), o.enableGestures !== void 0 && (B.enableGestures = o.enableGestures), o.onTouch !== void 0 && (B.onTouch = o.onTouch), o.onTouchOutside !== void 0 && (B.onTouchOutside = o.onTouchOutside), o.onTouchMove !== void 0 && (B.onTouchMove = o.onTouchMove), o.onDoubleTap !== void 0 && (B.onDoubleTap = o.onDoubleTap), o.onLongPress !== void 0 && (B.onLongPress = o.onLongPress), o.onWheel !== void 0 && (B.onWheel = o.onWheel), o.longPressDuration !== void 0 && (B.longPressDuration = o.longPressDuration), o.doubleTapDelay !== void 0 && (B.doubleTapDelay = o.doubleTapDelay), o.maxTouchDuration !== void 0 && (B.maxTouchDuration = o.maxTouchDuration), o.margin !== void 0 && (B.margin = o.margin), o.padding !== void 0 && (B.padding = o.padding), o.visible !== void 0 && (B.visible = o.visible), /* @__PURE__ */ h(t, {
|
|
78
|
+
ref: N,
|
|
79
|
+
width: "fill",
|
|
80
|
+
theme: b,
|
|
81
|
+
...B,
|
|
82
|
+
children: /* @__PURE__ */ h(e, {
|
|
83
|
+
text: o.text,
|
|
84
|
+
style: R,
|
|
85
|
+
...z && { maxWidth: L },
|
|
86
|
+
...o.alpha !== void 0 && { alpha: o.alpha },
|
|
87
|
+
...o.x !== void 0 && { x: o.x },
|
|
88
|
+
...o.y !== void 0 && { y: o.y }
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { b as WrapText };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrapText.test.d.ts","sourceRoot":"","sources":["../src/WrapText.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ContrastForegroundRole } from '@number10/jsx-core';
|
|
2
|
+
/** A slot that maps to a named contract */
|
|
3
|
+
interface ContractSlotEntry {
|
|
4
|
+
/** Human-readable label, e.g. "Primary button text" */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Dot-separated path within the theme object, e.g. "Button.primary.textStyle" */
|
|
7
|
+
path: string;
|
|
8
|
+
/** Property to verify: "color" for text-style .color, "tint" for Icon.tint */
|
|
9
|
+
property: 'color' | 'tint';
|
|
10
|
+
/** The contract id that governs this slot */
|
|
11
|
+
contractId: string;
|
|
12
|
+
/** Minimum contrast ratio — informational, must match the contract's minRatio */
|
|
13
|
+
minRatio: number;
|
|
14
|
+
}
|
|
15
|
+
/** A slot that maps to a foreground role against a specific theme background */
|
|
16
|
+
interface RoleSlotEntry {
|
|
17
|
+
label: string;
|
|
18
|
+
path: string;
|
|
19
|
+
property: 'color' | 'tint';
|
|
20
|
+
/** The foreground role to resolve */
|
|
21
|
+
foregroundRole: ContrastForegroundRole;
|
|
22
|
+
/** Dot-separated path to the background color within the theme, e.g. "Toast.backgroundColor" */
|
|
23
|
+
backgroundPath: string;
|
|
24
|
+
/** Minimum contrast ratio for this foreground/background pair */
|
|
25
|
+
minRatio: number;
|
|
26
|
+
}
|
|
27
|
+
export type ContrastSlotEntry = ContractSlotEntry | RoleSlotEntry;
|
|
28
|
+
/**
|
|
29
|
+
* All currently wired contrast slots.
|
|
30
|
+
*/
|
|
31
|
+
export declare const contrastSlotMap: readonly ContrastSlotEntry[];
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=contrast-slot-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast-slot-map.d.ts","sourceRoot":"","sources":["../src/contrast-slot-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEhE,2CAA2C;AAC3C,UAAU,iBAAiB;IACzB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAA;IACZ,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAA;IAC1B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,gFAAgF;AAChF,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAA;IAC1B,qCAAqC;IACrC,cAAc,EAAE,sBAAsB,CAAA;IACtC,gGAAgG;IAChG,cAAc,EAAE,MAAM,CAAA;IACtB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,aAAa,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,iBAAiB,EAsF9C,CAAA"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./theme-defaults.cjs`),t=require(`./primitives/Sprite.cjs`),n=require(`./primitives/Text.cjs`),r=require(`./primitives/VectorDrawContent.cjs`),i=require(`./primitives/View.cjs`);require(`./primitives.cjs`);const a=require(`./Accordion.cjs`),o=require(`./Button.cjs`),s=require(`./Portal.cjs`),c=require(`./useOverlayPresence.cjs`),l=require(`./Modal.cjs`),u=require(`./Dialog.cjs`),d=require(`./WrapText.cjs`),f=require(`./AlertDialog.cjs`),p=require(`./DebugPanel.cjs`),m=require(`./Popover.cjs`),h=require(`./TextInput.cjs`),g=require(`./ActivityIndicator.cjs`),_=require(`./Badge.cjs`),v=require(`./BottomSheet.cjs`),y=require(`./Checkbox.cjs`),b=require(`./RadioButton.cjs`),x=require(`./RadioGroup.cjs`),S=require(`./Slider.cjs`),C=require(`./ColorPicker.cjs`),w=require(`./Divider.cjs`),T=require(`./Dropdown.cjs`),E=require(`./Image.cjs`),D=require(`./Icon.cjs`),O=require(`./Joystick.cjs`),k=require(`./ScrollSlider.cjs`),A=require(`./ScrollView.cjs`),j=require(`./ListBox.cjs`),M=require(`./MenuButton.cjs`),N=require(`./NineSlice.cjs`),P=require(`./NineSliceButton.cjs`),F=require(`./NumberInput.cjs`),I=require(`./PalettePicker.cjs`),L=require(`./ProgressBar.cjs`),R=require(`./ProgressView.cjs`),z=require(`./RatingBar.cjs`),B=require(`./SegmentedControl.cjs`),V=require(`./Sidebar.cjs`),H=require(`./Tabs.cjs`),U=require(`./Toast.cjs`),W=require(`./WheelPicker.cjs`),G=require(`./Toolbar.cjs`),K=require(`./Toggle.cjs`),q=require(`./TransformOriginView.cjs`);let J=require(`@number10/jsx-core`);e.registerPortableDefaults(),exports.Accordion=a.Accordion,exports.ActivityIndicator=g.ActivityIndicator,exports.AlertDialog=f.AlertDialog,exports.Badge=_.Badge,exports.BottomSheet=v.BottomSheet,exports.BottomSheetDepth=v.BottomSheetDepth,exports.BottomSheetHandle=v.BottomSheetHandle,exports.Button=o.Button,exports.Checkbox=y.Checkbox,exports.ColorPicker=C.ColorPicker,exports.ContextMenu=m.ContextMenu,exports.DEFAULT_LABELS=p.DEFAULT_LABELS,exports.DebugPanel=p.DebugPanel,exports.Dialog=u.Dialog,exports.Divider=w.Divider,exports.Dropdown=T.Dropdown,exports.Icon=D.Icon,exports.Image=E.Image,exports.Joystick=O.Joystick,exports.ListBox=j.ListBox,exports.MenuButton=M.MenuButton,exports.Modal=l.Modal,exports.NineSlice=N.NineSlice,exports.NineSliceButton=P.NineSliceButton,exports.NotificationStack=U.NotificationStack,exports.NumberInput=F.NumberInput,exports.NumberInputIndicator=F.NumberInputIndicator,exports.PRESET_METRICS=p.PRESET_METRICS,exports.PalettePicker=I.PalettePicker,exports.Popover=m.Popover,exports.Portal=s.Portal,exports.ProgressBar=L.ProgressBar,exports.ProgressView=R.ProgressView,exports.RadioButton=b.RadioButton,exports.RadioGroup=x.RadioGroup,exports.RangeSlider=S.RangeSlider,exports.RatingBar=z.RatingBar,exports.ScrollSlider=k.ScrollSlider,exports.ScrollView=A.ScrollView,exports.SegmentedControl=B.SegmentedControl,exports.Sidebar=V.Sidebar,exports.Slider=S.Slider,exports.Sprite=t.Sprite,exports.Tab=H.Tab,exports.TabPanel=H.TabPanel,exports.Tabs=H.Tabs,exports.Tag=_.Tag,exports.Text=n.Text,exports.TextInput=h.TextInput,exports.Toast=U.Toast,exports.Toggle=K.Toggle,exports.ToolButtonGroup=G.ToolButtonGroup,exports.Toolbar=G.Toolbar,exports.TransformOriginView=q.TransformOriginView,exports.VectorDrawContent=r.VectorDrawContent,exports.View=i.View,exports.WheelPicker=W.WheelPicker,exports.WrapText=d.WrapText,exports.buildPortableThemeDefaults=e.buildPortableThemeDefaults,exports.calculateOverlayPosition=m.calculateOverlayPosition,exports.calculateSliderSize=k.calculateSliderSize,exports.chunkPalettePickerColors=I.chunkPalettePickerColors,exports.clampProgressValue=L.clampProgressValue,exports.createIconComponent=D.createIconComponent,exports.createPortableThemeDefaults=e.createPortableThemeDefaults,exports.findListBoxItem=j.findListBoxItem,exports.findSegmentedControlOption=B.findSegmentedControlOption,exports.formatBadgeCount=_.formatBadgeCount,exports.formatDefault=p.formatDefault,exports.getBadgeText=_.getBadgeText,exports.getNextCheckedState=y.getNextCheckedState,exports.getNextNumberInputValue=F.getNextNumberInputValue,exports.getNumberInputPrecision=F.getNumberInputPrecision,exports.getPalettePickerContrastColor=I.getPalettePickerContrastColor,exports.getProgressRatio=L.getProgressRatio,exports.getToastAutoDismissDuration=U.getToastAutoDismissDuration,exports.getToastContentWidth=U.getToastContentWidth,exports.getToolbarItemId=G.getToolbarItemId,exports.isSegmentedControlOptionSelectable=B.isSegmentedControlOptionSelectable,exports.isToolbarMenuItem=G.isToolbarMenuItem,exports.isToolbarSeparatorItem=G.isToolbarSeparatorItem,exports.isToolbarToggleItem=G.isToolbarToggleItem,exports.normalizeCheckedState=y.normalizeCheckedState,exports.normalizeNumberInputValue=F.normalizeNumberInputValue,exports.normalizePalettePickerColor=I.normalizePalettePickerColor,exports.normalizePalettePickerColors=I.normalizePalettePickerColors,exports.registerPortableDefaults=e.registerPortableDefaults,exports.resolveListBoxValue=j.resolveListBoxValue,exports.resolveNotificationStackAlignment=U.resolveNotificationStackAlignment,exports.resolvePalettePickerValue=I.resolvePalettePickerValue,exports.resolveScrollViewLayout=A.resolveScrollViewLayout,exports.resolveSegmentedControlValue=B.resolveSegmentedControlValue,exports.resolveToolbarActiveId=G.resolveToolbarActiveId,exports.summarizeMap=p.summarizeMap,Object.defineProperty(exports,`useAtlas`,{enumerable:!0,get:function(){return J.useAtlas}}),exports.useIconPreload=D.useIconPreload,exports.useOverlayPresence=c.useOverlayPresence,Object.defineProperty(exports,`useState`,{enumerable:!0,get:function(){return J.useState}}),Object.defineProperty(exports,`useTexture`,{enumerable:!0,get:function(){return J.useTexture}}),Object.defineProperty(exports,`useThemeTokens`,{enumerable:!0,get:function(){return J.useThemeTokens}});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @number10/jsx-components — Portable UI components.
|
|
3
|
+
*
|
|
4
|
+
* STATUS (Phase 4C, 17 June 2026): Primitive facade established.
|
|
5
|
+
* View, Text, Image, Sprite wrappers are available and renderer-neutral.
|
|
6
|
+
* Custom component migration still blocked by getThemedProps + theme resolution.
|
|
7
|
+
*
|
|
8
|
+
* ## Available now:
|
|
9
|
+
* - `@number10/jsx-components/primitives` — View, Text, Image, Sprite wrappers
|
|
10
|
+
*
|
|
11
|
+
* ## Still blocking custom component migration:
|
|
12
|
+
* 1. **getThemedProps** — component theme resolution not yet in Core
|
|
13
|
+
* 2. **Renderer binding** — Phaser Compat-Wrapper must re-export or coexist
|
|
14
|
+
*
|
|
15
|
+
* @migration(audit:scene-portal-mount) Phase 4C — primitive facade established.
|
|
16
|
+
*/
|
|
17
|
+
export { buildPortableThemeDefaults, createPortableThemeDefaults, registerPortableDefaults, } from './theme-defaults';
|
|
18
|
+
export type { AccordionTheme, ActivityIndicatorTheme, AlertDialogTheme, BadgeTheme, BottomSheetTheme, ButtonTheme, CheckboxTheme, ColorPickerTheme, ContextMenuTheme, DebugPanelTheme, DialogTheme, DividerTheme, DropdownTheme, IconTheme, ListBoxTheme, MenuButtonTheme, ModalTheme, NotificationStackTheme, NumberInputTheme, PalettePickerTheme, PopoverTheme, PortableComponentPartialTheme, PortableComponentThemes, PortablePartialTheme, ProgressBarTheme, ProgressViewTheme, RadioButtonTheme, RatingBarTheme, ScrollSliderTheme, ScrollViewTheme, SegmentedControlTheme, SidebarTheme, SliderTheme, TabsTheme, TagTheme, TextInputTheme, TooltipTheme, ToastTheme, ToastVariantTheme, ToggleTheme, ToolbarTheme, WheelPickerTheme, WrapTextTheme, } from './theme-types';
|
|
19
|
+
export { Sprite, Text, VectorDrawContent, View } from './primitives';
|
|
20
|
+
export { Accordion, type AccordionProps } from './Accordion';
|
|
21
|
+
export { AlertDialog, type AlertDialogProps } from './AlertDialog';
|
|
22
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './Button';
|
|
23
|
+
export { Dialog, type DialogProps } from './Dialog';
|
|
24
|
+
export { DebugPanel, DEFAULT_LABELS, formatDefault, PRESET_METRICS, summarizeMap, type DebugMetricKey, type DebugPanelPreset, type DebugPanelProps, type DebugSnapshot, type DebugValue, } from './DebugPanel';
|
|
25
|
+
export { Modal, type ModalProps } from './Modal';
|
|
26
|
+
export { Portal, type PortalProps } from './Portal';
|
|
27
|
+
export { calculateOverlayPosition, ContextMenu, Popover, type ContextMenuItem, type ContextMenuProps, type OverlayAnchorRect, type OverlayContentSize, type OverlayPosition, type OverlayPositionOptions, type PopoverPlacement, type PopoverProps, } from './Popover';
|
|
28
|
+
export { TextInput, type TextInputProps } from './TextInput';
|
|
29
|
+
export { useAtlas, useState, useTexture, useThemeTokens, type GestureEventData, type TouchMoveState, } from '@number10/jsx-core';
|
|
30
|
+
export { ActivityIndicator, type ActivityIndicatorLabels, type ActivityIndicatorProps, type ActivityIndicatorSize, type ActivityIndicatorVariant, } from './ActivityIndicator';
|
|
31
|
+
export { Badge, formatBadgeCount, getBadgeText, Tag, type BadgeFormatOptions, type BadgeProps, type BadgeSize, type BadgeSizeConfig, type BadgeTone, type BadgeToneColors, type BadgeVariant, type TagProps, } from './Badge';
|
|
32
|
+
export { BottomSheet, BottomSheetDepth, BottomSheetHandle, type BottomSheetLabels, type BottomSheetProps, type HandleRenderProps, } from './BottomSheet';
|
|
33
|
+
export { Checkbox, getNextCheckedState, normalizeCheckedState, type CheckboxIndicatorRenderProps, type CheckboxLabelPosition, type CheckboxProps, type CheckboxState, } from './Checkbox';
|
|
34
|
+
export { ColorPicker, type ColorPickerLabels, type ColorPickerProps, type ColorPickerState, type ColorPickerTone, } from './ColorPicker';
|
|
35
|
+
export { Divider, type DividerProps } from './Divider';
|
|
36
|
+
export { Dropdown, type DropdownOption, type DropdownProps } from './Dropdown';
|
|
37
|
+
export { createIconComponent, Icon, useIconPreload, type IconLoaderFn, type IconProps, } from './Icon';
|
|
38
|
+
export { Image, type ImageProps } from './Image';
|
|
39
|
+
export { Joystick, type JoystickProps, type JoystickTheme } from './Joystick';
|
|
40
|
+
export { findListBoxItem, ListBox, resolveListBoxValue, type ListBoxItem, type ListBoxItemRenderProps, type ListBoxLabels, type ListBoxProps, } from './ListBox';
|
|
41
|
+
export { MenuButton, type MenuButtonProps, type MenuButtonTriggerRenderProps } from './MenuButton';
|
|
42
|
+
export { NineSlice, type NineSliceProps } from './NineSlice';
|
|
43
|
+
export { NineSliceButton, type NineSliceButtonProps } from './NineSliceButton';
|
|
44
|
+
export { getNextNumberInputValue, getNumberInputPrecision, normalizeNumberInputValue, NumberInput, NumberInputIndicator, type NumberInputButtonAction, type NumberInputButtonDirection, type NumberInputButtonPlacement, type NumberInputButtonRenderProps, type NumberInputIndicatorDirection, type NumberInputIndicatorProps, type NumberInputIndicatorVariant, type NumberInputLabelPosition, type NumberInputLabels, type NumberInputProps, type NumberInputValueOptions, type NumberInputValueRenderProps, } from './NumberInput';
|
|
45
|
+
export { chunkPalettePickerColors, getPalettePickerContrastColor, normalizePalettePickerColor, normalizePalettePickerColors, PalettePicker, resolvePalettePickerValue, type NormalizedPalettePickerOption, type PalettePickerColor, type PalettePickerLabels, type PalettePickerOption, type PalettePickerProps, type PalettePickerSwatchRenderProps, } from './PalettePicker';
|
|
46
|
+
export { clampProgressValue, getProgressRatio, ProgressBar, type ProgressBarFormatProps, type ProgressBarLabelPosition, type ProgressBarOrientation, type ProgressBarProps, } from './ProgressBar';
|
|
47
|
+
export { ProgressView, type ProgressViewLabels, type ProgressViewProps } from './ProgressView';
|
|
48
|
+
export { RadioButton, type RadioButtonLabelPosition, type RadioButtonProps } from './RadioButton';
|
|
49
|
+
export { RadioGroup, type RadioGroupOption, type RadioGroupProps } from './RadioGroup';
|
|
50
|
+
export { RatingBar, type RatingBarIconRenderProps, type RatingBarLabels, type RatingBarProps, type RatingBarSize, } from './RatingBar';
|
|
51
|
+
export { findSegmentedControlOption, isSegmentedControlOptionSelectable, resolveSegmentedControlValue, SegmentedControl, type SegmentedControlLabelPosition, type SegmentedControlLabels, type SegmentedControlOption, type SegmentedControlOptionRenderProps, type SegmentedControlOrientation, type SegmentedControlProps, type SegmentedControlSize, type SegmentedControlVariant, } from './SegmentedControl';
|
|
52
|
+
export { Sidebar, type SidebarNavItem, type SidebarProps, type SidebarSection, type SidebarSize, type SidebarVariant, } from './Sidebar';
|
|
53
|
+
export { Tab, TabPanel, Tabs, type TabPanelProps, type TabProps, type TabsProps } from './Tabs';
|
|
54
|
+
export { getToastAutoDismissDuration, getToastContentWidth, NotificationStack, resolveNotificationStackAlignment, Toast, type NotificationStackAlignment, type NotificationStackPosition, type NotificationStackProps, type ToastItem, type ToastLabels, type ToastProps, type ToastVariant, } from './Toast';
|
|
55
|
+
export { WrapText, type WrapTextProps } from './WrapText';
|
|
56
|
+
export { WheelPicker, type WheelPickerItem, type WheelPickerItemRenderProps, type WheelPickerLabels, type WheelPickerProps, type WheelPickerSize, } from './WheelPicker';
|
|
57
|
+
export { getToolbarItemId, isToolbarMenuItem, isToolbarSeparatorItem, isToolbarToggleItem, resolveToolbarActiveId, Toolbar, ToolButtonGroup, type ToolbarActionItem, type ToolbarDensity, type ToolbarItem, type ToolbarItemType, type ToolbarLabels, type ToolbarMenuItem, type ToolbarOrientation, type ToolbarProps, type ToolbarSeparatorItem, type ToolbarToggleItem, } from './Toolbar';
|
|
58
|
+
export { calculateSliderSize, ScrollSlider, type ScrollSliderProps, type ScrollSliderSizeTheme, type SliderSize, } from './ScrollSlider';
|
|
59
|
+
export { resolveScrollViewLayout, ScrollView, type ResolvedScrollViewLayout, type ScrollChildAlignment, type ScrollChildIntoViewOptions, type ScrollInfo, type ScrollToOptions, type ScrollViewHandle, type ScrollViewProps, type SnapAlignment, } from './ScrollView';
|
|
60
|
+
export { RangeSlider, Slider, type RangeSliderProps, type SliderMark, type SliderProps, } from './Slider';
|
|
61
|
+
export { Toggle, type ToggleProps } from './Toggle';
|
|
62
|
+
export { TransformOriginView, type TransformOriginViewProps } from './TransformOriginView';
|
|
63
|
+
export { useOverlayPresence, type OverlayPresencePhase, type OverlayPresenceState, } from './useOverlayPresence';
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,kBAAkB,CAAA;AAGzB,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,g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