@qualcomm-ui/core 1.0.12 → 1.2.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.
Files changed (36) hide show
  1. package/dist/input/input.types.d.ts +8 -0
  2. package/dist/input/input.types.d.ts.map +1 -1
  3. package/dist/text-area/index.cjs +1 -1
  4. package/dist/text-area/index.cjs.map +4 -4
  5. package/dist/text-area/index.d.ts +4 -1
  6. package/dist/text-area/index.d.ts.map +1 -1
  7. package/dist/text-area/index.js +1 -0
  8. package/dist/text-area/index.js.map +4 -4
  9. package/dist/text-area/internal/index.d.ts +2 -0
  10. package/dist/text-area/internal/index.d.ts.map +1 -0
  11. package/dist/text-area/internal/text-area.dom.d.ts +7 -0
  12. package/dist/text-area/internal/text-area.dom.d.ts.map +1 -0
  13. package/dist/text-area/text-area.api.d.ts +4 -0
  14. package/dist/text-area/text-area.api.d.ts.map +1 -0
  15. package/dist/text-area/text-area.machine.d.ts +4 -0
  16. package/dist/text-area/text-area.machine.d.ts.map +1 -0
  17. package/dist/text-area/text-area.props.d.ts +3 -0
  18. package/dist/text-area/text-area.props.d.ts.map +1 -0
  19. package/dist/text-area/text-area.types.d.ts +121 -0
  20. package/dist/text-area/text-area.types.d.ts.map +1 -0
  21. package/dist/toggle/index.cjs +2 -0
  22. package/dist/toggle/index.cjs.map +7 -0
  23. package/dist/toggle/index.d.ts +5 -0
  24. package/dist/toggle/index.d.ts.map +1 -0
  25. package/dist/toggle/index.js +2 -0
  26. package/dist/toggle/index.js.map +7 -0
  27. package/dist/toggle/toggle.api.d.ts +4 -0
  28. package/dist/toggle/toggle.api.d.ts.map +1 -0
  29. package/dist/toggle/toggle.machine.d.ts +4 -0
  30. package/dist/toggle/toggle.machine.d.ts.map +1 -0
  31. package/dist/toggle/toggle.props.d.ts +4 -0
  32. package/dist/toggle/toggle.props.d.ts.map +1 -0
  33. package/dist/toggle/toggle.types.d.ts +72 -0
  34. package/dist/toggle/toggle.types.d.ts.map +1 -0
  35. package/dist/tsbuildinfo +1 -1
  36. package/package.json +9 -9
@@ -14,6 +14,14 @@ export interface InputLabelBindings {
14
14
  htmlFor: string;
15
15
  id: string;
16
16
  }
