@tamagui/toggle-group 1.14.0 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,131 @@
1
- "use strict";var P=Object.create;var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var h=(e,o)=>{for(var r in o)l(e,r,{get:o[r],enumerable:!0})},c=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of T(o))!v.call(e,s)&&s!==r&&l(e,s,{get:()=>o[s],enumerable:!(a=y(o,s))||a.enumerable});return e};var k=(e,o,r)=>(r=e!=null?P(C(e)):{},c(o||!e||!e.__esModule?l(r,"default",{value:e,enumerable:!0}):r,e)),E=e=>c(l({},"__esModule",{value:!0}),e);var x={};h(x,{Toggle:()=>i,ToggleFrame:()=>d});module.exports=E(x);var g=require("react/jsx-runtime"),p=require("@tamagui/stacks"),b=require("@tamagui/use-controllable-state"),t=require("@tamagui/web"),$=k(require("react"));const u="Toggle",d=(0,t.styled)(p.ThemeableStack,{name:u,tag:"button",variants:{unstyled:{false:{pressTheme:!0,backgroundColor:"$background",alignItems:"center",justifyContent:"center",display:"flex",borderColor:"$borderColor",borderWidth:"1px",margin:"-1px",hoverStyle:{backgroundColor:"$backgroundHover"},pressStyle:{backgroundColor:"$backgroundPress"},focusStyle:{borderColor:"$borderColorPress",backgroundColor:"$backgroundPress"}}},active:{true:{zIndex:1,hoverStyle:{backgroundColor:"$background"},focusStyle:{borderColor:"$borderColorPress",backgroundColor:"$backgroundPress"}}},orientation:{horizontal:{flexDirection:"row",spaceDirection:"horizontal"},vertical:{flexDirection:"column",spaceDirection:"vertical"}}},defaultVariants:{unstyled:!1}}),i=d.extractable($.forwardRef((e,o)=>{const{pressed:r,defaultPressed:a=!1,onPressedChange:s,...f}=e,[n=!1,m]=(0,b.useControllableState)({prop:r,onChange:s,defaultProp:a});return(0,g.jsx)(t.Theme,{forceClassName:!0,name:n?"active":null,children:(0,g.jsx)(d,{active:e.unstyled?void 0:n,"aria-pressed":n,"data-state":n?"on":"off","data-disabled":e.disabled?"":void 0,...f,ref:o,onPress:(0,t.composeEventHandlers)(e.onPress??void 0,S=>{e.disabled||m(!n)})})})}));i.displayName=u;0&&(module.exports={Toggle,ToggleFrame});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Toggle_exports = {};
30
+ __export(Toggle_exports, {
31
+ Toggle: () => Toggle,
32
+ ToggleFrame: () => ToggleFrame
33
+ });
34
+ module.exports = __toCommonJS(Toggle_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_stacks = require("@tamagui/stacks");
37
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
38
+ var import_web = require("@tamagui/web");
39
+ var React = __toESM(require("react"));
40
+ const NAME = "Toggle";
41
+ const ToggleFrame = (0, import_web.styled)(import_stacks.ThemeableStack, {
42
+ name: NAME,
43
+ tag: "button",
44
+ variants: {
45
+ unstyled: {
46
+ false: {
47
+ pressTheme: true,
48
+ backgroundColor: "$background",
49
+ alignItems: "center",
50
+ justifyContent: "center",
51
+ display: "flex",
52
+ borderColor: "$borderColor",
53
+ borderWidth: "1px",
54
+ margin: "-1px",
55
+ hoverStyle: {
56
+ backgroundColor: "$backgroundHover"
57
+ },
58
+ pressStyle: {
59
+ backgroundColor: "$backgroundPress"
60
+ },
61
+ focusStyle: {
62
+ borderColor: "$borderColorPress",
63
+ backgroundColor: "$backgroundPress"
64
+ }
65
+ }
66
+ },
67
+ active: {
68
+ true: {
69
+ zIndex: 1,
70
+ hoverStyle: {
71
+ backgroundColor: "$background"
72
+ },
73
+ focusStyle: {
74
+ borderColor: "$borderColorPress",
75
+ backgroundColor: "$backgroundPress"
76
+ }
77
+ }
78
+ },
79
+ orientation: {
80
+ horizontal: {
81
+ flexDirection: "row",
82
+ spaceDirection: "horizontal"
83
+ },
84
+ vertical: {
85
+ flexDirection: "column",
86
+ spaceDirection: "vertical"
87
+ }
88
+ }
89
+ },
90
+ defaultVariants: {
91
+ unstyled: false
92
+ }
93
+ });
94
+ const Toggle = ToggleFrame.extractable(
95
+ React.forwardRef((props, forwardedRef) => {
96
+ const {
97
+ pressed: pressedProp,
98
+ defaultPressed = false,
99
+ onPressedChange,
100
+ ...buttonProps
101
+ } = props;
102
+ const [pressed = false, setPressed] = (0, import_use_controllable_state.useControllableState)({
103
+ prop: pressedProp,
104
+ onChange: onPressedChange,
105
+ defaultProp: defaultPressed
106
+ });
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web.Theme, { forceClassName: true, name: pressed ? "active" : null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
+ ToggleFrame,
109
+ {
110
+ active: !props.unstyled ? pressed : void 0,
111
+ "aria-pressed": pressed,
112
+ "data-state": pressed ? "on" : "off",
113
+ "data-disabled": props.disabled ? "" : void 0,
114
+ ...buttonProps,
115
+ ref: forwardedRef,
116
+ onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, (event) => {
117
+ if (!props.disabled) {
118
+ setPressed(!pressed);
119
+ }
120
+ })
121
+ }
122
+ ) });
123
+ })
124
+ );
125
+ Toggle.displayName = NAME;
126
+ // Annotate the CommonJS export names for ESM import in node:
127
+ 0 && (module.exports = {
128
+ Toggle,
129
+ ToggleFrame
130
+ });
2
131
  //# sourceMappingURL=Toggle.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/Toggle.tsx"],
