tamagui 1.0.11 → 1.0.13

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 (111) hide show
  1. package/package.json +44 -44
  2. package/dist/cjs/helpers/focusableInputHOC.js +0 -92
  3. package/dist/cjs/helpers/focusableInputHOC.js.map +0 -7
  4. package/dist/cjs/helpers/getSpace.js +0 -34
  5. package/dist/cjs/helpers/getSpace.js.map +0 -7
  6. package/dist/cjs/helpers/prevent.js +0 -28
  7. package/dist/cjs/helpers/prevent.js.map +0 -7
  8. package/dist/cjs/hooks/useKeyboardDismissable.js +0 -95
  9. package/dist/cjs/hooks/useKeyboardDismissable.js.map +0 -7
  10. package/dist/cjs/lib/focusable.js +0 -16
  11. package/dist/cjs/lib/focusable.js.map +0 -7
  12. package/dist/cjs/lib/linear-gradient.js +0 -29
  13. package/dist/cjs/lib/linear-gradient.js.map +0 -7
  14. package/dist/cjs/lib/registerFocusable.js +0 -37
  15. package/dist/cjs/lib/registerFocusable.js.map +0 -7
  16. package/dist/cjs/lib/registerFocusable.native.js +0 -60
  17. package/dist/cjs/lib/registerFocusable.native.js.map +0 -7
  18. package/dist/cjs/polyfills.js +0 -11
  19. package/dist/cjs/polyfills.js.map +0 -7
  20. package/dist/cjs/views/BlurView.js +0 -90
  21. package/dist/cjs/views/BlurView.js.map +0 -7
  22. package/dist/cjs/views/BlurView.native.js +0 -38
  23. package/dist/cjs/views/BlurView.native.js.map +0 -7
  24. package/dist/cjs/views/ExitAnimationContext.js +0 -34
  25. package/dist/cjs/views/ExitAnimationContext.js.map +0 -7
  26. package/dist/cjs/views/Hoverable.js +0 -92
  27. package/dist/cjs/views/Hoverable.js.map +0 -7
  28. package/dist/cjs/views/Label.js +0 -177
  29. package/dist/cjs/views/Label.js.map +0 -7
  30. package/dist/cjs/views/LinearGradient.js +0 -81
  31. package/dist/cjs/views/LinearGradient.js.map +0 -7
  32. package/dist/cjs/views/Switch.js +0 -265
  33. package/dist/cjs/views/Switch.js.map +0 -7
  34. package/dist/cjs/views/Table.js +0 -84
  35. package/dist/cjs/views/Table.js.map +0 -7
  36. package/dist/cjs/views/Toast.js +0 -129
  37. package/dist/cjs/views/Toast.js.map +0 -7
  38. package/dist/esm/helpers/focusableInputHOC.js +0 -68
  39. package/dist/esm/helpers/focusableInputHOC.js.map +0 -7
  40. package/dist/esm/helpers/getSpace.js +0 -11
  41. package/dist/esm/helpers/getSpace.js.map +0 -7
  42. package/dist/esm/helpers/prevent.js +0 -5
  43. package/dist/esm/helpers/prevent.js.map +0 -7
  44. package/dist/esm/hooks/useKeyboardDismissable.js +0 -69
  45. package/dist/esm/hooks/useKeyboardDismissable.js.map +0 -7
  46. package/dist/esm/lib/focusable.js +0 -1
  47. package/dist/esm/lib/focusable.js.map +0 -7
  48. package/dist/esm/lib/linear-gradient.js +0 -5
  49. package/dist/esm/lib/linear-gradient.js.map +0 -7
  50. package/dist/esm/lib/registerFocusable.js +0 -12
  51. package/dist/esm/lib/registerFocusable.js.map +0 -7
  52. package/dist/esm/lib/registerFocusable.native.js +0 -35
  53. package/dist/esm/lib/registerFocusable.native.js.map +0 -7
  54. package/dist/esm/polyfills.js +0 -10
  55. package/dist/esm/polyfills.js.map +0 -7
  56. package/dist/esm/views/BlurView.js +0 -66
  57. package/dist/esm/views/BlurView.js.map +0 -7
  58. package/dist/esm/views/BlurView.native.js +0 -15
  59. package/dist/esm/views/BlurView.native.js.map +0 -7
  60. package/dist/esm/views/ExitAnimationContext.js +0 -10
  61. package/dist/esm/views/ExitAnimationContext.js.map +0 -7
  62. package/dist/esm/views/Hoverable.js +0 -66
  63. package/dist/esm/views/Hoverable.js.map +0 -7
  64. package/dist/esm/views/Label.js +0 -158
  65. package/dist/esm/views/Label.js.map +0 -7
  66. package/dist/esm/views/LinearGradient.js +0 -58
  67. package/dist/esm/views/LinearGradient.js.map +0 -7
  68. package/dist/esm/views/Switch.js +0 -244
  69. package/dist/esm/views/Switch.js.map +0 -7
  70. package/dist/esm/views/Table.js +0 -56
  71. package/dist/esm/views/Table.js.map +0 -7
  72. package/dist/esm/views/Toast.js +0 -107
  73. package/dist/esm/views/Toast.js.map +0 -7
  74. package/dist/jsx/helpers/focusableInputHOC.js +0 -49
  75. package/dist/jsx/helpers/focusableInputHOC.js.map +0 -7
  76. package/dist/jsx/helpers/getSpace.js +0 -11
  77. package/dist/jsx/helpers/getSpace.js.map +0 -7
  78. package/dist/jsx/helpers/prevent.js +0 -5
  79. package/dist/jsx/helpers/prevent.js.map +0 -7
  80. package/dist/jsx/hooks/useKeyboardDismissable.js +0 -69
  81. package/dist/jsx/hooks/useKeyboardDismissable.js.map +0 -7
  82. package/dist/jsx/lib/focusable.js +0 -1
  83. package/dist/jsx/lib/focusable.js.map +0 -7
  84. package/dist/jsx/lib/linear-gradient.js +0 -5
  85. package/dist/jsx/lib/linear-gradient.js.map +0 -7
  86. package/dist/jsx/lib/registerFocusable.js +0 -12
  87. package/dist/jsx/lib/registerFocusable.js.map +0 -7
  88. package/dist/jsx/lib/registerFocusable.native.js +0 -35
  89. package/dist/jsx/lib/registerFocusable.native.js.map +0 -7
  90. package/dist/jsx/polyfills.js +0 -10
  91. package/dist/jsx/polyfills.js.map +0 -7
  92. package/dist/jsx/views/BlurView.js +0 -27
  93. package/dist/jsx/views/BlurView.js.map +0 -7
  94. package/dist/jsx/views/BlurView.native.js +0 -15
  95. package/dist/jsx/views/BlurView.native.js.map +0 -7
  96. package/dist/jsx/views/ExitAnimationContext.js +0 -10
  97. package/dist/jsx/views/ExitAnimationContext.js.map +0 -7
  98. package/dist/jsx/views/Hoverable.js +0 -58
  99. package/dist/jsx/views/Hoverable.js.map +0 -7
  100. package/dist/jsx/views/Label.js +0 -118
  101. package/dist/jsx/views/Label.js.map +0 -7
  102. package/dist/jsx/views/LinearGradient.js +0 -46
  103. package/dist/jsx/views/LinearGradient.js.map +0 -7
  104. package/dist/jsx/views/Switch.js +0 -164
  105. package/dist/jsx/views/Switch.js.map +0 -7
  106. package/dist/jsx/views/Table.js +0 -56
  107. package/dist/jsx/views/Table.js.map +0 -7
  108. package/dist/jsx/views/Toast.js +0 -73
  109. package/dist/jsx/views/Toast.js.map +0 -7
  110. package/types/lib/linear-gradient.d.ts +0 -3
  111. package/types/views/LinearGradient.d.ts +0 -10