17
+ export interface InputCounterBindings {
18
+ "data-disabled": BooleanDataAttr;
19
+ "data-focus": BooleanDataAttr;
20
+ "data-invalid": BooleanDataAttr;
21
+ "data-max": number | undefined;
22
+ "data-part": "counter";
23
+ id: string;
24
+ }
17
25
  export interface InputErrorTextBindings {
18
26
  "aria-live": "polite";
19
27
  "data-part": "error-text";
@@ -1 +1 @@
1
- {"version":3,"file":"input.types.d.ts","sourceRoot":"","sources":["../../src/input/input.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAChB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,4BAA4B,CAAA;AAEnD,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,eAAe,CAAA;IAChC,YAAY,EAAE,eAAe,CAAA;IAC7B,cAAc,EAAE,eAAe,CAAA;IAC/B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,eAAe,CAAA;IAChC,YAAY,EAAE,eAAe,CAAA;IAC7B,cAAc,EAAE,eAAe,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,QAAQ,CAAA;IACrB,WAAW,EAAE,YAAY,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,eAAe,CAAA;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,OAAO,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,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eAAe,EAAE,eAAe,CAAA;IAChC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;CAC5C;AAED,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,OAAO,CAAA;IACrB,WAAW,EAAE,iBAAiB,CAAA;IAC9B,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,cAAc,EAAE,eAAe,CAAA;IAC/B,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,YAAY,EAAE,eAAe,CAAA;IAC7B,YAAY,EAAE,eAAe,CAAA;IAC7B,cAAc,EAAE,eAAe,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,GAAG,CAAC,iBAAiB,CAAA;IAC7B,QAAQ,EAAE,GAAG,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAClD,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,aAAa,CAAA;IAC3B,eAAe,EAAE,eAAe,CAAA;IAChC,WAAW,EAAE,eAAe,CAAA;IAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAA;CAC/B"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(o,e,x,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!c.call(o,p)&&p!==x&&t(o,p,{get:()=>e[p],enumerable:!(r=a(e,p))||r.enumerable});return o};var f=o=>d(t({},"__esModule",{value:!0}),o);var g={};module.exports=f(g);
1
+ "use strict";var A=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var n in t)A(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!C.call(e,a)&&a!==n&&A(e,a,{get:()=>t[a],enumerable:!(u=S(t,a))||u.enumerable});return e};var V=e=>P(A({},"__esModule",{value:!0}),e);var U={};I(U,{createTextAreaApi:()=>B,splitTextAreaProps:()=>L,textAreaMachine:()=>v});module.exports=V(U);var y=require("@qualcomm-ui/dom/focus-visible"),r=require("@qualcomm-ui/utils/attributes");var i={counter:e=>e.ids.get("counter"),errorText:e=>e.ids.get("errorText"),hint:e=>e.ids.get("hint"),input:e=>e.ids.get("input"),label:e=>e.ids.get("label")},x={counter:e=>e.getById(i.counter(e)),errorText:e=>e.getById(i.errorText(e)),hint:e=>e.getById(i.hint(e)),input:e=>e.getById(i.input(e)),label:e=>e.getById(i.label(e))};var c={"data-scope":"text-area"};function B(e,t){let{computed:n,context:u,prop:a,scope:o,send:p}=e,l=n("disabled"),h=a("readOnly"),f=u.get("focused"),d=a("invalid");return{disabled:l,focusInput(){p({type:"INPUT.FOCUS"})},invalid:d,maxLength:a("maxLength"),required:a("required"),setValue(s){p({type:"VALUE.SET",value:s})},value:u.get("value"),getCounterBindings(s){return o.ids.register("counter",s),t.element({...c,"data-disabled":(0,r.booleanDataAttr)(l),"data-focus":(0,r.booleanDataAttr)(f),"data-invalid":(0,r.booleanDataAttr)(d),"data-max":a("maxLength"),"data-part":"counter",dir:a("dir"),id:i.counter(o)})},getErrorTextBindings(s){return o.ids.register("errorText",s),t.element({...c,"aria-live":"polite","data-part":"error-text",dir:a("dir"),hidden:!d,id:i.errorText(o)})},getHintBindings(s){return o.ids.register("hint",s),t.element({...c,"data-disabled":(0,r.booleanDataAttr)(l),"data-part":"hint",dir:a("dir"),hidden:!!d,id:i.hint(o)})},getInputBindings(s){return o.ids.register("input",s),t.textarea({...c,"aria-describedby":(0,r.ariaAttr)(i.hint(o)),"aria-invalid":(0,r.booleanAriaAttr)(d),"aria-labelledby":(0,r.mergeAriaIds)(i.label(o),d?i.errorText(o):void 0),autoComplete:"off",autoCorrect:"off","data-disabled":(0,r.booleanDataAttr)(l),"data-empty":(0,r.booleanDataAttr)(!u.get("value")),"data-focus":(0,r.booleanDataAttr)(f),"data-invalid":(0,r.booleanDataAttr)(d),"data-part":"input","data-readonly":(0,r.booleanDataAttr)(h),defaultValue:u.get("value"),dir:a("dir"),disabled:l,form:a("form"),id:i.input(o),maxLength:a("maxLength"),name:a("name"),onBlur:()=>{p({focused:!1,focusVisible:!1,type:"FOCUSED.SET"})},onChange:g=>{p({type:"VALUE.SET",value:g.target.value})},onClick:g=>{g.defaultPrevented||l||p({type:"INPUT.FOCUS"})},onFocus:()=>{let g=(0,y.isFocusVisible)();p({focused:!0,focusVisible:g,type:"FOCUSED.SET"})},readOnly:h,required:a("required"),spellCheck:"false"})},getLabelBindings(s){return o.ids.register("label",s),t.label({...c,"data-disabled":(0,r.booleanDataAttr)(l),"data-focus":(0,r.booleanDataAttr)(f),"data-invalid":(0,r.booleanDataAttr)(d),"data-part":"label",dir:a("dir"),htmlFor:i.input(o),id:i.label(o)})},getRootBindings(){return t.element({...c,"data-disabled":(0,r.booleanDataAttr)(l),"data-focus":(0,r.booleanDataAttr)(f),"data-invalid":(0,r.booleanDataAttr)(d),"data-part":"root",dir:a("dir")})}}}var m=require("@qualcomm-ui/dom/query"),b=require("@qualcomm-ui/utils/machine");var v=(0,b.createMachine)({actions:{focusInputEl({computed:e,scope:t}){e("disabled")||x.input(t)?.focus()},setFocused({context:e,event:t}){t.type==="FOCUSED.SET"&&(e.set("focused",t.focused),e.set("focusVisible",t.focusVisible))},setValue:({context:e,event:t})=>{t.type==="VALUE.SET"&&e.set("value",t.value)},syncInputValue({context:e,scope:t}){let n=x.input(t);(0,m.raf)(()=>{(0,m.setElementValue)(n,e.get("value"))})}},computed:{disabled:({context:e,prop:t})=>t("disabled")||e.get("fieldsetDisabled")},context:({bindable:e,prop:t})=>({fieldsetDisabled:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1,onChange:t("onFocusChange")})),focusVisible:e(()=>({defaultValue:!1})),value:e(()=>({defaultValue:t("defaultValue"),onChange:t("onValueChange"),value:t("value")}))}),effects:{trackFormControlState({context:e,scope:t}){return(0,m.trackFormControl)(x.input(t),{onFieldsetDisabledChange:n=>{e.set("fieldsetDisabled",n)},onFormReset:()=>{e.set("value",e.initial("value")||"")}})}},ids:({bindableId:e,ids:t})=>({counter:e(t?.counter),errorText:e(t?.errorText),hint:e(t?.hint),input:e(t?.input),label:e(t?.label)}),initialState:()=>"idle",props({props:e}){return{defaultValue:"",dir:"ltr",...e}},states:{idle:{on:{"FOCUSED.SET":{actions:["setFocused"]},"INPUT.FOCUS":{actions:["focusInputEl"]},"VALUE.SET":{actions:["setValue"]}}}},watch({action:e,context:t,track:n}){n([()=>t.get("value")],()=>{e(["syncInputValue"])})}});var T=require("@qualcomm-ui/utils/object"),F=(0,T.createProps)()("defaultValue","dir","disabled","getRootNode","form","ids","invalid","maxLength","name","onFocusChange","onValueChange","readOnly","required","value"),L=(0,T.createSplitProps)(F);
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/text-area/index.ts"],
4
- "sourcesContent": ["export {}\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["text_area_exports", "__toCommonJS"]
3
+ "sources": ["../../src/text-area/index.ts", "../../src/text-area/text-area.api.ts", "../../src/text-area/internal/text-area.dom.ts", "../../src/text-area/text-area.machine.ts", "../../src/text-area/text-area.props.ts"],
4
+ "sourcesContent": ["export * from \"./text-area.api\"\nexport * from \"./text-area.machine\"\nexport * from \"./text-area.props\"\nexport type * from \"./text-area.types\"\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isFocusVisible} from \"@qualcomm-ui/dom/focus-visible\"\nimport {\n ariaAttr,\n booleanAriaAttr,\n booleanDataAttr,\n mergeAriaIds,\n} from \"@qualcomm-ui/utils/attributes\"\nimport type {\n IdRegistrationProps,\n Machine,\n PropNormalizer,\n} from \"@qualcomm-ui/utils/machine\"\n\nimport {domIds} from \"./internal\"\nimport type {\n TextAreaApi,\n TextAreaCounterBindings,\n TextAreaErrorTextBindings,\n TextAreaHintBindings,\n TextAreaInputBindings,\n TextAreaLabelBindings,\n TextAreaRootBindings,\n TextAreaSchema,\n TextAreaScopeAttribute,\n} from \"./text-area.types\"\n\nconst commonBindings: TextAreaScopeAttribute = {\n \"data-scope\": \"text-area\",\n}\n\nexport function createTextAreaApi(\n machine: Machine<TextAreaSchema>,\n normalize: PropNormalizer,\n): TextAreaApi {\n const {computed, context, prop, scope, send} = machine\n\n const disabled = computed(\"disabled\")\n const readOnly = prop(\"readOnly\")\n const focused = context.get(\"focused\")\n const invalid = prop(\"invalid\")\n\n return {\n disabled,\n focusInput(): void {\n send({type: \"INPUT.FOCUS\"})\n },\n invalid,\n maxLength: prop(\"maxLength\"),\n required: prop(\"required\"),\n setValue(value: string) {\n send({type: \"VALUE.SET\", value})\n },\n value: context.get(\"value\"),\n\n // group: prop getters\n getCounterBindings(props: IdRegistrationProps): TextAreaCounterBindings {\n scope.ids.register(\"counter\", props)\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-max\": prop(\"maxLength\"),\n \"data-part\": \"counter\",\n dir: prop(\"dir\"),\n id: domIds.counter(scope),\n })\n },\n getErrorTextBindings(\n props: IdRegistrationProps,\n ): TextAreaErrorTextBindings {\n scope.ids.register(\"errorText\", props)\n return normalize.element({\n ...commonBindings,\n \"aria-live\": \"polite\",\n \"data-part\": \"error-text\",\n dir: prop(\"dir\"),\n hidden: !invalid,\n id: domIds.errorText(scope),\n })\n },\n getHintBindings(props: IdRegistrationProps): TextAreaHintBindings {\n scope.ids.register(\"hint\", props)\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-part\": \"hint\",\n dir: prop(\"dir\"),\n hidden: !!invalid,\n id: domIds.hint(scope),\n })\n },\n /**\n * TODO\n * we probably want autoCorrect / spellCheck to be toggles (what about\n * autoComplete?)\n */\n getInputBindings(props: IdRegistrationProps): TextAreaInputBindings {\n scope.ids.register(\"input\", props)\n return normalize.textarea({\n ...commonBindings,\n \"aria-describedby\": ariaAttr(domIds.hint(scope)),\n \"aria-invalid\": booleanAriaAttr(invalid),\n \"aria-labelledby\": mergeAriaIds(\n domIds.label(scope),\n invalid ? domIds.errorText(scope) : undefined,\n ),\n autoComplete: \"off\",\n autoCorrect: \"off\",\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-empty\": booleanDataAttr(!context.get(\"value\")),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"input\",\n \"data-readonly\": booleanDataAttr(readOnly),\n defaultValue: context.get(\"value\"),\n dir: prop(\"dir\"),\n disabled,\n form: prop(\"form\"),\n id: domIds.input(scope),\n maxLength: prop(\"maxLength\"),\n name: prop(\"name\"),\n onBlur: () => {\n send({\n focused: false,\n focusVisible: false,\n type: \"FOCUSED.SET\",\n })\n },\n onChange: (event) => {\n send({type: \"VALUE.SET\", value: event.target.value})\n },\n onClick: (event) => {\n if (event.defaultPrevented || disabled) {\n return\n }\n send({type: \"INPUT.FOCUS\"})\n },\n onFocus: () => {\n const focusVisible = isFocusVisible()\n send({focused: true, focusVisible, type: \"FOCUSED.SET\"})\n },\n readOnly,\n required: prop(\"required\"),\n spellCheck: \"false\",\n })\n },\n getLabelBindings(props: IdRegistrationProps): TextAreaLabelBindings {\n scope.ids.register(\"label\", props)\n return normalize.label({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"label\",\n dir: prop(\"dir\"),\n htmlFor: domIds.input(scope),\n id: domIds.label(scope),\n })\n },\n getRootBindings(): TextAreaRootBindings {\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"root\",\n dir: prop(\"dir\"),\n })\n },\n }\n}\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ScopeDomElements, ScopeDomIds} from \"@qualcomm-ui/utils/machine\"\n\nimport type {TextAreaElementIds, TextAreaScope} from \"../text-area.types\"\n\nexport const domIds: ScopeDomIds<TextAreaElementIds, TextAreaScope> = {\n counter: (scope) => scope.ids.get(\"counter\"),\n errorText: (scope) => scope.ids.get(\"errorText\"),\n hint: (scope) => scope.ids.get(\"hint\"),\n input: (scope) => scope.ids.get(\"input\"),\n label: (scope) => scope.ids.get(\"label\"),\n}\n\nexport const domEls: ScopeDomElements<\n TextAreaElementIds,\n TextAreaScope,\n {input: HTMLTextAreaElement | null}\n> = {\n counter: (scope) => scope.getById(domIds.counter(scope)),\n errorText: (scope) => scope.getById(domIds.errorText(scope)),\n hint: (scope) => scope.getById(domIds.hint(scope)),\n input: (scope: TextAreaScope) => scope.getById(domIds.input(scope)),\n label: (scope) => scope.getById(domIds.label(scope)),\n}\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {raf, setElementValue, trackFormControl} from \"@qualcomm-ui/dom/query\"\nimport {createMachine, type MachineConfig} from \"@qualcomm-ui/utils/machine\"\n\nimport {domEls} from \"./internal\"\nimport type {TextAreaSchema} from \"./text-area.types\"\n\nexport const textAreaMachine: MachineConfig<TextAreaSchema> = createMachine({\n actions: {\n focusInputEl({computed, scope}) {\n if (!computed(\"disabled\")) {\n domEls.input(scope)?.focus()\n }\n },\n setFocused({context, event}) {\n if (event.type !== \"FOCUSED.SET\") {\n return\n }\n context.set(\"focused\", event.focused)\n context.set(\"focusVisible\", event.focusVisible)\n },\n setValue: ({context, event}) => {\n if (event.type === \"VALUE.SET\") {\n context.set(\"value\", event.value)\n }\n },\n syncInputValue({context, scope}) {\n const inputEl = domEls.input(scope)\n raf(() => {\n setElementValue(inputEl, context.get(\"value\"))\n })\n },\n },\n computed: {\n disabled: ({context, prop}) =>\n prop(\"disabled\") || context.get(\"fieldsetDisabled\"),\n },\n context: ({bindable, prop}) => {\n return {\n fieldsetDisabled: bindable<boolean>(() => ({defaultValue: false})),\n focused: bindable<boolean>(() => ({\n defaultValue: false,\n onChange: prop(\"onFocusChange\"),\n })),\n focusVisible: bindable<boolean>(() => ({defaultValue: false})),\n value: bindable<string>(() => ({\n defaultValue: prop(\"defaultValue\"),\n onChange: prop(\"onValueChange\"),\n value: prop(\"value\"),\n })),\n }\n },\n effects: {\n trackFormControlState({context, scope}) {\n return trackFormControl(domEls.input(scope), {\n onFieldsetDisabledChange: (disabled) => {\n context.set(\"fieldsetDisabled\", disabled)\n },\n onFormReset: () => {\n context.set(\"value\", context.initial(\"value\") || \"\")\n },\n })\n },\n },\n ids: ({bindableId, ids}) => {\n return {\n counter: bindableId<string>(ids?.counter),\n errorText: bindableId<string>(ids?.errorText),\n hint: bindableId<string>(ids?.hint),\n input: bindableId<string>(ids?.input),\n label: bindableId<string>(ids?.label),\n }\n },\n initialState: () => \"idle\",\n props({props}) {\n return {\n defaultValue: \"\",\n dir: \"ltr\",\n ...props,\n }\n },\n states: {\n idle: {\n on: {\n \"FOCUSED.SET\": {\n actions: [\"setFocused\"],\n },\n \"INPUT.FOCUS\": {\n actions: [\"focusInputEl\"],\n },\n \"VALUE.SET\": {\n actions: [\"setValue\"],\n },\n },\n },\n },\n watch({action, context, track}) {\n track([() => context.get(\"value\")], () => {\n action([\"syncInputValue\"])\n })\n },\n})\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createProps, createSplitProps} from \"@qualcomm-ui/utils/object\"\n\nimport type {TextAreaApiProps} from \"./text-area.types\"\n\nconst textAreaProps: (keyof TextAreaApiProps)[] =\n createProps<TextAreaApiProps>()(\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"getRootNode\",\n \"form\",\n \"ids\",\n \"invalid\",\n \"maxLength\",\n \"name\",\n \"onFocusChange\",\n \"onValueChange\",\n \"readOnly\",\n \"required\",\n \"value\",\n )\n\nexport const splitTextAreaProps: <Props extends TextAreaApiProps>(\n props: Props,\n) => [TextAreaApiProps, Omit<Props, keyof TextAreaApiProps>] =\n createSplitProps<TextAreaApiProps>(textAreaProps)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,uBAAAC,EAAA,oBAAAC,IAAA,eAAAC,EAAAL,GCGA,IAAAM,EAA6B,0CAC7BC,EAKO,yCCFA,IAAMC,EAAyD,CACpE,QAAUC,GAAUA,EAAM,IAAI,IAAI,SAAS,EAC3C,UAAYA,GAAUA,EAAM,IAAI,IAAI,WAAW,EAC/C,KAAOA,GAAUA,EAAM,IAAI,IAAI,MAAM,EACrC,MAAQA,GAAUA,EAAM,IAAI,IAAI,OAAO,EACvC,MAAQA,GAAUA,EAAM,IAAI,IAAI,OAAO,CACzC,EAEaC,EAIT,CACF,QAAUD,GAAUA,EAAM,QAAQD,EAAO,QAAQC,CAAK,CAAC,EACvD,UAAYA,GAAUA,EAAM,QAAQD,EAAO,U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EACA,YAAa,CACX,QAAS,CAAC,UAAU,CACtB,CACF,CACF,CACF,EACA,MAAM,CAAC,OAAAC,EAAQ,QAAAT,EAAS,MAAAU,CAAK,EAAG,CAC9BA,EAAM,CAAC,IAAMV,EAAQ,IAAI,OAAO,CAAC,EAAG,IAAM,CACxCS,EAAO,CAAC,gBAAgB,CAAC,CAC3B,CAAC,CACH,CACF,CAAC,ECpGD,IAAAE,EAA4C,qCAItCC,KACJ,eAA8B,EAC5B,eACA,MACA,WACA,cACA,OACA,MACA,UACA,YACA,OACA,gBACA,gBACA,WACA,WACA,OACF,EAEWC,KAGX,oBAAmCD,CAAa",
6
+ "names": ["text_area_exports", "__export", "createTextAreaApi", "splitTextAreaProps", "textAreaMachine", "__toCommonJS", "import_focus_visible", "import_attributes", "domIds", "scope", "domEls", "commonBindings", "createTextAreaApi", "machine", "normalize", "computed", "context", "prop", "scope", "send", "disabled", "readOnly", "focused", "invalid", "value", "props", "domIds", "event", "focusVisible", "import_query", "import_machine", "textAreaMachine", "computed", "scope", "domEls", "context", "event", "inputEl", "prop", "bindable", "disabled", "bindableId", "ids", "props", "action", "track", "import_object", "textAreaProps", "splitTextAreaProps"]
7
7
  }
@@ -1,2 +1,5 @@
1
- export {};
1
+ export * from "./text-area.api";
2
+ export * from "./text-area.machine";
3
+ export * from "./text-area.props";
4
+ export type * from "./text-area.types";
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text-area/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text-area/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,mBAAmB,mBAAmB,CAAA"}
@@ -1 +1,2 @@
1
+ import{isFocusVisible as T}from"@qualcomm-ui/dom/focus-visible";import{ariaAttr as A,booleanAriaAttr as h,booleanDataAttr as i,mergeAriaIds as y}from"@qualcomm-ui/utils/attributes";var a={counter:e=>e.ids.get("counter"),errorText:e=>e.ids.get("errorText"),hint:e=>e.ids.get("hint"),input:e=>e.ids.get("input"),label:e=>e.ids.get("label")},f={counter:e=>e.getById(a.counter(e)),errorText:e=>e.getById(a.errorText(e)),hint:e=>e.getById(a.hint(e)),input:e=>e.getById(a.input(e)),label:e=>e.getById(a.label(e))};var p={"data-scope":"text-area"};function U(e,t){let{computed:l,context:m,prop:r,scope:o,send:u}=e,d=l("disabled"),x=r("readOnly"),g=m.get("focused"),s=r("invalid");return{disabled:d,focusInput(){u({type:"INPUT.FOCUS"})},invalid:s,maxLength:r("maxLength"),required:r("required"),setValue(n){u({type:"VALUE.SET",value:n})},value:m.get("value"),getCounterBindings(n){return o.ids.register("counter",n),t.element({...p,"data-disabled":i(d),"data-focus":i(g),"data-invalid":i(s),"data-max":r("maxLength"),"data-part":"counter",dir:r("dir"),id:a.counter(o)})},getErrorTextBindings(n){return o.ids.register("errorText",n),t.element({...p,"aria-live":"polite","data-part":"error-text",dir:r("dir"),hidden:!s,id:a.errorText(o)})},getHintBindings(n){return o.ids.register("hint",n),t.element({...p,"data-disabled":i(d),"data-part":"hint",dir:r("dir"),hidden:!!s,id:a.hint(o)})},getInputBindings(n){return o.ids.register("input",n),t.textarea({...p,"aria-describedby":A(a.hint(o)),"aria-invalid":h(s),"aria-labelledby":y(a.label(o),s?a.errorText(o):void 0),autoComplete:"off",autoCorrect:"off","data-disabled":i(d),"data-empty":i(!m.get("value")),"data-focus":i(g),"data-invalid":i(s),"data-part":"input","data-readonly":i(x),defaultValue:m.get("value"),dir:r("dir"),disabled:d,form:r("form"),id:a.input(o),maxLength:r("maxLength"),name:r("name"),onBlur:()=>{u({focused:!1,focusVisible:!1,type:"FOCUSED.SET"})},onChange:c=>{u({type:"VALUE.SET",value:c.target.value})},onClick:c=>{c.defaultPrevented||d||u({type:"INPUT.FOCUS"})},onFocus:()=>{let c=T();u({focused:!0,focusVisible:c,type:"FOCUSED.SET"})},readOnly:x,required:r("required"),spellCheck:"false"})},getLabelBindings(n){return o.ids.register("label",n),t.label({...p,"data-disabled":i(d),"data-focus":i(g),"data-invalid":i(s),"data-part":"label",dir:r("dir"),htmlFor:a.input(o),id:a.label(o)})},getRootBindings(){return t.element({...p,"data-disabled":i(d),"data-focus":i(g),"data-invalid":i(s),"data-part":"root",dir:r("dir")})}}}import{raf as b,setElementValue as S,trackFormControl as E}from"@qualcomm-ui/dom/query";import{createMachine as C}from"@qualcomm-ui/utils/machine";var M=C({actions:{focusInputEl({computed:e,scope:t}){e("disabled")||f.input(t)?.focus()},setFocused({context:e,event:t}){t.type==="FOCUSED.SET"&&(e.set("focused",t.focused),e.set("focusVisible",t.focusVisible))},setValue:({context:e,event:t})=>{t.type==="VALUE.SET"&&e.set("value",t.value)},syncInputValue({context:e,scope:t}){let l=f.input(t);b(()=>{S(l,e.get("value"))})}},computed:{disabled:({context:e,prop:t})=>t("disabled")||e.get("fieldsetDisabled")},context:({bindable:e,prop:t})=>({fieldsetDisabled:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1,onChange:t("onFocusChange")})),focusVisible:e(()=>({defaultValue:!1})),value:e(()=>({defaultValue:t("defaultValue"),onChange:t("onValueChange"),value:t("value")}))}),effects:{trackFormControlState({context:e,scope:t}){return E(f.input(t),{onFieldsetDisabledChange:l=>{e.set("fieldsetDisabled",l)},onFormReset:()=>{e.set("value",e.initial("value")||"")}})}},ids:({bindableId:e,ids:t})=>({counter:e(t?.counter),errorText:e(t?.errorText),hint:e(t?.hint),input:e(t?.input),label:e(t?.label)}),initialState:()=>"idle",props({props:e}){return{defaultValue:"",dir:"ltr",...e}},states:{idle:{on:{"FOCUSED.SET":{actions:["setFocused"]},"INPUT.FOCUS":{actions:["focusInputEl"]},"VALUE.SET":{actions:["setValue"]}}}},watch({action:e,context:t,track:l}){l([()=>t.get("value")],()=>{e(["syncInputValue"])})}});import{createProps as I,createSplitProps as P}from"@qualcomm-ui/utils/object";var V=I()("defaultValue","dir","disabled","getRootNode","form","ids","invalid","maxLength","name","onFocusChange","onValueChange","readOnly","required","value"),H=P(V);export{U as createTextAreaApi,H as splitTextAreaProps,M as textAreaMachine};
1
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
3
+ "sources": ["../../src/text-area/text-area.api.ts", "../../src/text-area/internal/text-area.dom.ts", "../../src/text-area/text-area.machine.ts", "../../src/text-area/text-area.props.ts"],
4
+ "sourcesContent": ["// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isFocusVisible} from \"@qualcomm-ui/dom/focus-visible\"\nimport {\n ariaAttr,\n booleanAriaAttr,\n booleanDataAttr,\n mergeAriaIds,\n} from \"@qualcomm-ui/utils/attributes\"\nimport type {\n IdRegistrationProps,\n Machine,\n PropNormalizer,\n} from \"@qualcomm-ui/utils/machine\"\n\nimport {domIds} from \"./internal\"\nimport type {\n TextAreaApi,\n TextAreaCounterBindings,\n TextAreaErrorTextBindings,\n TextAreaHintBindings,\n TextAreaInputBindings,\n TextAreaLabelBindings,\n TextAreaRootBindings,\n TextAreaSchema,\n TextAreaScopeAttribute,\n} from \"./text-area.types\"\n\nconst commonBindings: TextAreaScopeAttribute = {\n \"data-scope\": \"text-area\",\n}\n\nexport function createTextAreaApi(\n machine: Machine<TextAreaSchema>,\n normalize: PropNormalizer,\n): TextAreaApi {\n const {computed, context, prop, scope, send} = machine\n\n const disabled = computed(\"disabled\")\n const readOnly = prop(\"readOnly\")\n const focused = context.get(\"focused\")\n const invalid = prop(\"invalid\")\n\n return {\n disabled,\n focusInput(): void {\n send({type: \"INPUT.FOCUS\"})\n },\n invalid,\n maxLength: prop(\"maxLength\"),\n required: prop(\"required\"),\n setValue(value: string) {\n send({type: \"VALUE.SET\", value})\n },\n value: context.get(\"value\"),\n\n // group: prop getters\n getCounterBindings(props: IdRegistrationProps): TextAreaCounterBindings {\n scope.ids.register(\"counter\", props)\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-max\": prop(\"maxLength\"),\n \"data-part\": \"counter\",\n dir: prop(\"dir\"),\n id: domIds.counter(scope),\n })\n },\n getErrorTextBindings(\n props: IdRegistrationProps,\n ): TextAreaErrorTextBindings {\n scope.ids.register(\"errorText\", props)\n return normalize.element({\n ...commonBindings,\n \"aria-live\": \"polite\",\n \"data-part\": \"error-text\",\n dir: prop(\"dir\"),\n hidden: !invalid,\n id: domIds.errorText(scope),\n })\n },\n getHintBindings(props: IdRegistrationProps): TextAreaHintBindings {\n scope.ids.register(\"hint\", props)\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-part\": \"hint\",\n dir: prop(\"dir\"),\n hidden: !!invalid,\n id: domIds.hint(scope),\n })\n },\n /**\n * TODO\n * we probably want autoCorrect / spellCheck to be toggles (what about\n * autoComplete?)\n */\n getInputBindings(props: IdRegistrationProps): TextAreaInputBindings {\n scope.ids.register(\"input\", props)\n return normalize.textarea({\n ...commonBindings,\n \"aria-describedby\": ariaAttr(domIds.hint(scope)),\n \"aria-invalid\": booleanAriaAttr(invalid),\n \"aria-labelledby\": mergeAriaIds(\n domIds.label(scope),\n invalid ? domIds.errorText(scope) : undefined,\n ),\n autoComplete: \"off\",\n autoCorrect: \"off\",\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-empty\": booleanDataAttr(!context.get(\"value\")),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"input\",\n \"data-readonly\": booleanDataAttr(readOnly),\n defaultValue: context.get(\"value\"),\n dir: prop(\"dir\"),\n disabled,\n form: prop(\"form\"),\n id: domIds.input(scope),\n maxLength: prop(\"maxLength\"),\n name: prop(\"name\"),\n onBlur: () => {\n send({\n focused: false,\n focusVisible: false,\n type: \"FOCUSED.SET\",\n })\n },\n onChange: (event) => {\n send({type: \"VALUE.SET\", value: event.target.value})\n },\n onClick: (event) => {\n if (event.defaultPrevented || disabled) {\n return\n }\n send({type: \"INPUT.FOCUS\"})\n },\n onFocus: () => {\n const focusVisible = isFocusVisible()\n send({focused: true, focusVisible, type: \"FOCUSED.SET\"})\n },\n readOnly,\n required: prop(\"required\"),\n spellCheck: \"false\",\n })\n },\n getLabelBindings(props: IdRegistrationProps): TextAreaLabelBindings {\n scope.ids.register(\"label\", props)\n return normalize.label({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"label\",\n dir: prop(\"dir\"),\n htmlFor: domIds.input(scope),\n id: domIds.label(scope),\n })\n },\n getRootBindings(): TextAreaRootBindings {\n return normalize.element({\n ...commonBindings,\n \"data-disabled\": booleanDataAttr(disabled),\n \"data-focus\": booleanDataAttr(focused),\n \"data-invalid\": booleanDataAttr(invalid),\n \"data-part\": \"root\",\n dir: prop(\"dir\"),\n })\n },\n }\n}\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ScopeDomElements, ScopeDomIds} from \"@qualcomm-ui/utils/machine\"\n\nimport type {TextAreaElementIds, TextAreaScope} from \"../text-area.types\"\n\nexport const domIds: ScopeDomIds<TextAreaElementIds, TextAreaScope> = {\n counter: (scope) => scope.ids.get(\"counter\"),\n errorText: (scope) => scope.ids.get(\"errorText\"),\n hint: (scope) => scope.ids.get(\"hint\"),\n input: (scope) => scope.ids.get(\"input\"),\n label: (scope) => scope.ids.get(\"label\"),\n}\n\nexport const domEls: ScopeDomElements<\n TextAreaElementIds,\n TextAreaScope,\n {input: HTMLTextAreaElement | null}\n> = {\n counter: (scope) => scope.getById(domIds.counter(scope)),\n errorText: (scope) => scope.getById(domIds.errorText(scope)),\n hint: (scope) => scope.getById(domIds.hint(scope)),\n input: (scope: TextAreaScope) => scope.getById(domIds.input(scope)),\n label: (scope) => scope.getById(domIds.label(scope)),\n}\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {raf, setElementValue, trackFormControl} from \"@qualcomm-ui/dom/query\"\nimport {createMachine, type MachineConfig} from \"@qualcomm-ui/utils/machine\"\n\nimport {domEls} from \"./internal\"\nimport type {TextAreaSchema} from \"./text-area.types\"\n\nexport const textAreaMachine: MachineConfig<TextAreaSchema> = createMachine({\n actions: {\n focusInputEl({computed, scope}) {\n if (!computed(\"disabled\")) {\n domEls.input(scope)?.focus()\n }\n },\n setFocused({context, event}) {\n if (event.type !== \"FOCUSED.SET\") {\n return\n }\n context.set(\"focused\", event.focused)\n context.set(\"focusVisible\", event.focusVisible)\n },\n setValue: ({context, event}) => {\n if (event.type === \"VALUE.SET\") {\n context.set(\"value\", event.value)\n }\n },\n syncInputValue({context, scope}) {\n const inputEl = domEls.input(scope)\n raf(() => {\n setElementValue(inputEl, context.get(\"value\"))\n })\n },\n },\n computed: {\n disabled: ({context, prop}) =>\n prop(\"disabled\") || context.get(\"fieldsetDisabled\"),\n },\n context: ({bindable, prop}) => {\n return {\n fieldsetDisabled: bindable<boolean>(() => ({defaultValue: false})),\n focused: bindable<boolean>(() => ({\n defaultValue: false,\n onChange: prop(\"onFocusChange\"),\n })),\n focusVisible: bindable<boolean>(() => ({defaultValue: false})),\n value: bindable<string>(() => ({\n defaultValue: prop(\"defaultValue\"),\n onChange: prop(\"onValueChange\"),\n value: prop(\"value\"),\n })),\n }\n },\n effects: {\n trackFormControlState({context, scope}) {\n return trackFormControl(domEls.input(scope), {\n onFieldsetDisabledChange: (disabled) => {\n context.set(\"fieldsetDisabled\", disabled)\n },\n onFormReset: () => {\n context.set(\"value\", context.initial(\"value\") || \"\")\n },\n })\n },\n },\n ids: ({bindableId, ids}) => {\n return {\n counter: bindableId<string>(ids?.counter),\n errorText: bindableId<string>(ids?.errorText),\n hint: bindableId<string>(ids?.hint),\n input: bindableId<string>(ids?.input),\n label: bindableId<string>(ids?.label),\n }\n },\n initialState: () => \"idle\",\n props({props}) {\n return {\n defaultValue: \"\",\n dir: \"ltr\",\n ...props,\n }\n },\n states: {\n idle: {\n on: {\n \"FOCUSED.SET\": {\n actions: [\"setFocused\"],\n },\n \"INPUT.FOCUS\": {\n actions: [\"focusInputEl\"],\n },\n \"VALUE.SET\": {\n actions: [\"setValue\"],\n },\n },\n },\n },\n watch({action, context, track}) {\n track([() => context.get(\"value\")], () => {\n action([\"syncInputValue\"])\n })\n },\n})\n", "// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createProps, createSplitProps} from \"@qualcomm-ui/utils/object\"\n\nimport type {TextAreaApiProps} from \"./text-area.types\"\n\nconst textAreaProps: (keyof TextAreaApiProps)[] =\n createProps<TextAreaApiProps>()(\n \"defaultValue\",\n \"dir\",\n \"disabled\",\n \"getRootNode\",\n \"form\",\n \"ids\",\n \"invalid\",\n \"maxLength\",\n \"name\",\n \"onFocusChange\",\n \"onValueChange\",\n \"readOnly\",\n \"required\",\n \"value\",\n )\n\nexport const splitTextAreaProps: <Props extends TextAreaApiProps>(\n props: Props,\n) => [TextAreaApiProps, Omit<Props, keyof TextAreaApiProps>] =\n createSplitProps<TextAreaApiProps>(textAreaProps)\n"],
5
+ "mappings": "AAGA,OAAQ,kBAAAA,MAAqB,iCAC7B,OACE,YAAAC,EACA,mBAAAC,EACA,mBAAAC,EACA,gBAAAC,MACK,gCCFA,IAAMC,EAAyD,CACpE,QAAUC,GAAUA,EAAM,IAAI,IAAI,SAAS,EAC3C,UAAYA,GAAUA,EAAM,IAAI,IAAI,WA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AI,EAClC,MAAOD,EAAmBC,GAAK,KAAK,EACpC,MAAOD,EAAmBC,GAAK,KAAK,CACtC,GAEF,aAAc,IAAM,OACpB,MAAM,CAAC,MAAAC,CAAK,EAAG,CACb,MAAO,CACL,aAAc,GACd,IAAK,MACL,GAAGA,CACL,CACF,EACA,OAAQ,CACN,KAAM,CACJ,GAAI,CACF,cAAe,CACb,QAAS,CAAC,YAAY,CACxB,EACA,cAAe,CACb,QAAS,CAAC,cAAc,CAC1B,EACA,YAAa,CACX,QAAS,CAAC,UAAU,CACtB,CACF,CACF,CACF,EACA,MAAM,CAAC,OAAAC,EAAQ,QAAAZ,EAAS,MAAAa,CAAK,EAAG,CAC9BA,EAAM,CAAC,IAAMb,EAAQ,IAAI,OAAO,CAAC,EAAG,IAAM,CACxCY,EAAO,CAAC,gBAAgB,CAAC,CAC3B,CAAC,CACH,CACF,CAAC,ECpGD,OAAQ,eAAAE,EAAa,oBAAAC,MAAuB,4BAI5C,IAAMC,EACJF,EAA8B,EAC5B,eACA,MACA,WACA,cACA,OACA,MACA,UACA,YACA,OACA,gBACA,gBACA,WACA,WACA,OACF,EAEWG,EAGXF,EAAmCC,CAAa",
6
+ "names": ["isFocusVisible", "ariaAttr", "booleanAriaAttr", "booleanDataAttr", "mergeAriaIds", "domIds", "scope", "domEls", "commonBindings", "createTextAreaApi", "machine", "normalize", "computed", "context", "prop", "scope", "send", "disabled", "readOnly", "focused", "invalid", "value", "props", "booleanDataAttr", "domIds", "ariaAttr", "booleanAriaAttr", "mergeAriaIds", "event", "focusVisible", "isFocusVisible", "raf", "setElementValue", "trackFormControl", "createMachine", "textAreaMachine", "createMachine", "computed", "scope", "domEls", "context", "event", "inputEl", "raf", "setElementValue", "prop", "bindable", "trackFormControl", "disabled", "bindableId", "ids", "props", "action", "track", "createProps", "createSplitProps", "textAreaProps", "splitTextAreaProps"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ export * from "./text-area.dom";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/text-area/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ScopeDomElements, ScopeDomIds } from "@qualcomm-ui/utils/machine";
2
+ import type { TextAreaElementIds, TextAreaScope } from "../text-area.types";
3
+ export declare const domIds: ScopeDomIds<TextAreaElementIds, TextAreaScope>;
4
+ export declare const domEls: ScopeDomElements<TextAreaElementIds, TextAreaScope, {
5
+ input: HTMLTextAreaElement | null;
6
+ }>;
7
+ //# sourceMappingURL=text-area.dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.dom.d.ts","sourceRoot":"","sources":["../../../src/text-area/internal/text-area.dom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,4BAA4B,CAAA;AAE7E,OAAO,KAAK,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAEzE,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,kBAAkB,EAAE,aAAa,CAMjE,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,gBAAgB,CACnC,kBAAkB,EAClB,aAAa,EACb;IAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAA;CAAC,CAOpC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Machine, PropNormalizer } from "@qualcomm-ui/utils/machine";
2
+ import type { TextAreaApi, TextAreaSchema } from "./text-area.types";
3
+ export declare function createTextAreaApi(machine: Machine<TextAreaSchema>, normalize: PropNormalizer): TextAreaApi;
4
+ //# sourceMappingURL=text-area.api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.api.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area.api.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,OAAO,EACP,cAAc,EACf,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EACV,WAAW,EAOX,cAAc,EAEf,MAAM,mBAAmB,CAAA;AAM1B,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,EAChC,SAAS,EAAE,cAAc,GACxB,WAAW,CA0Ib"}
@@ -0,0 +1,4 @@
1
+ import { type MachineConfig } from "@qualcomm-ui/utils/machine";
2
+ import type { TextAreaSchema } from "./text-area.types";
3
+ export declare const textAreaMachine: MachineConfig<TextAreaSchema>;
4
+ //# sourceMappingURL=text-area.machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.machine.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area.machine.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,aAAa,EAAC,MAAM,4BAA4B,CAAA;AAG5E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,cAAc,CA8FxD,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { TextAreaApiProps } from "./text-area.types";
2
+ export declare const splitTextAreaProps: <Props extends TextAreaApiProps>(props: Props) => [TextAreaApiProps, Omit<Props, keyof TextAreaApiProps>];
3
+ //# sourceMappingURL=text-area.props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.props.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area.props.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AAoBvD,eAAO,MAAM,kBAAkB,EAAE,CAAC,KAAK,SAAS,gBAAgB,EAC9D,KAAK,EAAE,KAAK,KACT,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,gBAAgB,CAAC,CACR,CAAA"}
@@ -0,0 +1,121 @@
1
+ import type { FieldApiProps } from "@qualcomm-ui/core/field";
2
+ import type { InputCounterBindings, InputErrorTextBindings, InputHintBindings, InputInputBindings, InputLabelBindings, InputRootBindings } from "@qualcomm-ui/core/input";
3
+ import type { BooleanDataAttr } from "@qualcomm-ui/utils/attributes";
4
+ import type { DirectionProperty } from "@qualcomm-ui/utils/direction";
5
+ import type { RequiredBy } from "@qualcomm-ui/utils/guard";
6
+ import type { ActionSchema, CommonProperties, EffectSchema, IdRegistrationProps, JSX, MachineSchema, ScopeWithIds } from "@qualcomm-ui/utils/machine";
7
+ export interface TextAreaElementIds {
8
+ counter: string;
9
+ errorText: string;
10
+ hint: string;
11
+ input: string;
12
+ label: string;
13
+ }
14
+ export interface TextAreaApiProps extends FieldApiProps, CommonProperties, DirectionProperty {
15
+ /**
16
+ * The initial value of the input when rendered.
17
+ * Use when you don't need to control the value of the input.
18
+ */
19
+ defaultValue?: string | undefined;
20
+ /**
21
+ * The id of the form that the input belongs to.
22
+ */
23
+ form?: string | undefined;
24
+ /**
25
+ * The ids of the elements that are associated with the input. These will be
26
+ * automatically generated if omitted.
27
+ */
28
+ ids?: TextAreaElementIds | undefined;
29
+ /**
30
+ * The maximum number of characters allowed in the textarea.
31
+ */
32
+ maxLength?: number | undefined;
33
+ /**
34
+ * The name of the input field. Useful for form submission.
35
+ */
36
+ name?: string | undefined;
37
+ /**
38
+ * The callback invoked when the field is focused or blurred.
39
+ */
40
+ onFocusChange?: ((focused: boolean) => void) | undefined;
41
+ /**
42
+ * The callback invoked when the value changes.
43
+ */
44
+ onValueChange?: ((value: string) => void) | undefined;
45
+ /**
46
+ * The controlled value of the input
47
+ */
48
+ value?: string | undefined;
49
+ }
50
+ export interface TextAreaScope extends ScopeWithIds<TextAreaSchema> {
51
+ }
52
+ interface TextAreaContext {
53
+ fieldsetDisabled: boolean;
54
+ focused: boolean;
55
+ focusVisible: boolean;
56
+ value: string;
57
+ }
58
+ export interface TextAreaSchema extends MachineSchema {
59
+ actions: ActionSchema<"setValue" | "setFocused" | "focusInputEl" | "syncInputValue">;
60
+ computed: {
61
+ disabled: boolean;
62
+ };
63
+ context: TextAreaContext;
64
+ effects: EffectSchema<"trackFormControlState">;
65
+ events: {
66
+ focused: boolean;
67
+ focusVisible: boolean;
68
+ type: "FOCUSED.SET";
69
+ } | {
70
+ type: "VALUE.SET";
71
+ value: string;
72
+ } | {
73
+ type: "INPUT.FOCUS";
74
+ };
75
+ ids: TextAreaElementIds;
76
+ props: RequiredBy<TextAreaApiProps, "defaultValue" | "dir">;
77
+ state: "idle";
78
+ }
79
+ export interface TextAreaScopeAttribute {
80
+ "data-scope": "text-area";
81
+ }
82
+ interface CommonBindings extends Required<DirectionProperty>, TextAreaScopeAttribute {
83
+ }
84
+ export interface TextAreaRootBindings extends CommonBindings, InputRootBindings {
85
+ }
86
+ export interface TextAreaLabelBindings extends CommonBindings, InputLabelBindings {
87
+ }
88
+ export interface TextAreaCounterBindings extends CommonBindings, InputCounterBindings {
89
+ }
90
+ export interface TextAreaErrorTextBindings extends CommonBindings, InputErrorTextBindings {
91
+ }
92
+ export interface TextAreaHintBindings extends CommonBindings, InputHintBindings {
93
+ hidden: boolean;
94
+ }
95
+ export interface TextAreaInputBindings extends CommonBindings, Omit<InputInputBindings, "onChange"> {
96
+ autoComplete: "off";
97
+ autoCorrect: "off";
98
+ "data-disabled": BooleanDataAttr;
99
+ "data-readonly": BooleanDataAttr;
100
+ onChange: JSX.ChangeEventHandler<HTMLTextAreaElement>;
101
+ onClick: JSX.MouseEventHandler<HTMLElement>;
102
+ readOnly: boolean | undefined;
103
+ spellCheck: "false";
104
+ }
105
+ export interface TextAreaApi {
106
+ disabled: boolean | undefined;
107
+ focusInput(): void;
108
+ invalid: boolean | undefined;
109
+ maxLength: number | undefined;
110
+ required: boolean | undefined;
111
+ setValue(value: string): void;
112
+ value: string;
113
+ getCounterBindings(props: IdRegistrationProps): TextAreaCounterBindings;
114
+ getErrorTextBindings(props: IdRegistrationProps): TextAreaErrorTextBindings;
115
+ getHintBindings(props: IdRegistrationProps): TextAreaHintBindings;
116
+ getInputBindings(props: IdRegistrationProps): TextAreaInputBindings;
117
+ getLabelBindings(props: IdRegistrationProps): TextAreaLabelBindings;
118
+ getRootBindings(): TextAreaRootBindings;
119
+ }
120
+ export {};
121
+ //# sourceMappingURL=text-area.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.types.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,GAAG,EACH,aAAa,EACb,YAAY,EACb,MAAM,4BAA4B,CAAA;AAEnC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBACf,SAAQ,aAAa,EACnB,gBAAgB,EAChB,iBAAiB;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB;;;OAGG;IACH,GAAG,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAA;IAEpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAE9B;;OAEG;IACH,IAA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C3E,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAAA;IACjE,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,qBAAqB,CAAA;IACnE,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,qBAAqB,CAAA;IACnE,eAAe,IAAI,oBAAoB,CAAA;CACxC"}
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},T=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of f(e))!m.call(t,s)&&s!==r&&g(t,s,{get:()=>e[s],enumerable:!(o=P(e,s))||o.enumerable});return t};var S=t=>T(g({},"__esModule",{value:!0}),t);var A={};u(A,{createToggleApi:()=>h,splitToggleProps:()=>b,toggleMachine:()=>y,toggleProps:()=>c});module.exports=S(A);var a=require("@qualcomm-ui/utils/attributes");function h(t,e){let{context:r,prop:o,send:s}=t,p=r.get("pressed"),l=o("dir");return{disabled:!!o("disabled"),pressed:p,setPressed(i){s({type:"PRESS.SET",value:i})},getIndicatorBindings(){return e.element({"data-disabled":(0,a.booleanDataAttr)(o("disabled")),"data-part":"indicator","data-pressed":(0,a.booleanDataAttr)(p),"data-scope":"toggle","data-state":p?"on":"off",dir:l})},getRootBindings(){return e.element({"aria-pressed":(0,a.booleanAriaAttr)(p),"data-disabled":(0,a.booleanDataAttr)(o("disabled")),"data-part":"root","data-pressed":(0,a.booleanDataAttr)(p),"data-scope":"toggle","data-state":p?"on":"off",dir:l,disabled:o("disabled"),onClick(i){i.defaultPrevented||o("disabled")||s({type:"PRESS.TOGGLE"})},type:"button"})}}}var n=require("@qualcomm-ui/utils/machine"),y=(0,n.createMachine)({actions:{setPressed({context:t,event:e}){"value"in e&&t.set("pressed",e.value||!1)},togglePressed({context:t}){t.set("pressed",!t.get("pressed"))}},context({bindable:t,prop:e}){return{pressed:t(()=>({defaultValue:e("defaultPressed"),onChange(r){e("onPressedChange")?.(r)},value:e("pressed")}))}},initialState(){return"idle"},on:{"PRESS.SET":{actions:["setPressed"]},"PRESS.TOGGLE":{actions:["togglePressed"]}},props({props:t}){return{defaultPressed:!1,dir:"ltr",...t}},states:{idle:{}}});var d=require("@qualcomm-ui/utils/object"),c=(0,d.createProps)()("defaultPressed","dir","disabled","onPressedChange","pressed"),b=(0,d.createSplitProps)(c);
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/toggle/index.ts", "../../src/toggle/toggle.api.ts", "../../src/toggle/toggle.machine.ts", "../../src/toggle/toggle.props.ts"],
4
+ "sourcesContent": ["export * from \"./toggle.api\"\nexport * from \"./toggle.machine\"\nexport * from \"./toggle.props\"\nexport type * from \"./toggle.types\"\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {booleanAriaAttr, booleanDataAttr} from \"@qualcomm-ui/utils/attributes\"\nimport type {Machine, PropNormalizer} from \"@qualcomm-ui/utils/machine\"\n\nimport type {ToggleApi, ToggleSchema} from \"./toggle.types\"\n\nexport function createToggleApi(\n machine: Machine<ToggleSchema>,\n normalize: PropNormalizer,\n): ToggleApi {\n const {context, prop, send} = machine\n const pressed = context.get(\"pressed\")\n const dir = prop(\"dir\")\n\n return {\n disabled: !!prop(\"disabled\"),\n pressed,\n setPressed(value) {\n send({type: \"PRESS.SET\", value})\n },\n\n // group: bindings\n getIndicatorBindings() {\n return normalize.element({\n \"data-disabled\": booleanDataAttr(prop(\"disabled\")),\n \"data-part\": \"indicator\",\n \"data-pressed\": booleanDataAttr(pressed),\n \"data-scope\": \"toggle\",\n \"data-state\": pressed ? \"on\" : \"off\",\n dir,\n })\n },\n\n getRootBindings() {\n return normalize.element({\n \"aria-pressed\": booleanAriaAttr(pressed),\n \"data-disabled\": booleanDataAttr(prop(\"disabled\")),\n \"data-part\": \"root\",\n \"data-pressed\": booleanDataAttr(pressed),\n \"data-scope\": \"toggle\",\n \"data-state\": pressed ? \"on\" : \"off\",\n dir,\n disabled: prop(\"disabled\"),\n onClick(event) {\n if (event.defaultPrevented) {\n return\n }\n if (prop(\"disabled\")) {\n return\n }\n send({type: \"PRESS.TOGGLE\"})\n },\n type: \"button\",\n })\n },\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createMachine, type MachineConfig} from \"@qualcomm-ui/utils/machine\"\n\nimport type {ToggleSchema} from \"./toggle.types\"\n\nexport const toggleMachine: MachineConfig<ToggleSchema> =\n createMachine<ToggleSchema>({\n actions: {\n setPressed({context, event}) {\n if (\"value\" in event) {\n context.set(\"pressed\", event.value || false)\n }\n },\n togglePressed({context}) {\n context.set(\"pressed\", !context.get(\"pressed\"))\n },\n },\n\n context({bindable, prop}) {\n return {\n pressed: bindable<boolean>(() => ({\n defaultValue: prop(\"defaultPressed\"),\n onChange(value) {\n prop(\"onPressedChange\")?.(value)\n },\n value: prop(\"pressed\"),\n })),\n }\n },\n\n initialState() {\n return \"idle\"\n },\n\n on: {\n \"PRESS.SET\": {\n actions: [\"setPressed\"],\n },\n \"PRESS.TOGGLE\": {\n actions: [\"togglePressed\"],\n },\n },\n\n props({props}) {\n return {\n defaultPressed: false,\n dir: \"ltr\",\n ...props,\n }\n },\n\n states: {\n idle: {},\n },\n })\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createProps, createSplitProps} from \"@qualcomm-ui/utils/object\"\n\nimport type {ToggleApiProps} from \"./toggle.types\"\n\nexport const toggleProps: (keyof ToggleApiProps)[] =\n createProps<ToggleApiProps>()(\n \"defaultPressed\",\n \"dir\",\n \"disabled\",\n \"onPressedChange\",\n \"pressed\",\n )\n\nexport const splitToggleProps: <Props extends ToggleApiProps>(\n props: Props,\n) => [ToggleApiProps, Omit<Props, keyof ToggleApiProps>] =\n createSplitProps<ToggleApiProps>(toggleProps)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,qBAAAC,EAAA,kBAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GCMA,IAAAO,EAA+C,yCAKxC,SAASC,EACdC,EACAC,EACW,CACX,GAAM,CAAC,QAAAC,EAAS,KAAAC,EAAM,KAAAC,CAAI,EAAIJ,EACxBK,EAAUH,EAAQ,IAAI,SAAS,EAC/BI,EAAMH,EAAK,KAAK,EAEtB,MAAO,CACL,SAAU,CAAC,CAACA,EAAK,UAAU,EAC3B,QAAAE,EACA,WAAWE,EAAO,CAChBH,EAAK,CAAC,KAAM,YAAa,MAAAG,CAAK,CAAC,CACjC,EAGA,sBAAuB,CACrB,OAAON,EAAU,QAAQ,CACvB,mBAAiB,mBAAgBE,EAAK,UAAU,CAAC,EACjD,YAAa,YACb,kBAAgB,mBAAgBE,CAAO,EACvC,aAAc,SACd,aAAcA,EAAU,KAAO,MAC/B,IAAAC,CACF,CAAC,CACH,EAEA,iBAAkB,CAChB,OAAOL,EAAU,QAAQ,CACvB,kBAAgB,mBAAgBI,CAAO,EACvC,mBAAiB,mBAAgBF,EAAK,UAAU,CAAC,EACjD,YAAa,OACb,kBAAgB,mBAAgBE,CAAO,EACvC,aAAc,SACd,aAAcA,EAAU,KAAO,MAC/B,IAAAC,EACA,SAAUH,EAAK,UAAU,EACzB,QAAQK,EAAO,CACTA,EAAM,kBAGNL,EAAK,UAAU,GAGnBC,EAAK,CAAC,KAAM,cAAc,CAAC,CAC7B,EACA,KAAM,QACR,CAAC,CACH,CACF,CACF,CCvDA,IAAAK,EAAgD,sCAInCC,KACX,iBAA4B,CAC1B,QAAS,CACP,WAAW,CAAC,QAAAC,EAAS,MAAAC,CAAK,EAAG,CACvB,UAAWA,GACbD,EAAQ,IAAI,UAAWC,EAAM,OAAS,EAAK,CAE/C,EACA,cAAc,CAAC,QAAAD,CAAO,EAAG,CACvBA,EAAQ,IAAI,UAAW,CAACA,EAAQ,IAAI,SAAS,CAAC,CAChD,CACF,EAEA,QAAQ,CAAC,SAAAE,EAAU,KAAAC,CAAI,EAAG,CACxB,MAAO,CACL,QAASD,EAAkB,KAAO,CAChC,aAAcC,EAAK,gBAAgB,EACnC,SAASC,EAAO,CACdD,EAAK,iBAAiB,IAAIC,CAAK,CACjC,EACA,MAAOD,EAAK,SAAS,CACvB,EAAE,CACJ,CACF,EAEA,cAAe,CACb,MAAO,MACT,EAEA,GAAI,CACF,YAAa,CACX,QAAS,CAAC,YAAY,CACxB,EACA,eAAgB,CACd,QAAS,CAAC,eAAe,CAC3B,CACF,EAEA,MAAM,CAAC,MAAAE,CAAK,EAAG,CACb,MAAO,CACL,eAAgB,GAChB,IAAK,MACL,GAAGA,CACL,CACF,EAEA,OAAQ,CACN,KAAM,CAAC,CACT,CACF,CAAC,ECrDH,IAAAC,EAA4C,qCAI/BC,KACX,eAA4B,EAC1B,iBACA,MACA,WACA,kBACA,SACF,EAEWC,KAGX,oBAAiCD,CAAW",
6
+ "names": ["toggle_exports", "__export", "createToggleApi", "splitToggleProps", "toggleMachine", "toggleProps", "__toCommonJS", "import_attributes", "createToggleApi", "machine", "normalize", "context", "prop", "send", "pressed", "dir", "value", "event", "import_machine", "toggleMachine", "context", "event", "bindable", "prop", "value", "props", "import_object", "toggleProps", "splitToggleProps"]
7
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./toggle.api";
2
+ export * from "./toggle.machine";
3
+ export * from "./toggle.props";
4
+ export type * from "./toggle.types";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toggle/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,mBAAmB,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import{booleanAriaAttr as g,booleanDataAttr as s}from"@qualcomm-ui/utils/attributes";function m(e,t){let{context:a,prop:o,send:d}=e,r=a.get("pressed"),i=o("dir");return{disabled:!!o("disabled"),pressed:r,setPressed(p){d({type:"PRESS.SET",value:p})},getIndicatorBindings(){return t.element({"data-disabled":s(o("disabled")),"data-part":"indicator","data-pressed":s(r),"data-scope":"toggle","data-state":r?"on":"off",dir:i})},getRootBindings(){return t.element({"aria-pressed":g(r),"data-disabled":s(o("disabled")),"data-part":"root","data-pressed":s(r),"data-scope":"toggle","data-state":r?"on":"off",dir:i,disabled:o("disabled"),onClick(p){p.defaultPrevented||o("disabled")||d({type:"PRESS.TOGGLE"})},type:"button"})}}}import{createMachine as l}from"@qualcomm-ui/utils/machine";var S=l({actions:{setPressed({context:e,event:t}){"value"in t&&e.set("pressed",t.value||!1)},togglePressed({context:e}){e.set("pressed",!e.get("pressed"))}},context({bindable:e,prop:t}){return{pressed:e(()=>({defaultValue:t("defaultPressed"),onChange(a){t("onPressedChange")?.(a)},value:t("pressed")}))}},initialState(){return"idle"},on:{"PRESS.SET":{actions:["setPressed"]},"PRESS.TOGGLE":{actions:["togglePressed"]}},props({props:e}){return{defaultPressed:!1,dir:"ltr",...e}},states:{idle:{}}});import{createProps as n,createSplitProps as c}from"@qualcomm-ui/utils/object";var P=n()("defaultPressed","dir","disabled","onPressedChange","pressed"),b=c(P);export{m as createToggleApi,b as splitToggleProps,S as toggleMachine,P as toggleProps};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/toggle/toggle.api.ts", "../../src/toggle/toggle.machine.ts", "../../src/toggle/toggle.props.ts"],
4
+ "sourcesContent": ["// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {booleanAriaAttr, booleanDataAttr} from \"@qualcomm-ui/utils/attributes\"\nimport type {Machine, PropNormalizer} from \"@qualcomm-ui/utils/machine\"\n\nimport type {ToggleApi, ToggleSchema} from \"./toggle.types\"\n\nexport function createToggleApi(\n machine: Machine<ToggleSchema>,\n normalize: PropNormalizer,\n): ToggleApi {\n const {context, prop, send} = machine\n const pressed = context.get(\"pressed\")\n const dir = prop(\"dir\")\n\n return {\n disabled: !!prop(\"disabled\"),\n pressed,\n setPressed(value) {\n send({type: \"PRESS.SET\", value})\n },\n\n // group: bindings\n getIndicatorBindings() {\n return normalize.element({\n \"data-disabled\": booleanDataAttr(prop(\"disabled\")),\n \"data-part\": \"indicator\",\n \"data-pressed\": booleanDataAttr(pressed),\n \"data-scope\": \"toggle\",\n \"data-state\": pressed ? \"on\" : \"off\",\n dir,\n })\n },\n\n getRootBindings() {\n return normalize.element({\n \"aria-pressed\": booleanAriaAttr(pressed),\n \"data-disabled\": booleanDataAttr(prop(\"disabled\")),\n \"data-part\": \"root\",\n \"data-pressed\": booleanDataAttr(pressed),\n \"data-scope\": \"toggle\",\n \"data-state\": pressed ? \"on\" : \"off\",\n dir,\n disabled: prop(\"disabled\"),\n onClick(event) {\n if (event.defaultPrevented) {\n return\n }\n if (prop(\"disabled\")) {\n return\n }\n send({type: \"PRESS.TOGGLE\"})\n },\n type: \"button\",\n })\n },\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createMachine, type MachineConfig} from \"@qualcomm-ui/utils/machine\"\n\nimport type {ToggleSchema} from \"./toggle.types\"\n\nexport const toggleMachine: MachineConfig<ToggleSchema> =\n createMachine<ToggleSchema>({\n actions: {\n setPressed({context, event}) {\n if (\"value\" in event) {\n context.set(\"pressed\", event.value || false)\n }\n },\n togglePressed({context}) {\n context.set(\"pressed\", !context.get(\"pressed\"))\n },\n },\n\n context({bindable, prop}) {\n return {\n pressed: bindable<boolean>(() => ({\n defaultValue: prop(\"defaultPressed\"),\n onChange(value) {\n prop(\"onPressedChange\")?.(value)\n },\n value: prop(\"pressed\"),\n })),\n }\n },\n\n initialState() {\n return \"idle\"\n },\n\n on: {\n \"PRESS.SET\": {\n actions: [\"setPressed\"],\n },\n \"PRESS.TOGGLE\": {\n actions: [\"togglePressed\"],\n },\n },\n\n props({props}) {\n return {\n defaultPressed: false,\n dir: \"ltr\",\n ...props,\n }\n },\n\n states: {\n idle: {},\n },\n })\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {createProps, createSplitProps} from \"@qualcomm-ui/utils/object\"\n\nimport type {ToggleApiProps} from \"./toggle.types\"\n\nexport const toggleProps: (keyof ToggleApiProps)[] =\n createProps<ToggleApiProps>()(\n \"defaultPressed\",\n \"dir\",\n \"disabled\",\n \"onPressedChange\",\n \"pressed\",\n )\n\nexport const splitToggleProps: <Props extends ToggleApiProps>(\n props: Props,\n) => [ToggleApiProps, Omit<Props, keyof ToggleApiProps>] =\n createSplitProps<ToggleApiProps>(toggleProps)\n"],
5
+ "mappings": "AAMA,OAAQ,mBAAAA,EAAiB,mBAAAC,MAAsB,gCAKxC,SAASC,EACdC,EACAC,EACW,CACX,GA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ACdD,EAAK,iBAAiB,IAAIC,CAAK,CACjC,EACA,MAAOD,EAAK,SAAS,CACvB,EAAE,CACJ,CACF,EAEA,cAAe,CACb,MAAO,MACT,EAEA,GAAI,CACF,YAAa,CACX,QAAS,CAAC,YAAY,CACxB,EACA,eAAgB,CACd,QAAS,CAAC,eAAe,CAC3B,CACF,EAEA,MAAM,CAAC,MAAAE,CAAK,EAAG,CACb,MAAO,CACL,eAAgB,GAChB,IAAK,MACL,GAAGA,CACL,CACF,EAEA,OAAQ,CACN,KAAM,CAAC,CACT,CACF,CAAC,ECrDH,OAAQ,eAAAC,EAAa,oBAAAC,MAAuB,4BAIrC,IAAMC,EACXF,EAA4B,EAC1B,iBACA,MACA,WACA,kBACA,SACF,EAEWG,EAGXF,EAAiCC,CAAW",
6
+ "names": ["booleanAriaAttr", "booleanDataAttr", "createToggleApi", "machine", "normalize", "context", "prop", "send", "pressed", "dir", "value", "event", "createMachine", "toggleMachine", "context", "event", "bindable", "prop", "value", "props", "createProps", "createSplitProps", "toggleProps", "splitToggleProps"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { Machine, PropNormalizer } from "@qualcomm-ui/utils/machine";
2
+ import type { ToggleApi, ToggleSchema } from "./toggle.types";
3
+ export declare function createToggleApi(machine: Machine<ToggleSchema>, normalize: PropNormalizer): ToggleApi;
4
+ //# sourceMappingURL=toggle.api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.api.d.ts","sourceRoot":"","sources":["../../src/toggle/toggle.api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,4BAA4B,CAAA;AAEvE,OAAO,KAAK,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAE3D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,EAC9B,SAAS,EAAE,cAAc,GACxB,SAAS,CA+CX"}
@@ -0,0 +1,4 @@
1
+ import { type MachineConfig } from "@qualcomm-ui/utils/machine";
2
+ import type { ToggleSchema } from "./toggle.types";
3
+ export declare const toggleMachine: MachineConfig<ToggleSchema>;
4
+ //# sourceMappingURL=toggle.machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.machine.d.ts","sourceRoot":"","sources":["../../src/toggle/toggle.machine.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,aAAa,EAAC,MAAM,4BAA4B,CAAA;AAE5E,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,YAAY,CAiDlD,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { ToggleApiProps } from "./toggle.types";
2
+ export declare const toggleProps: (keyof ToggleApiProps)[];
3
+ export declare const splitToggleProps: <Props extends ToggleApiProps>(props: Props) => [ToggleApiProps, Omit<Props, keyof ToggleApiProps>];
4
+ //# sourceMappingURL=toggle.props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.props.d.ts","sourceRoot":"","sources":["../../src/toggle/toggle.props.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElD,eAAO,MAAM,WAAW,EAAE,CAAC,MAAM,cAAc,CAAC,EAO7C,CAAA;AAEH,eAAO,MAAM,gBAAgB,EAAE,CAAC,KAAK,SAAS,cAAc,EAC1D,KAAK,EAAE,KAAK,KACT,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,cAAc,CAAC,CACR,CAAA"}
@@ -0,0 +1,72 @@
1
+ import type { BooleanAriaAttr, BooleanDataAttr } from "@qualcomm-ui/utils/attributes";
2
+ import type { DirectionProperty } from "@qualcomm-ui/utils/direction";
3
+ import type { RequiredBy } from "@qualcomm-ui/utils/guard";
4
+ import type { ActionSchema, JSX, MachineSchema } from "@qualcomm-ui/utils/machine";
5
+ export interface ToggleApiProps extends DirectionProperty {
6
+ /**
7
+ * The default pressed state of the toggle.
8
+ */
9
+ defaultPressed?: boolean | undefined;
10
+ /**
11
+ * Whether the toggle is disabled.
12
+ */
13
+ disabled?: boolean | undefined;
14
+ /**
15
+ * Event handler called when the pressed state of the toggle changes.
16
+ */
17
+ onPressedChange?: ((pressed: boolean) => void) | undefined;
18
+ /**
19
+ * The pressed state of the toggle.
20
+ */
21
+ pressed?: boolean | undefined;
22
+ }
23
+ export interface ToggleSchema extends MachineSchema {
24
+ actions: ActionSchema<"setPressed" | "togglePressed">;
25
+ context: {
26
+ pressed: boolean;
27
+ };
28
+ events: {
29
+ type: "PRESS.TOGGLE";
30
+ } | {
31
+ type: "PRESS.SET";
32
+ value: boolean | undefined;
33
+ };
34
+ props: RequiredBy<ToggleApiProps, "dir">;
35
+ state: "idle";
36
+ }
37
+ export interface ToggleCommonBindings extends Required<DirectionProperty> {
38
+ "data-scope": "toggle";
39
+ }
40
+ export interface ToggleIndicatorBindings extends ToggleCommonBindings {
41
+ "data-disabled": BooleanDataAttr;
42
+ "data-part": "indicator";
43
+ "data-pressed": BooleanDataAttr;
44
+ "data-state": "on" | "off";
45
+ }
46
+ export interface ToggleRootBindings extends ToggleCommonBindings {
47
+ "aria-pressed": BooleanAriaAttr;
48
+ "data-disabled": BooleanDataAttr;
49
+ "data-part": "root";
50
+ "data-pressed": BooleanDataAttr;
51
+ "data-state": "on" | "off";
52
+ disabled: boolean | undefined;
53
+ onClick: JSX.MouseEventHandler;
54
+ type: "button";
55
+ }
56
+ export interface ToggleApi {
57
+ /**
58
+ * Whether the toggle is disabled.
59
+ */
60
+ disabled: boolean;
61
+ /**
62
+ * Whether the toggle is pressed.
63
+ */
64
+ pressed: boolean;
65
+ /**
66
+ * Sets the pressed state of the toggle.
67
+ */
68
+ setPressed: (pressed: boolean | undefined) => void;
69
+ getIndicatorBindings: () => ToggleIndicatorBindings;
70
+ getRootBindings: () => ToggleRootBindings;
71
+ }
72
+ //# sourceMappingURL=toggle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