4
4
  "sourcesContent": ["import { ThemeableStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport { GetProps, Theme, composeEventHandlers, isWeb, styled } from '@tamagui/web'\nimport * as React from 'react'\n\n/* -------------------------------------------------------------------------------------------------\n * Toggle\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Toggle'\n\ntype TamaguiButtonElement = HTMLButtonElement\n\ntype ToggleElement = TamaguiButtonElement\n\nconst ToggleFrame = styled(ThemeableStack, {\n name: NAME,\n tag: 'button',\n\n variants: {\n unstyled: {\n false: {\n pressTheme: true,\n backgroundColor: '$background',\n alignItems: 'center',\n justifyContent: 'center',\n display: 'flex',\n borderColor: '$borderColor',\n borderWidth: '1px',\n margin: '-1px',\n hoverStyle: {\n backgroundColor: '$backgroundHover',\n },\n pressStyle: {\n backgroundColor: '$backgroundPress',\n },\n focusStyle: {\n borderColor: '$borderColorPress',\n backgroundColor: '$backgroundPress',\n },\n },\n },\n active: {\n true: {\n zIndex: 1,\n hoverStyle: {\n backgroundColor: '$background',\n },\n focusStyle: {\n borderColor: '$borderColorPress',\n backgroundColor: '$backgroundPress',\n },\n },\n },\n orientation: {\n horizontal: {\n flexDirection: 'row',\n spaceDirection: 'horizontal',\n },\n vertical: {\n flexDirection: 'column',\n spaceDirection: 'vertical',\n },\n },\n } as const,\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype ToggleFrameProps = GetProps<typeof ToggleFrame>\n\ntype ToggleProps = ToggleFrameProps & {\n defaultValue?: string\n disabled?: boolean\n pressed?: boolean\n defaultPressed?: boolean\n onPressedChange?(pressed: boolean): void\n}\n\nconst Toggle = ToggleFrame.extractable(\n React.forwardRef<ToggleElement, ToggleProps>((props, forwardedRef) => {\n const {\n pressed: pressedProp,\n defaultPressed = false,\n onPressedChange,\n ...buttonProps\n } = props\n\n const [pressed = false, setPressed] = useControllableState({\n prop: pressedProp,\n onChange: onPressedChange,\n defaultProp: defaultPressed,\n })\n\n return (\n <Theme forceClassName name={pressed ? 'active' : null}>\n <ToggleFrame\n active={!props.unstyled ? pressed : undefined}\n aria-pressed={pressed}\n data-state={pressed ? 'on' : 'off'}\n data-disabled={props.disabled ? '' : undefined}\n {...buttonProps}\n ref={forwardedRef}\n onPress={composeEventHandlers(props.onPress ?? undefined, (event) => {\n if (!props.disabled) {\n setPressed(!pressed)\n }\n })}\n // caught by onPress - no need for this\n // {...(isWeb && {\n // onKeyDown: composeEventHandlers(\n // (props as React.HTMLProps<HTMLButtonElement>).onKeyDown,\n // (event) => {\n // if ([' ', 'Enter'].includes(event.key)) {\n // if (!props.disabled) {\n // setPressed(!pressed)\n // }\n // }\n // }\n // ),\n // })}\n />\n </Theme>\n )\n })\n)\nToggle.displayName = NAME\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport { Toggle, ToggleFrame }\nexport type { ToggleProps }\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,gBAAAC,IAAA,eAAAC,EAAAJ,GAiGQ,IAAAK,EAAA,6BAjGRC,EAA+B,2BAC/BC,EAAqC,2CACrCC,EAAqE,wBACrEC,EAAuB,oBAMvB,MAAMC,EAAO,SAMPP,KAAc,UAAO,iBAAgB,CACzC,KAAMO,EACN,IAAK,SAEL,SAAU,CACR,SAAU,CACR,MAAO,CACL,WAAY,GACZ,gBAAiB,cACjB,WAAY,SACZ,eAAgB,SAChB,QAAS,OACT,YAAa,eACb,YAAa,MACb,OAAQ,OACR,WAAY,CACV,gBAAiB,kBACnB,EACA,WAAY,CACV,gBAAiB,kBACnB,EACA,WAAY,CACV,YAAa,oBACb,gBAAiB,kBACnB,CACF,CACF,EACA,OAAQ,CACN,KAAM,CACJ,OAAQ,EACR,WAAY,CACV,gBAAiB,aACnB,EACA,WAAY,CACV,YAAa,oBACb,gBAAiB,kBACnB,CACF,CACF,EACA,YAAa,CACX,WAAY,CACV,cAAe,MACf,eAAgB,YAClB,EACA,SAAU,CACR,cAAe,SACf,eAAgB,UAClB,CACF,CACF,EACA,gBAAiB,CACf,SAAU,EACZ,CACF,CAAC,EAYKR,EAASC,EAAY,YACzBM,EAAM,WAAuC,CAACE,EAAOC,IAAiB,CACpE,KAAM,CACJ,QAASC,EACT,eAAAC,EAAiB,GACjB,gBAAAC,EACA,GAAGC,CACL,EAAIL,EAEE,CAACM,EAAU,GAAOC,CAAU,KAAI,wBAAqB,CACzD,KAAML,EACN,SAAUE,EACV,YAAaD,CACf,CAAC,EAED,SACE,OAAC,SAAM,eAAc,GAAC,KAAMG,EAAU,SAAW,KAC/C,mBAACd,EAAA,CACC,OAASQ,EAAM,SAAqB,OAAVM,EAC1B,eAAcA,EACd,aAAYA,EAAU,KAAO,MAC7B,gBAAeN,EAAM,SAAW,GAAK,OACpC,GAAGK,EACJ,IAAKJ,EACL,WAAS,wBAAqBD,EAAM,SAAW,OAAYQ,GAAU,CAC9DR,EAAM,UACTO,EAAW,CAACD,CAAO,CAEvB,CAAC,EAcH,EACF,CAEJ,CAAC,CACH,EACAf,EAAO,YAAcQ",
6
- "names": ["Toggle_exports", "__export", "Toggle", "ToggleFrame", "__toCommonJS", "import_jsx_runtime", "import_stacks", "import_use_controllable_state", "import_web", "React", "NAME", "props", "forwardedRef", "pressedProp", "defaultPressed", "onPressedChange", "buttonProps", "pressed", "setPressed", "event"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiGQ;AAjGR,oBAA+B;AAC/B,oCAAqC;AACrC,iBAAqE;AACrE,YAAuB;AAMvB,MAAM,OAAO;AAMb,MAAM,kBAAc,mBAAO,8BAAgB;AAAA,EACzC,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,QACb,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,QACA,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,QACA,YAAY;AAAA,UACV,aAAa;AAAA,UACb,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,QAAQ;AAAA,QACR,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,QACA,YAAY;AAAA,UACV,aAAa;AAAA,UACb,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa;AAAA,MACX,YAAY;AAAA,QACV,eAAe;AAAA,QACf,gBAAgB;AAAA,MAClB;AAAA,MACA,UAAU;AAAA,QACR,eAAe;AAAA,QACf,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,EACZ;AACF,CAAC;AAYD,MAAM,SAAS,YAAY;AAAA,EACzB,MAAM,WAAuC,CAAC,OAAO,iBAAiB;AACpE,UAAM;AAAA,MACJ,SAAS;AAAA,MACT,iBAAiB;AAAA,MACjB;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AAEJ,UAAM,CAAC,UAAU,OAAO,UAAU,QAAI,oDAAqB;AAAA,MACzD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,aAAa;AAAA,IACf,CAAC;AAED,WACE,4CAAC,oBAAM,gBAAc,MAAC,MAAM,UAAU,WAAW,MAC/C;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,CAAC,MAAM,WAAW,UAAU;AAAA,QACpC,gBAAc;AAAA,QACd,cAAY,UAAU,OAAO;AAAA,QAC7B,iBAAe,MAAM,WAAW,KAAK;AAAA,QACpC,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAS,iCAAqB,MAAM,WAAW,QAAW,CAAC,UAAU;AACnE,cAAI,CAAC,MAAM,UAAU;AACnB,uBAAW,CAAC,OAAO;AAAA,UACrB;AAAA,QACF,CAAC;AAAA;AAAA,IAcH,GACF;AAAA,EAEJ,CAAC;AACH;AACA,OAAO,cAAc;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,342 @@
1
- "use strict";var W=Object.create;var b=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var X=(e,o)=>{for(var t in o)b(e,t,{get:o[t],enumerable:!0})},M=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of J(o))!Q.call(e,l)&&l!==t&&b(e,l,{get:()=>o[l],enumerable:!(r=q(o,l))||r.enumerable});return e};var Y=(e,o,t)=>(t=e!=null?W(K(e)):{},M(o||!e||!e.__esModule?b(t,"default",{value:e,enumerable:!0}):t,e)),Z=e=>M(b({},"__esModule",{value:!0}),e);var ne={};X(ne,{ToggleGroup:()=>S,createToggleGroupScope:()=>H});module.exports=Z(ne);var n=require("react/jsx-runtime"),z=require("@tamagui/create-context"),L=require("@tamagui/focusable"),U=require("@tamagui/font-size"),$=require("@tamagui/get-size"),h=require("@tamagui/group"),j=require("@tamagui/helpers-tamagui"),T=require("@tamagui/roving-focus"),_=require("@tamagui/use-controllable-state"),B=require("@tamagui/use-direction"),u=require("@tamagui/web"),g=Y(require("react")),G=require("./Toggle");const d="ToggleGroup",[x,H]=(0,z.createContextScope)(d,[T.createRovingFocusGroupScope]),f="ToggleGroupItem",[me,ee]=(0,z.createContextScope)(f),[oe,de]=x(d),Ge=ee(),D=G.ToggleFrame.extractable(g.default.forwardRef((e,o)=>{const t=O(f,e.__scopeToggleGroup),r=pe(f,e.__scopeToggleGroup),l=e.__scopeToggleGroup,i=w(e.__scopeToggleGroup),a=t.value.includes(e.value),p=r.disabled||e.disabled||!1,s=g.default.useRef(null),I=(0,h.useGroupItem)({disabled:p}),c=e.size??r.size,m={width:void 0,height:void 0,padding:(0,u.getVariableValue)(c)*.6};e.orientation==="horizontal"?m.height=(0,u.getVariableValue)(c)*2.4:m.width=(0,u.getVariableValue)(c)*2.4;const P=(typeof c=="number"?c*.7:(0,U.getFontSize)(c))*1.2,v=(0,u.useTheme)(),y=(0,j.useGetThemedIcon)({size:P,color:v.color}),C=g.default.Children.toArray(e.children).map(E=>e.disablePassStyles||!g.default.isValidElement(E)?E:y(E)),R={...e,pressed:a,disabled:p,...m,children:C};return(0,n.jsx)(oe,{scope:l,children:r.rovingFocus?(0,n.jsx)(T.RovingFocusGroup.Item,{asChild:!0,...i,focusable:!p,active:a,children:(0,n.jsx)(G.ToggleFrame,{asChild:!0,focusable:!p,disabled:p,ref:s,...I,children:(0,n.jsx)(k,{...R,ref:o})})}):(0,n.jsx)(G.ToggleFrame,{asChild:!0,focusable:!p,disabled:p,ref:s,children:(0,n.jsx)(k,{...R,ref:o})})})}));D.displayName=f;const k=G.ToggleFrame.extractable(g.default.forwardRef((e,o)=>{const{__scopeToggleGroup:t,value:r,...l}=e,i=O(f,t),a={"aria-pressed":void 0},p=i.type==="single"?a:void 0;return(0,n.jsx)(G.Toggle,{...p,...l,ref:o,onPressedChange:s=>{s?i.onItemActivate(r):i.onItemDeactivate(r)}})})),w=(0,T.createRovingFocusGroupScope)(),S=(0,u.withStaticProperties)(g.default.forwardRef((e,o)=>{const{type:t,...r}=e;if(u.isWeb||g.default.useEffect(()=>{if(e.id)return(0,L.registerFocusable)(e.id,{focus:()=>{}})},[e.id]),t==="single")return(0,n.jsx)(te,{...r,ref:o});if(t==="multiple")return(0,n.jsx)(le,{...r,ref:o});throw new Error(`Missing prop \`type\` expected on \`${d}\``)}),{Item:D});S.displayName=d;const[A,O]=x(d),te=g.default.forwardRef((e,o)=>{const{value:t,defaultValue:r,onValueChange:l=()=>{},disableDeactivation:i=!1,...a}=e,[p,s]=(0,_.useControllableState)({prop:t,defaultProp:r,onChange:l});return(0,n.jsx)(A,{scope:e.__scopeToggleGroup,type:"single",value:p?[p]:[],defaultValue:p,onItemActivate:s,onItemDeactivate:g.default.useCallback(()=>i?null:s(""),[s,i]),children:(0,n.jsx)(N,{...a,ref:o})})}),le=g.default.forwardRef((e,o)=>{const{value:t,defaultValue:r,onValueChange:l=()=>{},...i}=e,[a=[],p]=(0,_.useControllableState)({prop:t,defaultProp:r,onChange:l}),s=g.default.useCallback(c=>p((m=[])=>[...m,c]),[p]),I=g.default.useCallback(c=>p((m=[])=>m.filter(P=>P!==c)),[p]);return(0,n.jsx)(A,{scope:e.__scopeToggleGroup,type:"multiple",value:a,defaultValue:a,onItemActivate:s,onItemDeactivate:I,children:(0,n.jsx)(N,{...i,ref:o})})});S.displayName=d;const[re,pe]=x(d),V=(0,u.styled)(h.Group,{name:d,variants:{unstyled:{false:{backgroundColor:"$background"}},orientation:{vertical:{flexDirection:"column",spaceDirection:"vertical"},horizontal:{flexDirection:"row",spaceDirection:"horizontal"}}},defaultVariants:{unstyled:!1}}),N=V.extractable(g.default.forwardRef((e,o)=>{const{__scopeToggleGroup:t,disabled:r=!1,orientation:l="horizontal",dir:i,rovingFocus:a=!0,loop:p=!0,unstyled:s=!1,size:I="$true",sizeAdjust:c=0,...m}=e,P=w(t),v=(0,B.useDirection)(i),y={role:"togglegroup",dir:v,...m},F=(0,u.getVariableValue)((0,$.stepTokenUpOrDown)("size",e.size,c)),C=Math.round(F*.45);return(0,n.jsx)(re,{scope:t,rovingFocus:a,disabled:r,size:C,children:a?(0,n.jsx)(T.RovingFocusGroup,{asChild:!0,...P,orientation:l,dir:v,loop:p,children:(0,n.jsx)(V,{"aria-orientation":l,orientation:l,axis:l,ref:o,"data-disabled":r?"":void 0,unstyled:s,...y})}):(0,n.jsx)(V,{"aria-orientation":l,ref:o,orientation:l,"data-disabled":r?"":void 0,unstyled:s,...y})})}));0&&(module.exports={ToggleGroup,createToggleGroupScope});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ToggleGroup_exports = {};
30
+ __export(ToggleGroup_exports, {
31
+ ToggleGroup: () => ToggleGroup,
32
+ createToggleGroupScope: () => createToggleGroupScope
33
+ });
34
+ module.exports = __toCommonJS(ToggleGroup_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_create_context = require("@tamagui/create-context");
37
+ var import_focusable = require("@tamagui/focusable");
38
+ var import_font_size = require("@tamagui/font-size");
39
+ var import_get_size = require("@tamagui/get-size");
40
+ var import_group = require("@tamagui/group");
41
+ var import_helpers_tamagui = require("@tamagui/helpers-tamagui");
42
+ var import_roving_focus = require("@tamagui/roving-focus");
43
+ var import_use_controllable_state = require("@tamagui/use-controllable-state");
44
+ var import_use_direction = require("@tamagui/use-direction");
45
+ var import_web = require("@tamagui/web");
46
+ var import_react = __toESM(require("react"));
47
+ var import_Toggle = require("./Toggle");
48
+ const TOGGLE_GROUP_NAME = "ToggleGroup";
49
+ const [createToggleGroupContext, createToggleGroupScope] = (0, import_create_context.createContextScope)(
50
+ TOGGLE_GROUP_NAME,
51
+ [import_roving_focus.createRovingFocusGroupScope]
52
+ );
53
+ const TOGGLE_GROUP_ITEM_NAME = "ToggleGroupItem";
54
+ const [createToggleGroupItemContext, createToggleGroupItemScope] = (0, import_create_context.createContextScope)(TOGGLE_GROUP_ITEM_NAME);
55
+ const [ToggleGroupItemProvider, useToggleGroupItemContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
56
+ const useToggleGroupItemScope = createToggleGroupItemScope();
57
+ const ToggleGroupItem = import_Toggle.ToggleFrame.extractable(
58
+ import_react.default.forwardRef(
59
+ (props, forwardedRef) => {
60
+ const valueContext = useToggleGroupValueContext(
61
+ TOGGLE_GROUP_ITEM_NAME,
62
+ props.__scopeToggleGroup
63
+ );
64
+ const context = useToggleGroupContext(
65
+ TOGGLE_GROUP_ITEM_NAME,
66
+ props.__scopeToggleGroup
67
+ );
68
+ const __scopeToggleGroup = props.__scopeToggleGroup;
69
+ const rovingFocusGroupScope = useRovingFocusGroupScope(props.__scopeToggleGroup);
70
+ const pressed = valueContext.value.includes(props.value);
71
+ const disabled = context.disabled || props.disabled || false;
72
+ const ref = import_react.default.useRef(null);
73
+ const groupItemProps = (0, import_group.useGroupItem)({ disabled });
74
+ const size = props.size ?? context.size;
75
+ const sizeProps = {
76
+ width: void 0,
77
+ height: void 0,
78
+ padding: (0, import_web.getVariableValue)(size) * 0.6
79
+ };
80
+ if (props.orientation === "horizontal")
81
+ sizeProps.height = (0, import_web.getVariableValue)(size) * 2.4;
82
+ else
83
+ sizeProps.width = (0, import_web.getVariableValue)(size) * 2.4;
84
+ const iconSize = (typeof size === "number" ? size * 0.7 : (0, import_font_size.getFontSize)(size)) * 1.2;
85
+ const theme = (0, import_web.useTheme)();
86
+ const getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color: theme.color });
87
+ const childrens = import_react.default.Children.toArray(props.children);
88
+ const children = childrens.map((child) => {
89
+ if (props.disablePassStyles || !import_react.default.isValidElement(child)) {
90
+ return child;
91
+ }
92
+ return getThemedIcon(child);
93
+ });
94
+ const commonProps = { ...props, pressed, disabled, ...sizeProps, children };
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItemProvider, { scope: __scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
96
+ import_roving_focus.RovingFocusGroup.Item,
97
+ {
98
+ asChild: true,
99
+ ...rovingFocusGroupScope,
100
+ focusable: !disabled,
101
+ active: pressed,
102
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
+ import_Toggle.ToggleFrame,
104
+ {
105
+ asChild: true,
106
+ focusable: !disabled,
107
+ disabled,
108
+ ref,
109
+ ...groupItemProps,
110
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItemImpl, { ...commonProps, ref: forwardedRef })
111
+ }
112
+ )
113
+ }
114
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Toggle.ToggleFrame, { asChild: true, focusable: !disabled, disabled, ref, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItemImpl, { ...commonProps, ref: forwardedRef }) }) });
115
+ }
116
+ )
117
+ );
118
+ ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
119
+ const ToggleGroupItemImpl = import_Toggle.ToggleFrame.extractable(
120
+ import_react.default.forwardRef(
121
+ (props, forwardedRef) => {
122
+ const { __scopeToggleGroup, value, ...itemProps } = props;
123
+ const valueContext = useToggleGroupValueContext(
124
+ TOGGLE_GROUP_ITEM_NAME,
125
+ __scopeToggleGroup
126
+ );
127
+ const singleProps = {
128
+ "aria-pressed": void 0
129
+ };
130
+ const typeProps = valueContext.type === "single" ? singleProps : void 0;
131
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
132
+ import_Toggle.Toggle,
133
+ {
134
+ ...typeProps,
135
+ ...itemProps,
136
+ ref: forwardedRef,
137
+ onPressedChange: (pressed) => {
138
+ if (pressed) {
139
+ valueContext.onItemActivate(value);
140
+ } else {
141
+ valueContext.onItemDeactivate(value);
142
+ }
143
+ }
144
+ }
145
+ );
146
+ }
147
+ )
148
+ );
149
+ const useRovingFocusGroupScope = (0, import_roving_focus.createRovingFocusGroupScope)();
150
+ const ToggleGroup = (0, import_web.withStaticProperties)(
151
+ import_react.default.forwardRef((props, forwardedRef) => {
152
+ const { type, ...toggleGroupProps } = props;
153
+ if (!import_web.isWeb) {
154
+ import_react.default.useEffect(() => {
155
+ if (!props.id)
156
+ return;
157
+ return (0, import_focusable.registerFocusable)(props.id, {
158
+ // TODO: would be nice to focus on the first child later - could be done with reforest
159
+ // for now leaving it empty
160
+ focus: () => {
161
+ }
162
+ });
163
+ }, [props.id]);
164
+ }
165
+ if (type === "single") {
166
+ const singleProps = toggleGroupProps;
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupImplSingle, { ...singleProps, ref: forwardedRef });
168
+ }
169
+ if (type === "multiple") {
170
+ const multipleProps = toggleGroupProps;
171
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupImplMultiple, { ...multipleProps, ref: forwardedRef });
172
+ }
173
+ throw new Error(`Missing prop \`type\` expected on \`${TOGGLE_GROUP_NAME}\``);
174
+ }),
175
+ {
176
+ Item: ToggleGroupItem
177
+ }
178
+ );
179
+ ToggleGroup.displayName = TOGGLE_GROUP_NAME;
180
+ const [ToggleGroupValueProvider, useToggleGroupValueContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
181
+ const ToggleGroupImplSingle = import_react.default.forwardRef((props, forwardedRef) => {
182
+ const {
183
+ value: valueProp,
184
+ defaultValue,
185
+ onValueChange = () => {
186
+ },
187
+ disableDeactivation = false,
188
+ ...toggleGroupSingleProps
189
+ } = props;
190
+ const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
191
+ prop: valueProp,
192
+ defaultProp: defaultValue,
193
+ onChange: onValueChange
194
+ });
195
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
196
+ ToggleGroupValueProvider,
197
+ {
198
+ scope: props.__scopeToggleGroup,
199
+ type: "single",
200
+ value: value ? [value] : [],
201
+ defaultValue: value,
202
+ onItemActivate: setValue,
203
+ onItemDeactivate: import_react.default.useCallback(() => disableDeactivation ? null : setValue(""), [setValue, disableDeactivation]),
204
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupImpl, { ...toggleGroupSingleProps, ref: forwardedRef })
205
+ }
206
+ );
207
+ });
208
+ const ToggleGroupImplMultiple = import_react.default.forwardRef((props, forwardedRef) => {
209
+ const {
210
+ value: valueProp,
211
+ defaultValue,
212
+ onValueChange = () => {
213
+ },
214
+ ...toggleGroupMultipleProps
215
+ } = props;
216
+ const [value = [], setValue] = (0, import_use_controllable_state.useControllableState)({
217
+ prop: valueProp,
218
+ defaultProp: defaultValue,
219
+ onChange: onValueChange
220
+ });
221
+ const handleButtonActivate = import_react.default.useCallback(
222
+ (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
223
+ [setValue]
224
+ );
225
+ const handleButtonDeactivate = import_react.default.useCallback(
226
+ (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
227
+ [setValue]
228
+ );
229
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
230
+ ToggleGroupValueProvider,
231
+ {
232
+ scope: props.__scopeToggleGroup,
233
+ type: "multiple",
234
+ value,
235
+ defaultValue: value,
236
+ onItemActivate: handleButtonActivate,
237
+ onItemDeactivate: handleButtonDeactivate,
238
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupImpl, { ...toggleGroupMultipleProps, ref: forwardedRef })
239
+ }
240
+ );
241
+ });
242
+ ToggleGroup.displayName = TOGGLE_GROUP_NAME;
243
+ const [ToggleGroupContext, useToggleGroupContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
244
+ const ToggleGroupImplElementFrame = (0, import_web.styled)(import_group.Group, {
245
+ name: TOGGLE_GROUP_NAME,
246
+ variants: {
247
+ unstyled: {
248
+ false: {
249
+ backgroundColor: "$background"
250
+ }
251
+ },
252
+ orientation: {
253
+ vertical: {
254
+ flexDirection: "column",
255
+ spaceDirection: "vertical"
256
+ },
257
+ horizontal: {
258
+ flexDirection: "row",
259
+ spaceDirection: "horizontal"
260
+ }
261
+ }
262
+ },
263
+ defaultVariants: {
264
+ unstyled: false
265
+ }
266
+ });
267
+ const ToggleGroupImpl = ToggleGroupImplElementFrame.extractable(
268
+ import_react.default.forwardRef(
269
+ (props, forwardedRef) => {
270
+ const {
271
+ __scopeToggleGroup,
272
+ disabled = false,
273
+ orientation = "horizontal",
274
+ dir,
275
+ rovingFocus = true,
276
+ loop = true,
277
+ unstyled = false,
278
+ size: sizeProp = "$true",
279
+ sizeAdjust = 0,
280
+ ...toggleGroupProps
281
+ } = props;
282
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeToggleGroup);
283
+ const direction = (0, import_use_direction.useDirection)(dir);
284
+ const commonProps = {
285
+ role: "togglegroup",
286
+ dir: direction,
287
+ ...toggleGroupProps
288
+ };
289
+ const adjustedSize = (0, import_web.getVariableValue)(
290
+ (0, import_get_size.stepTokenUpOrDown)("size", props.size, sizeAdjust)
291
+ );
292
+ const size = Math.round(adjustedSize * 0.45);
293
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
294
+ ToggleGroupContext,
295
+ {
296
+ scope: __scopeToggleGroup,
297
+ rovingFocus,
298
+ disabled,
299
+ size,
300
+ children: rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
301
+ import_roving_focus.RovingFocusGroup,
302
+ {
303
+ asChild: true,
304
+ ...rovingFocusGroupScope,
305
+ orientation,
306
+ dir: direction,
307
+ loop,
308
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
309
+ ToggleGroupImplElementFrame,
310
+ {
311
+ "aria-orientation": orientation,
312
+ orientation,
313
+ axis: orientation,
314
+ ref: forwardedRef,
315
+ "data-disabled": disabled ? "" : void 0,
316
+ unstyled,
317
+ ...commonProps
318
+ }
319
+ )
320
+ }
321
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
322
+ ToggleGroupImplElementFrame,
323
+ {
324
+ "aria-orientation": orientation,
325
+ ref: forwardedRef,
326
+ orientation,
327
+ "data-disabled": disabled ? "" : void 0,
328
+ unstyled,
329
+ ...commonProps
330
+ }
331
+ )
332
+ }
333
+ );
334
+ }
335
+ )
336
+ );
337
+ // Annotate the CommonJS export names for ESM import in node:
338
+ 0 && (module.exports = {
339
+ ToggleGroup,
340
+ createToggleGroupScope
341
+ });
2
342
  //# sourceMappingURL=ToggleGroup.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/ToggleGroup.tsx"],