@@ -1,164 +0,0 @@
1
- import { usePrevious } from "@radix-ui/react-use-previous";
2
- import { useComposedRefs } from "@tamagui/compose-refs";
3
- import {
4
- calc,
5
- getSize,
6
- getVariableValue,
7
- isWeb,
8
- styled,
9
- themeable
10
- } from "@tamagui/core";
11
- import { createContextScope } from "@tamagui/create-context";
12
- import { ThemeableStack, XStack } from "@tamagui/stacks";
13
- import { useControllableState } from "@tamagui/use-controllable-state";
14
- import * as React from "react";
15
- import { registerFocusable } from "../lib/registerFocusable";
16
- import { useLabelContext } from "./Label";
17
- const SWITCH_NAME = "Switch";
18
- const scopeContexts = createContextScope(SWITCH_NAME);
19
- const [createSwitchContext] = scopeContexts;
20
- const createSwitchScope = scopeContexts[1];
21
- const [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
22
- const getSwitchHeight = (val) => Math.round(getVariableValue(getSize(val)) * 0.65);
23
- const getSwitchWidth = (val) => getSwitchHeight(val) * 2;
24
- const SwitchFrame = styled(XStack, {
25
- name: "Switch",
26
- tag: "button",
27
- borderRadius: 1e3,
28
- borderWidth: 2,
29
- borderColor: "transparent",
30
- backgroundColor: "$background",
31
- focusStyle: {
32
- borderColor: "$borderColorFocus"
33
- },
34
- variants: {
35
- size: {
36
- "...size": (val) => {
37
- const height = calc(getSwitchHeight(val), "+", 4);
38
- const width = calc(getSwitchWidth(val), "+", 4);
39
- return {
40
- height,
41
- minHeight: height,
42
- width
43
- };
44
- }
45
- }
46
- },
47
- defaultVariants: {
48
- size: "$4"
49
- }
50
- });
51
- const SwitchComponent = React.forwardRef((props, forwardedRef) => {
52
- const {
53
- __scopeSwitch,
54
- labeledBy: ariaLabelledby,
55
- name,
56
- checked: checkedProp,
57
- defaultChecked,
58
- required,
59
- disabled,
60
- value = "on",
61
- onCheckedChange,
62
- size = "$4",
63
- ...switchProps
64
- } = props;
65
- const [button, setButton] = React.useState(null);
66
- const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
67
- const labelId = useLabelContext(button);
68
- const labelledBy = ariaLabelledby || labelId;
69
- const hasConsumerStoppedPropagationRef = React.useRef(false);
70
- const isFormControl = isWeb ? button ? Boolean(button.closest("form")) : true : false;
71
- const [checked = false, setChecked] = useControllableState({
72
- prop: checkedProp,
73
- defaultProp: defaultChecked || false,
74
- onChange: onCheckedChange
75
- });
76
- if (!isWeb) {
77
- React.useEffect(() => {
78
- if (!props.id)
79
- return;
80
- return registerFocusable(props.id, {
81
- focus: () => {
82
- setChecked((x) => !x);
83
- }
84
- });
85
- }, [props.id]);
86
- }
87
- return <SwitchProvider scope={__scopeSwitch} checked={checked} disabled={disabled} size={size}>
88
- <SwitchFrame size={size} role="switch" aria-checked={checked} aria-labelledby={labelledBy} aria-required={required} data-state={getState(checked)} data-disabled={disabled ? "" : void 0} disabled={disabled} tabIndex={disabled ? void 0 : 0} value={value} {...switchProps} ref={composedRefs} onPress={(event) => {
89
- var _a;
90
- (_a = props.onPress) == null ? void 0 : _a.call(props, event);
91
- setChecked((prevChecked) => !prevChecked);
92
- if (isWeb && isFormControl) {
93
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
94
- if (!hasConsumerStoppedPropagationRef.current)
95
- event.stopPropagation();
96
- }
97
- }} />
98
- {isWeb && isFormControl && <BubbleInput control={button} bubbles={!hasConsumerStoppedPropagationRef.current} name={name} value={value} checked={checked} required={required} disabled={disabled} style={{ transform: "translateX(-100%)" }} />}
99
- </SwitchProvider>;
100
- });
101
- SwitchComponent.displayName = SWITCH_NAME;
102
- const Switch = SwitchFrame.extractable(themeable(SwitchComponent), {
103
- neverFlatten: true
104
- });
105
- const THUMB_NAME = "SwitchThumb";
106
- const SwitchThumbFrame = styled(ThemeableStack, {
107
- name: "SwitchThumb",
108
- backgroundColor: "$background",
109
- borderRadius: 1e3,
110
- variants: {
111
- size: {
112
- "...size": (val) => ({
113
- height: getSwitchHeight(val),
114
- width: getSwitchHeight(val)
115
- })
116
- }
117
- },
118
- defaultVariants: {
119
- size: "$4"
120
- }
121
- });
122
- const SwitchThumb = SwitchThumbFrame.extractable(React.forwardRef((props, forwardedRef) => {
123
- const { __scopeSwitch, ...thumbProps } = props;
124
- const { size, disabled, checked } = useSwitchContext(THUMB_NAME, __scopeSwitch);
125
- return <SwitchThumbFrame size={size} data-state={getState(checked)} data-disabled={disabled ? "" : void 0} {...thumbProps} x={checked ? getVariableValue(getSwitchWidth(size)) - getVariableValue(getSwitchHeight(size)) : 0} ref={forwardedRef} />;
126
- }), {
127
- neverFlatten: true
128
- });
129
- SwitchThumb.displayName = THUMB_NAME;
130
- Switch.Thumb = SwitchThumb;
131
- const BubbleInput = (props) => {
132
- const { control, checked, bubbles = true, ...inputProps } = props;
133
- const ref = React.useRef(null);
134
- const prevChecked = usePrevious(checked);
135
- React.useEffect(() => {
136
- const input = ref.current;
137
- const inputProto = window.HTMLInputElement.prototype;
138
- const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
139
- const setChecked = descriptor.set;
140
- if (prevChecked !== checked && setChecked) {
141
- const event = new Event("click", { bubbles });
142
- setChecked.call(input, checked);
143
- input.dispatchEvent(event);
144
- }
145
- }, [prevChecked, checked, bubbles]);
146
- return <input type="checkbox" aria-hidden defaultChecked={checked} {...inputProps} tabIndex={-1} ref={ref} style={{
147
- ...props.style,
148
- position: "absolute",
149
- pointerEvents: "none",
150
- opacity: 0,
151
- margin: 0
152
- }} />;
153
- };
154
- function getState(checked) {
155
- return checked ? "checked" : "unchecked";
156
- }
157
- export {
158
- Switch,
159
- SwitchFrame,
160
- SwitchThumb,
161
- SwitchThumbFrame,
162
- createSwitchScope
163
- };
164
- //# sourceMappingURL=Switch.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/views/Switch.tsx"],
4
- "sourcesContent": ["// via radix\n// https://github.com/radix-ui/primitives/blob/main/packages/react/switch/src/Switch.tsx\n\nimport { usePrevious } from '@radix-ui/react-use-previous'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport {\n GetProps,\n ReactComponentWithRef,\n SizeTokens,\n calc,\n getSize,\n getVariableValue,\n isWeb,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { ScopedProps, createContextScope } from '@tamagui/create-context'\nimport { ThemeableStack, XStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\nimport { View } from 'react-native'\n\nimport { registerFocusable } from '../lib/registerFocusable'\nimport { useLabelContext } from './Label'\n\nconst SWITCH_NAME = 'Switch'\n\nconst scopeContexts = createContextScope(SWITCH_NAME)\nconst [createSwitchContext] = scopeContexts\nexport const createSwitchScope = scopeContexts[1]\n\nconst [SwitchProvider, useSwitchContext] = createSwitchContext<{\n checked: boolean\n disabled?: boolean\n size: SizeTokens\n}>(SWITCH_NAME)\n\n/* -------------------------------------------------------------------------------------------------\n * Switch\n * -----------------------------------------------------------------------------------------------*/\n\n// TODO make customizable\nconst getSwitchHeight = (val: SizeTokens) => Math.round(getVariableValue(getSize(val)) * 0.65)\nconst getSwitchWidth = (val: SizeTokens) => getSwitchHeight(val) * 2\n\nexport const SwitchFrame = styled(XStack, {\n name: 'Switch',\n tag: 'button',\n borderRadius: 1000,\n borderWidth: 2,\n borderColor: 'transparent',\n backgroundColor: '$background',\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': (val) => {\n const height = calc(getSwitchHeight(val), '+', 4)\n const width = calc(getSwitchWidth(val), '+', 4)\n return {\n height,\n minHeight: height,\n width,\n }\n },\n },\n },\n\n defaultVariants: {\n size: '$4',\n },\n})\n\ntype SwitchButtonProps = GetProps<typeof SwitchFrame>\n\nexport type SwitchProps = SwitchButtonProps & {\n labeledBy?: string\n name?: string\n value?: string\n checked?: boolean\n defaultChecked?: boolean\n required?: boolean\n onCheckedChange?(checked: boolean): void\n}\n\nconst SwitchComponent = React.forwardRef<HTMLButtonElement | View, SwitchProps>(\n (props: ScopedProps<SwitchProps, 'Switch'>, forwardedRef) => {\n const {\n __scopeSwitch,\n labeledBy: ariaLabelledby,\n name,\n checked: checkedProp,\n defaultChecked,\n required,\n disabled,\n value = 'on',\n onCheckedChange,\n size = '$4',\n ...switchProps\n } = props\n const [button, setButton] = React.useState<HTMLButtonElement | null>(null)\n const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node as any))\n const labelId = useLabelContext(button)\n const labelledBy = ariaLabelledby || labelId\n const hasConsumerStoppedPropagationRef = React.useRef(false)\n // We set this to true by default so that events bubble to forms without JS (SSR)\n const isFormControl = isWeb ? (button ? Boolean(button.closest('form')) : true) : false\n const [checked = false, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked || false,\n onChange: onCheckedChange,\n })\n\n if (!isWeb) {\n React.useEffect(() => {\n if (!props.id) return\n return registerFocusable(props.id, {\n focus: () => {\n setChecked((x) => !x)\n },\n })\n }, [props.id])\n }\n\n return (\n <SwitchProvider scope={__scopeSwitch} checked={checked} disabled={disabled} size={size}>\n <SwitchFrame\n size={size}\n // @ts-ignore\n role=\"switch\"\n aria-checked={checked}\n aria-labelledby={labelledBy}\n aria-required={required}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n // @ts-ignore\n tabIndex={disabled ? undefined : 0}\n // @ts-ignore\n value={value}\n {...switchProps}\n ref={composedRefs}\n onPress={(event) => {\n props.onPress?.(event)\n setChecked((prevChecked) => !prevChecked)\n if (isWeb && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped()\n // if switch is in a form, stop propagation from the button so that we only propagate\n // one click event (from the input). We propagate changes from an input so that native\n // form validation works and form events reflect switch updates.\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation()\n }\n }}\n />\n {isWeb && isFormControl && (\n <BubbleInput\n control={button}\n bubbles={!hasConsumerStoppedPropagationRef.current}\n name={name}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n style={{ transform: 'translateX(-100%)' }}\n />\n )}\n </SwitchProvider>\n )\n }\n)\n\nSwitchComponent.displayName = SWITCH_NAME\n\nexport const Switch: ReactComponentWithRef<SwitchProps, HTMLButtonElement | View> & {\n Thumb: typeof SwitchThumb\n} = SwitchFrame.extractable(themeable(SwitchComponent as any) as any, {\n neverFlatten: true,\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SwitchThumb\n * -----------------------------------------------------------------------------------------------*/\n\nconst THUMB_NAME = 'SwitchThumb'\n\nexport const SwitchThumbFrame = styled(ThemeableStack, {\n name: 'SwitchThumb',\n backgroundColor: '$background',\n borderRadius: 1000,\n\n variants: {\n size: {\n '...size': (val) => ({\n height: getSwitchHeight(val),\n width: getSwitchHeight(val),\n }),\n },\n },\n\n defaultVariants: {\n size: '$4',\n },\n})\n\nexport type SwitchThumbProps = GetProps<typeof SwitchThumbFrame>\n\nexport const SwitchThumb = SwitchThumbFrame.extractable(\n React.forwardRef<React.ElementRef<'span'>, SwitchThumbProps>(\n (props: ScopedProps<SwitchThumbProps, 'Switch'>, forwardedRef) => {\n const { __scopeSwitch, ...thumbProps } = props\n const { size, disabled, checked } = useSwitchContext(THUMB_NAME, __scopeSwitch)\n return (\n <SwitchThumbFrame\n size={size}\n data-state={getState(checked)}\n data-disabled={disabled ? '' : undefined}\n {...thumbProps}\n x={\n checked\n ? getVariableValue(getSwitchWidth(size)) - getVariableValue(getSwitchHeight(size))\n : 0\n }\n ref={forwardedRef}\n />\n )\n }\n ),\n {\n neverFlatten: true,\n }\n)\n\nSwitchThumb.displayName = THUMB_NAME\nSwitch.Thumb = SwitchThumb\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype InputProps = any //Radix.ComponentPropsWithoutRef<'input'>\ninterface BubbleInputProps extends Omit<InputProps, 'checked'> {\n checked: boolean\n control: HTMLElement | null\n bubbles: boolean\n}\n\n// TODO make this native friendly\nconst BubbleInput = (props: BubbleInputProps) => {\n const { control, checked, bubbles = true, ...inputProps } = props\n const ref = React.useRef<HTMLInputElement>(null)\n const prevChecked = usePrevious(checked)\n // const controlSize = useSize(control)\n\n // Bubble checked change to parents (e.g form change event)\n React.useEffect(() => {\n const input = ref.current!\n const inputProto = window.HTMLInputElement.prototype\n const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked') as PropertyDescriptor\n const setChecked = descriptor.set\n if (prevChecked !== checked && setChecked) {\n const event = new Event('click', { bubbles })\n setChecked.call(input, checked)\n input.dispatchEvent(event)\n }\n }, [prevChecked, checked, bubbles])\n\n return (\n <input\n type=\"checkbox\"\n aria-hidden\n defaultChecked={checked}\n {...inputProps}\n tabIndex={-1}\n ref={ref}\n style={{\n ...props.style,\n // ...controlSize,\n position: 'absolute',\n pointerEvents: 'none',\n opacity: 0,\n margin: 0,\n }}\n />\n )\n}\n\nfunction getState(checked: boolean) {\n return checked ? 'checked' : 'unchecked'\n}\n"],
5
- "mappings": "AAGA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AACA;AACA;AACA;AAGA;AACA;AAEA,MAAM,cAAc;AAEpB,MAAM,gBAAgB,mBAAmB,WAAW;AACpD,MAAM,CAAC,uBAAuB;AACvB,MAAM,oBAAoB,cAAc;AAE/C,MAAM,CAAC,gBAAgB,oBAAoB,oBAIxC,WAAW;AAOd,MAAM,kBAAkB,CAAC,QAAoB,KAAK,MAAM,iBAAiB,QAAQ,GAAG,CAAC,IAAI,IAAI;AAC7F,MAAM,iBAAiB,CAAC,QAAoB,gBAAgB,GAAG,IAAI;AAE5D,MAAM,cAAc,OAAO,QAAQ;AAAA,EACxC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,cAAc;AAAA,EACd,aAAa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- const Table = styled(Stack, {
3
- name: "Table",
4
- tag: "table"
5
- });
6
- const TableRow = styled(Stack, {
7
- name: "TableRow",
8
- tag: "tr",
9
- alignSelf: "stretch",
10
- flex: 1
11
- });
12
- const TableHead = styled(Stack, {
13
- name: "TableHead",
14
- tag: "thead",
15
- flexDirection: "row",
16
- alignSelf: "stretch",
17
- flex: 1,
18
- borderBottomColor: "#eee",
19
- borderBottomWidth: 1
20
- });
21
- const TableHeadCell = styled(Stack, {
22
- name: "TableHeadCell",
23
- tag: "th",
24
- display: isWeb ? "table-head" : "flex",
25
- flexDirection: "row"
26
- });
27
- const TableHeadText = styled(Text, {
28
- name: "TableHeadText",
29
- backgroundColor: "rgba(0,0,0,0.05)",
30
- padding: 2,
31
- paddingHorizontal: 8,
32
- marginLeft: -8,
33
- borderRadius: 10,
34
- maxWidth: "100%",
35
- ellipse: true,
36
- fontSize: 12
37
- });
38
- const TableCell = styled(Stack, {
39
- name: "TableCell",
40
- flex: 1,
41
- alignSelf: "stretch",
42
- alignItems: "center",
43
- tag: "td",
44
- display: isWeb ? "table-cell" : "flex",
45
- paddingVertical: "$3",
46
- paddingHorizontal: "$2"
47
- });
48
- export {
49
- Table,
50
- TableCell,
51
- TableHead,
52
- TableHeadCell,
53
- TableHeadText,
54
- TableRow
55
- };
56
- //# sourceMappingURL=Table.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/views/Table.tsx"],
4
- "sourcesContent": ["import { Stack, StackProps, Text, TextProps, isWeb, styled } from '@tamagui/core'\n\nexport const Table = styled(Stack, {\n name: 'Table',\n tag: 'table',\n})\n\nexport const TableRow = styled(Stack, {\n name: 'TableRow',\n tag: 'tr',\n alignSelf: 'stretch', // minWidth: 100%\n flex: 1,\n})\n\nexport const TableHead = styled(Stack, {\n name: 'TableHead',\n tag: 'thead',\n flexDirection: 'row',\n alignSelf: 'stretch',\n flex: 1,\n borderBottomColor: '#eee',\n borderBottomWidth: 1,\n})\n\nexport const TableHeadCell = styled(Stack, {\n name: 'TableHeadCell',\n tag: 'th',\n // @ts-ignore\n display: isWeb ? 'table-head' : 'flex',\n flexDirection: 'row',\n})\n\nexport const TableHeadText = styled(Text, {\n name: 'TableHeadText',\n backgroundColor: 'rgba(0,0,0,0.05)',\n padding: 2,\n paddingHorizontal: 8,\n marginLeft: -8,\n borderRadius: 10,\n maxWidth: '100%',\n ellipse: true,\n fontSize: 12,\n})\n\nexport type TableCellProps = StackProps & TextProps\n\nexport const TableCell = styled(Stack, {\n name: 'TableCell',\n flex: 1,\n alignSelf: 'stretch',\n alignItems: 'center',\n tag: 'td',\n // @ts-ignore\n display: isWeb ? 'table-cell' : 'flex',\n // borderBottomWidth: 1,\n // borderBottomColor: '$borderColor',\n paddingVertical: '$3',\n paddingHorizontal: '$2',\n})\n"],
5
- "mappings": "AAAA;AAEO,MAAM,QAAQ,OAAO,OAAO;AAAA,EACjC,MAAM;AAAA,EACN,KAAK;AACP,CAAC;AAEM,MAAM,WAAW,OAAO,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,MAAM;AACR,CAAC;AAEM,MAAM,YAAY,OAAO,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,eAAe;AAAA,EACf,WAAW;AAAA,EACX,MAAM;AAAA,EACN,mBAAmB;AAAA,EACnB,mBAAmB;AACrB,CAAC;AAEM,MAAM,gBAAgB,OAAO,OAAO;AAAA,EACzC,MAAM;AAAA,EACN,KAAK;AAAA,EAEL,SAAS,QAAQ,eAAe;AAAA,EAChC,eAAe;AACjB,CAAC;AAEM,MAAM,gBAAgB,OAAO,MAAM;AAAA,EACxC,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ,CAAC;AAIM,MAAM,YAAY,OAAO,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EAEL,SAAS,QAAQ,eAAe;AAAA,EAGhC,iBAAiB;AAAA,EACjB,mBAAmB;AACrB,CAAC;",
6
- "names": []
7
- }
@@ -1,73 +0,0 @@
1
- import { AnimatePresence } from "@tamagui/animate-presence";
2
- import { Theme, isWeb } from "@tamagui/core";
3
- import { YStack } from "@tamagui/stacks";
4
- import { Paragraph } from "@tamagui/text";
5
- import { useForceUpdate } from "@tamagui/use-force-update";
6
- import { memo, useCallback, useEffect, useRef } from "react";
7
- import { createPortal } from "react-dom";
8
- let clear = () => {
9
- };
10
- let show = (content) => {
11
- console.warn("Note:", content);
12
- };
13
- const Toast = {
14
- clear,
15
- show: (content, options) => show(content, options),
16
- error: (content, options) => show(content, { ...options, type: "error" }),
17
- success: (content, options) => show(content, { ...options, type: "success" })
18
- };
19
- if (typeof window !== "undefined") {
20
- window["Toast"] = Toast;
21
- }
22
- const ToastRoot = memo(function ToastRoot2(props) {
23
- const forceUpdate = useForceUpdate();
24
- const stateRef = useRef({
25
- show: false,
26
- content: "",
27
- type: "info",
28
- timeout: null
29
- });
30
- const setState = (x) => {
31
- stateRef.current = x;
32
- forceUpdate();
33
- };
34
- useEffect(() => {
35
- return () => {
36
- var _a;
37
- clearTimeout((_a = stateRef.current.timeout) != null ? _a : 0);
38
- };
39
- }, []);
40
- clear = () => {
41
- setState({ show: false, content: "" });
42
- };
43
- show = useCallback((content, { duration = 3e3, type = "info" } = {}) => {
44
- var _a;
45
- clearTimeout((_a = stateRef.current.timeout) != null ? _a : 0);
46
- const timeout = setTimeout(() => {
47
- setState({
48
- show: false,
49
- content: "",
50
- type,
51
- timeout: null
52
- });
53
- }, duration);
54
- setState({
55
- show: true,
56
- content,
57
- type,
58
- timeout
59
- });
60
- }, [stateRef]);
61
- const state = stateRef.current;
62
- const contents = <YStack position="absolute" pointerEvents="none" fullscreen alignItems="center" justifyContent="flex-end" zIndex={1e10} padding="5%"><Theme name={state.type === "info" ? null : state.type === "success" ? "green" : "red"}><AnimatePresence>{state.show && !!state.content && <YStack animation={props.animation || "toast"} backgroundColor="$background" elevation="$2" borderRadius="$4" paddingHorizontal="$4" paddingVertical="$3"><Paragraph>{state.content}</Paragraph></YStack>}</AnimatePresence></Theme></YStack>;
63
- const portalEl = document.getElementById("toasts");
64
- if (isWeb && portalEl) {
65
- return createPortal(contents, portalEl);
66
- }
67
- return contents;
68
- });
69
- export {
70
- Toast,
71
- ToastRoot
72
- };
73
- //# sourceMappingURL=Toast.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/views/Toast.tsx"],
4
- "sourcesContent": ["import { AnimatePresence } from '@tamagui/animate-presence'\nimport { AnimationKeys, Theme, isWeb } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport { memo, useCallback, useEffect, useRef } from 'react'\nimport { createPortal } from 'react-dom'\n\nexport type ToastOptions = {\n duration?: number\n type?: 'info' | 'success' | 'error'\n}\n\nlet clear = () => {}\n\nlet show: (content: any, options?: ToastOptions) => void = (content) => {\n console.warn('Note:', content)\n}\n\nexport const Toast = {\n clear,\n show: (content: any, options?: ToastOptions) => show(content, options),\n error: (content: any, options?: Omit<ToastOptions, 'type'>) =>\n show(content, { ...options, type: 'error' }),\n success: (content: any, options?: Omit<ToastOptions, 'type'>) =>\n show(content, { ...options, type: 'success' }),\n}\n\nif (typeof window !== 'undefined') {\n window['Toast'] = Toast\n}\n\nexport const ToastRoot = memo(function ToastRoot(props: { animation?: AnimationKeys }) {\n const forceUpdate = useForceUpdate()\n const stateRef = useRef({\n show: false,\n content: '',\n type: 'info',\n timeout: null,\n })\n const setState = (x: any) => {\n stateRef.current = x\n forceUpdate()\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(stateRef.current.timeout ?? 0)\n }\n }, [])\n\n clear = () => {\n setState({ show: false, content: '' })\n }\n\n show = useCallback(\n (content: any, { duration = 3000, type = 'info' }: ToastOptions = {}) => {\n clearTimeout(stateRef.current.timeout ?? 0)\n const timeout = setTimeout(() => {\n setState({\n show: false,\n content: '',\n type,\n timeout: null,\n })\n }, duration)\n setState({\n show: true,\n content,\n type,\n timeout,\n })\n },\n [stateRef]\n )\n\n const state = stateRef.current\n\n const contents = (\n <YStack\n position=\"absolute\"\n pointerEvents=\"none\"\n fullscreen\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n zIndex={10000000000}\n padding=\"5%\"\n >\n <Theme name={state.type === 'info' ? null : state.type === 'success' ? 'green' : 'red'}>\n <AnimatePresence>\n {state.show && !!state.content && (\n <YStack\n animation={props.animation || ('toast' as any)}\n backgroundColor=\"$background\"\n elevation=\"$2\"\n borderRadius=\"$4\"\n paddingHorizontal=\"$4\"\n paddingVertical=\"$3\"\n >\n <Paragraph>{state.content}</Paragraph>\n </YStack>\n )}\n </AnimatePresence>\n </Theme>\n </YStack>\n )\n\n const portalEl = document.getElementById('toasts')\n\n if (isWeb && portalEl) {\n return createPortal(contents, portalEl)\n }\n\n return contents\n})\n"],
5
- "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,IAAI,QAAQ,MAAM;AAAC;AAEnB,IAAI,OAAuD,CAAC,YAAY;AACtE,UAAQ,KAAK,SAAS,OAAO;AAC/B;AAEO,MAAM,QAAQ;AAAA,EACnB;AAAA,EACA,MAAM,CAAC,SAAc,YAA2B,KAAK,SAAS,OAAO;AAAA,EACrE,OAAO,CAAC,SAAc,YACpB,KAAK,SAAS,EAAE,GAAG,SAAS,MAAM,QAAQ,CAAC;AAAA,EAC7C,SAAS,CAAC,SAAc,YACtB,KAAK,SAAS,EAAE,GAAG,SAAS,MAAM,UAAU,CAAC;AACjD;AAEA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,WAAW;AACpB;AAEO,MAAM,YAAY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C,gBAcH,EAfC,MAgBH,EAzBC;AA4BH,QAAM,WAAW,SAAS,eAAe,QAAQ;AAEjD,MAAI,SAAS,UAAU;AACrB,WAAO,aAAa,UAAU,QAAQ;AAAA,EACxC;AAEA,SAAO;AACT,CAAC;",
6
- "names": []
7
- }
@@ -1,3 +0,0 @@
1
- export { LinearGradient } from 'expo-linear-gradient';
2
- export type { LinearGradientProps } from 'expo-linear-gradient';
3
- //# sourceMappingURL=linear-gradient.d.ts.map
@@ -1,10 +0,0 @@
1
- import { ColorTokens, ThemeTokens } from '@tamagui/core';
2
- import { YStackProps } from '@tamagui/stacks';
3
- import * as React from 'react';
4
- import { View } from 'react-native';
5
- import { LinearGradientProps as ExpoLinearGradientProps } from '../../../linear-gradient/src/linear-gradient';
6
- export type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> & Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {
7
- colors?: (ColorTokens | ThemeTokens | (string & {}))[];
8
- };
9
- export declare const LinearGradient: React.ForwardRefExoticComponent<LinearGradientProps & React.RefAttributes<HTMLElement | View>>;
10
- //# sourceMappingURL=LinearGradient.d.ts.map