4
4
  "sourcesContent": ["import { Scope, createContextScope } from '@tamagui/create-context'\nimport { registerFocusable } from '@tamagui/focusable'\nimport { getFontSize } from '@tamagui/font-size'\nimport { stepTokenUpOrDown } from '@tamagui/get-size'\nimport { Group, GroupProps, useGroupItem } from '@tamagui/group'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { RovingFocusGroup, createRovingFocusGroupScope } from '@tamagui/roving-focus'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport { useDirection } from '@tamagui/use-direction'\nimport {\n GetProps,\n SizeTokens,\n getVariableValue,\n isWeb,\n styled,\n useTheme,\n withStaticProperties,\n} from '@tamagui/web'\nimport React from 'react'\n\nimport { Toggle, ToggleFrame, ToggleProps } from './Toggle'\n\nconst TOGGLE_GROUP_NAME = 'ToggleGroup'\nconst [createToggleGroupContext, createToggleGroupScope] = createContextScope(\n TOGGLE_GROUP_NAME,\n [createRovingFocusGroupScope]\n)\n/* -------------------------------------------------------------------------------------------------\n * ToggleGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst TOGGLE_GROUP_ITEM_NAME = 'ToggleGroupItem'\n\ntype ToggleGroupItemContextValue = { disabled?: boolean }\n\nconst [createToggleGroupItemContext, createToggleGroupItemScope] =\n createContextScope(TOGGLE_GROUP_ITEM_NAME)\nconst [ToggleGroupItemProvider, useToggleGroupItemContext] =\n createToggleGroupContext<ToggleGroupItemContextValue>(TOGGLE_GROUP_NAME)\nconst useToggleGroupItemScope = createToggleGroupItemScope()\n\ntype ToggleGroupItemElement = ToggleGroupItemImplElement\n\ntype ToggleGroupItemProps = GetProps<typeof ToggleFrame> & {\n value: string\n id?: string\n disabled?: boolean\n size?: SizeTokens\n /**\n * Used to disable passing styles down to children.\n */\n disablePassStyles?: boolean\n}\nconst ToggleGroupItem = ToggleFrame.extractable(\n React.forwardRef<ToggleGroupItemElement, ToggleGroupItemProps>(\n (props: ScopedProps<ToggleGroupItemProps>, forwardedRef) => {\n const valueContext = useToggleGroupValueContext(\n TOGGLE_GROUP_ITEM_NAME,\n props.__scopeToggleGroup\n )\n const context = useToggleGroupContext(\n TOGGLE_GROUP_ITEM_NAME,\n props.__scopeToggleGroup\n )\n const __scopeToggleGroup = props.__scopeToggleGroup\n const rovingFocusGroupScope = useRovingFocusGroupScope(props.__scopeToggleGroup)\n const pressed = valueContext.value.includes(props.value)\n const disabled = context.disabled || props.disabled || false\n const ref = React.useRef<HTMLDivElement>(null)\n const groupItemProps = useGroupItem({ disabled })\n const size = props.size ?? context.size\n\n const sizeProps: Record<string, any> = {\n width: undefined,\n height: undefined,\n padding: getVariableValue(size) * 0.6,\n }\n if (props.orientation === 'horizontal')\n sizeProps.height = getVariableValue(size) * 2.4\n else sizeProps.width = getVariableValue(size) * 2.4\n\n const iconSize = (typeof size === 'number' ? size * 0.7 : getFontSize(size)) * 1.2\n\n const theme = useTheme()\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color: theme.color })\n\n const childrens = React.Children.toArray(props.children)\n const children = childrens.map((child) => {\n if (props.disablePassStyles || !React.isValidElement(child)) {\n return child\n }\n return getThemedIcon(child)\n })\n\n const commonProps = { ...props, pressed, disabled, ...sizeProps, children }\n\n return (\n <ToggleGroupItemProvider scope={__scopeToggleGroup}>\n {context.rovingFocus ? (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!disabled}\n active={pressed}\n >\n <ToggleFrame\n asChild\n focusable={!disabled}\n disabled={disabled}\n ref={ref}\n {...groupItemProps}\n >\n <ToggleGroupItemImpl {...commonProps} ref={forwardedRef} />\n </ToggleFrame>\n </RovingFocusGroup.Item>\n ) : (\n <ToggleFrame asChild focusable={!disabled} disabled={disabled} ref={ref}>\n <ToggleGroupItemImpl {...commonProps} ref={forwardedRef} />\n </ToggleFrame>\n )}\n </ToggleGroupItemProvider>\n )\n }\n )\n)\nToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ToggleGroupItemImplElement = React.ElementRef<typeof Toggle>\ntype ToggleGroupItemImplProps = Omit<\n ToggleProps,\n 'defaultPressed' | 'onPressedChange' | 'size'\n> & {\n /**\n * A string value for the toggle group item. All items within a toggle group should use a unique value.\n */\n value: string\n size?: SizeTokens\n}\n\nconst ToggleGroupItemImpl = ToggleFrame.extractable(\n React.forwardRef<ToggleGroupItemImplElement, ToggleGroupItemImplProps>(\n (props: ScopedProps<ToggleGroupItemImplProps>, forwardedRef) => {\n const { __scopeToggleGroup, value, ...itemProps } = props\n const valueContext = useToggleGroupValueContext(\n TOGGLE_GROUP_ITEM_NAME,\n __scopeToggleGroup\n )\n const singleProps = {\n 'aria-pressed': undefined,\n }\n const typeProps = valueContext.type === 'single' ? singleProps : undefined\n\n return (\n <Toggle\n {...typeProps}\n {...itemProps}\n ref={forwardedRef}\n onPressedChange={(pressed) => {\n if (pressed) {\n valueContext.onItemActivate(value)\n } else {\n valueContext.onItemDeactivate(value)\n }\n }}\n />\n )\n }\n )\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\n/* -------------------------------------------------------------------------------------------------\n * ToggleGroup\n * -----------------------------------------------------------------------------------------------*/\n\ntype ScopedProps<P> = P & { __scopeToggleGroup?: Scope }\n\nconst useRovingFocusGroupScope = createRovingFocusGroupScope()\n\ntype ToggleGroupElement = ToggleGroupImplSingleElement | ToggleGroupImplMultipleElement\ninterface ToggleGroupSingleProps extends ToggleGroupImplSingleProps {\n type: 'single'\n}\ninterface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {\n type: 'multiple'\n}\n\ntype ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps\n\nconst ToggleGroup = withStaticProperties(\n React.forwardRef<ToggleGroupElement, ToggleGroupProps>((props, forwardedRef) => {\n const { type, ...toggleGroupProps } = props\n\n if (!isWeb) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!props.id) return\n return registerFocusable(props.id, {\n // TODO: would be nice to focus on the first child later - could be done with reforest\n // for now leaving it empty\n focus: () => {},\n })\n }, [props.id])\n }\n\n if (type === 'single') {\n const singleProps = toggleGroupProps as ToggleGroupImplSingleProps\n return <ToggleGroupImplSingle {...singleProps} ref={forwardedRef} />\n }\n\n if (type === 'multiple') {\n const multipleProps = toggleGroupProps as ToggleGroupImplMultipleProps\n return <ToggleGroupImplMultiple {...multipleProps} ref={forwardedRef} />\n }\n\n throw new Error(`Missing prop \\`type\\` expected on \\`${TOGGLE_GROUP_NAME}\\``)\n }),\n {\n Item: ToggleGroupItem,\n }\n)\n\nToggleGroup.displayName = TOGGLE_GROUP_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ToggleGroupValueContextValue = {\n type: 'single' | 'multiple'\n defaultValue?: string | string[]\n value: string[]\n onItemActivate(value: string): void\n onItemDeactivate(value: string): void\n}\n\nconst [ToggleGroupValueProvider, useToggleGroupValueContext] =\n createToggleGroupContext<ToggleGroupValueContextValue>(TOGGLE_GROUP_NAME)\n\ntype ToggleGroupImplSingleElement = ToggleGroupImplElement\ninterface ToggleGroupImplSingleProps extends ToggleGroupImplProps {\n /**\n * The controlled stateful value of the item that is pressed.\n */\n value?: string\n /**\n * The value of the item that is pressed when initially rendered. Use\n * `defaultValue` if you do not need to control the state of a toggle group.\n */\n defaultValue?: string\n /**\n * The callback that fires when the value of the toggle group changes.\n */\n onValueChange?(value: string): void\n /**\n * Won't let the user turn the active item off.\n */\n disableDeactivation?: boolean\n}\n\nconst ToggleGroupImplSingle = React.forwardRef<\n ToggleGroupImplSingleElement,\n ToggleGroupImplSingleProps\n>((props: ScopedProps<ToggleGroupImplSingleProps>, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n disableDeactivation = false,\n ...toggleGroupSingleProps\n } = props\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue!,\n onChange: onValueChange,\n })\n\n return (\n <ToggleGroupValueProvider\n scope={props.__scopeToggleGroup}\n type=\"single\"\n value={value ? [value] : []}\n defaultValue={value}\n onItemActivate={setValue}\n onItemDeactivate={React.useCallback(() => disableDeactivation ? null : setValue(''), [setValue, disableDeactivation])}\n >\n <ToggleGroupImpl {...toggleGroupSingleProps} ref={forwardedRef} />\n </ToggleGroupValueProvider>\n )\n})\n\ntype ToggleGroupImplMultipleElement = ToggleGroupImplElement\ninterface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {\n /**\n * The controlled stateful value of the items that are pressed.\n */\n value?: string[]\n /**\n * The value of the items that are pressed when initially rendered. Use\n * `defaultValue` if you do not need to control the state of a toggle group.\n */\n defaultValue?: string[]\n /**\n * The callback that fires when the state of the toggle group changes.\n */\n onValueChange?(value: string[]): void\n}\n\nconst ToggleGroupImplMultiple = React.forwardRef<\n ToggleGroupImplMultipleElement,\n ToggleGroupImplMultipleProps\n>((props: ScopedProps<ToggleGroupImplMultipleProps>, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {},\n ...toggleGroupMultipleProps\n } = props\n\n const [value = [], setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue!,\n onChange: onValueChange,\n })\n\n const handleButtonActivate = React.useCallback(\n (itemValue: string) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue]\n )\n\n const handleButtonDeactivate = React.useCallback(\n (itemValue: string) =>\n setValue((prevValue = []) => prevValue.filter((value) => value !== itemValue)),\n [setValue]\n )\n\n return (\n <ToggleGroupValueProvider\n scope={props.__scopeToggleGroup}\n type=\"multiple\"\n value={value}\n defaultValue={value}\n onItemActivate={handleButtonActivate}\n onItemDeactivate={handleButtonDeactivate}\n >\n <ToggleGroupImpl {...toggleGroupMultipleProps} ref={forwardedRef} />\n </ToggleGroupValueProvider>\n )\n})\n\nToggleGroup.displayName = TOGGLE_GROUP_NAME\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype ToggleGroupContextValue = {\n rovingFocus: boolean\n disabled: boolean\n size: SizeTokens\n}\n\nconst [ToggleGroupContext, useToggleGroupContext] =\n createToggleGroupContext<ToggleGroupContextValue>(TOGGLE_GROUP_NAME)\n\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup>\ntype TamaguiElement = HTMLElement\ntype ToggleGroupImplElement = TamaguiElement\n\nconst ToggleGroupImplElementFrame = styled(Group, {\n name: TOGGLE_GROUP_NAME,\n variants: {\n unstyled: {\n false: {\n backgroundColor: '$background',\n },\n },\n orientation: {\n vertical: {\n flexDirection: 'column',\n spaceDirection: 'vertical',\n },\n horizontal: {\n flexDirection: 'row',\n spaceDirection: 'horizontal',\n },\n },\n } as const,\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype ToggleGroupImplProps = GetProps<typeof ToggleGroupImplElementFrame> &\n GroupProps & {\n rovingFocus?: boolean\n dir?: RovingFocusGroupProps['dir']\n loop?: RovingFocusGroupProps['loop']\n sizeAdjust?: number\n }\n\nconst ToggleGroupImpl = ToggleGroupImplElementFrame.extractable(\n React.forwardRef<ToggleGroupImplElement, ToggleGroupImplProps>(\n (props: ScopedProps<ToggleGroupImplProps>, forwardedRef) => {\n const {\n __scopeToggleGroup,\n disabled = false,\n orientation = 'horizontal',\n dir,\n rovingFocus = true,\n loop = true,\n unstyled = false,\n size: sizeProp = '$true',\n sizeAdjust = 0,\n ...toggleGroupProps\n } = props\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeToggleGroup)\n const direction = useDirection(dir)\n const commonProps = {\n role: 'togglegroup',\n dir: direction,\n ...toggleGroupProps,\n }\n const adjustedSize = getVariableValue(\n stepTokenUpOrDown('size', props.size, sizeAdjust)\n )\n const size = Math.round(adjustedSize * 0.45)\n\n return (\n <ToggleGroupContext\n scope={__scopeToggleGroup}\n rovingFocus={rovingFocus}\n disabled={disabled}\n size={size}\n >\n {rovingFocus ? (\n <RovingFocusGroup\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <ToggleGroupImplElementFrame\n aria-orientation={orientation}\n orientation={orientation}\n axis={orientation}\n ref={forwardedRef}\n data-disabled={disabled ? '' : undefined}\n unstyled={unstyled}\n {...commonProps}\n />\n </RovingFocusGroup>\n ) : (\n <ToggleGroupImplElementFrame\n aria-orientation={orientation}\n ref={forwardedRef}\n orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n unstyled={unstyled}\n {...commonProps}\n />\n )}\n </ToggleGroupContext>\n )\n }\n )\n)\n\nexport { ToggleGroup, createToggleGroupScope }\nexport type {\n ToggleGroupItemProps,\n ToggleGroupMultipleProps,\n ToggleGroupSingleProps,\n ToggleGroupProps,\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,iBAAAE,EAAA,2BAAAC,IAAA,eAAAC,EAAAJ,IAgHgB,IAAAK,EAAA,6BAhHhBC,EAA0C,mCAC1CC,EAAkC,8BAClCC,EAA4B,8BAC5BC,EAAkC,6BAClCC,EAAgD,0BAChDC,EAAiC,oCACjCC,EAA8D,iCAC9DC,EAAqC,2CACrCC,EAA6B,kCAC7BC,EAQO,wBACPC,EAAkB,oBAElBC,EAAiD,oBAEjD,MAAMC,EAAoB,cACpB,CAACC,EAA0BhB,CAAsB,KAAI,sBACzDe,EACA,CAAC,6BAA2B,CAC9B,EAKME,EAAyB,kBAIzB,CAACC,GAA8BC,EAA0B,KAC7D,sBAAmBF,CAAsB,EACrC,CAACG,GAAyBC,EAAyB,EACvDL,EAAsDD,CAAiB,EACnEO,GAA0BH,GAA2B,EAcrDI,EAAkB,cAAY,YAClC,EAAAC,QAAM,WACJ,CAACC,EAA0CC,IAAiB,CAC1D,MAAMC,EAAeC,EACnBX,EACAQ,EAAM,kBACR,EACMI,EAAUC,GACdb,EACAQ,EAAM,kBACR,EACMM,EAAqBN,EAAM,mBAC3BO,EAAwBC,EAAyBR,EAAM,kBAAkB,EACzES,EAAUP,EAAa,MAAM,SAASF,EAAM,KAAK,EACjDU,EAAWN,EAAQ,UAAYJ,EAAM,UAAY,GACjDW,EAAM,EAAAZ,QAAM,OAAuB,IAAI,EACvCa,KAAiB,gBA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AgB,UAClB,EACA,WAAY,CACV,cAAe,MACf,eAAgB,YAClB,CACF,CACF,EACA,gBAAiB,CACf,SAAU,EACZ,CACF,CAAC,EAUK+C,EAAkBO,EAA4B,YAClD,EAAA7C,QAAM,WACJ,CAACC,EAA0CC,IAAiB,CAC1D,KAAM,CACJ,mBAAAK,EACA,SAAAI,EAAW,GACX,YAAAmC,EAAc,aACd,IAAAC,EACA,YAAAC,EAAc,GACd,KAAAC,EAAO,GACP,SAAAC,EAAW,GACX,KAAMC,EAAW,QACjB,WAAAC,EAAa,EACb,GAAGxB,CACL,EAAI3B,EACEO,EAAwBC,EAAyBF,CAAkB,EACnE8C,KAAY,gBAAaN,CAAG,EAC5B1B,EAAc,CAClB,KAAM,cACN,IAAKgC,EACL,GAAGzB,CACL,EACM0B,KAAe,uBACnB,qBAAkB,OAAQrD,EAAM,KAAMmD,CAAU,CAClD,EACMtC,EAAO,KAAK,MAAMwC,EAAe,GAAI,EAE3C,SACE,OAACV,GAAA,CACC,MAAOrC,EACP,YAAayC,EACb,SAAUrC,EACV,KAAMG,EAEL,SAAAkC,KACC,OAAC,oBACC,QAAO,GACN,GAAGxC,EACJ,YAAasC,EACb,IAAKO,EACL,KAAMJ,EAEN,mBAACJ,EAAA,CACC,mBAAkBC,EAClB,YAAaA,EACb,KAAMA,EACN,IAAK5C,EACL,gBAAeS,EAAW,GAAK,OAC/B,SAAUuC,EACT,GAAG7B,EACN,EACF,KAEA,OAACwB,EAAA,CACC,mBAAkBC,EAClB,IAAK5C,EACL,YAAa4C,EACb,gBAAenC,EAAW,GAAK,OAC/B,SAAUuC,EACT,GAAG7B,EACN,EAEJ,CAEJ,CACF,CACF",
6
- "names": ["ToggleGroup_exports", "__export", "ToggleGroup", "createToggleGroupScope", "__toCommonJS", "import_jsx_runtime", "import_create_context", "import_focusable", "import_font_size", "import_get_size", "import_group", "import_helpers_tamagui", "import_roving_focus", "import_use_controllable_state", "import_use_direction", "import_web", "import_react", "import_Toggle", "TOGGLE_GROUP_NAME", "createToggleGroupContext", "TOGGLE_GROUP_ITEM_NAME", "createToggleGroupItemContext", "createToggleGroupItemScope", "ToggleGroupItemProvider", "useToggleGroupItemContext", "useToggleGroupItemScope", "ToggleGroupItem", "React", "props", "forwardedRef", "valueContext", "useToggleGroupValueContext", "context", "useToggleGroupContext", "__scopeToggleGroup", "rovingFocusGroupScope", "useRovingFocusGroupScope", "pressed", "disabled", "ref", "groupItemProps", "size", "sizeProps", "iconSize", "theme", "getThemedIcon", "children", "child", "commonProps", "ToggleGroupItemImpl", "value", "itemProps", "singleProps", "typeProps", "type", "toggleGroupProps", "ToggleGroupImplSingle", "ToggleGroupImplMultiple", "ToggleGroupValueProvider", "valueProp", "defaultValue", "onValueChange", "disableDeactivation", "toggleGroupSingleProps", "setValue", "ToggleGroupImpl", "toggleGroupMultipleProps", "handleButtonActivate", "itemValue", "prevValue", "handleButtonDeactivate", "ToggleGroupContext", "ToggleGroupImplElementFrame", "orientation", "dir", "rovingFocus", "loop", "unstyled", "sizeProp", "sizeAdjust", "direction", "adjustedSize"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgHgB;AAhHhB,4BAA0C;AAC1C,uBAAkC;AAClC,uBAA4B;AAC5B,sBAAkC;AAClC,mBAAgD;AAChD,6BAAiC;AACjC,0BAA8D;AAC9D,oCAAqC;AACrC,2BAA6B;AAC7B,iBAQO;AACP,mBAAkB;AAElB,oBAAiD;AAEjD,MAAM,oBAAoB;AAC1B,MAAM,CAAC,0BAA0B,sBAAsB,QAAI;AAAA,EACzD;AAAA,EACA,CAAC,+CAA2B;AAC9B;AAKA,MAAM,yBAAyB;AAI/B,MAAM,CAAC,8BAA8B,0BAA0B,QAC7D,0CAAmB,sBAAsB;AAC3C,MAAM,CAAC,yBAAyB,yBAAyB,IACvD,yBAAsD,iBAAiB;AACzE,MAAM,0BAA0B,2BAA2B;AAc3D,MAAM,kBAAkB,0BAA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HANGED
@@ -1,2 +1,19 @@
1
- "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("./ToggleGroup"),module.exports);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./ToggleGroup"), module.exports);
2
19
  //# sourceMappingURL=index.js.map