panelui-native 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/module/components/card/index.js +172 -3
- package/lib/module/components/card/index.js.map +1 -1
- package/lib/module/components/drawer/index.js +13 -4
- package/lib/module/components/drawer/index.js.map +1 -1
- package/lib/module/components/map/index.js +72 -12
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/pagination/index.js +19 -9
- package/lib/module/components/pagination/index.js.map +1 -1
- package/lib/module/components/panelside/index.js +68 -18
- package/lib/module/components/panelside/index.js.map +1 -1
- package/lib/module/components/text-animation/index.js +857 -0
- package/lib/module/components/text-animation/index.js.map +1 -0
- package/lib/module/icons/index.js +25 -7
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/card/index.d.ts +20 -0
- package/lib/typescript/src/components/card/index.d.ts.map +1 -1
- package/lib/typescript/src/components/drawer/index.d.ts +13 -1
- package/lib/typescript/src/components/drawer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts +37 -2
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/pagination/index.d.ts.map +1 -1
- package/lib/typescript/src/components/panelside/index.d.ts +50 -4
- package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
- package/lib/typescript/src/components/text-animation/index.d.ts +268 -0
- package/lib/typescript/src/components/text-animation/index.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +6 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/card/index.tsx +227 -2
- package/src/components/drawer/index.tsx +31 -9
- package/src/components/map/index.tsx +158 -14
- package/src/components/pagination/index.tsx +18 -6
- package/src/components/panelside/index.tsx +134 -19
- package/src/components/text-animation/index.tsx +1093 -0
- package/src/icons/index.tsx +23 -4
- package/src/index.ts +13 -1
package/src/icons/index.tsx
CHANGED
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Brand marks (Google, Facebook, Apple) are the exception: they carry their
|
|
17
17
|
* own colours and ignore the context.
|
|
18
|
+
*
|
|
19
|
+
* A glyph whose *meaning* is a horizontal direction mirrors in a right-to-left
|
|
20
|
+
* subtree — the chevrons, the outward arrow, the send plane. Everything else
|
|
21
|
+
* is drawn once and left alone, including the vertical arrows, since the
|
|
22
|
+
* vertical axis does not mirror, and including asymmetric glyphs that are not
|
|
23
|
+
* directions (a magnifier, a pencil, a play triangle).
|
|
18
24
|
*/
|
|
19
25
|
import { createContext, useContext, type ReactNode } from 'react';
|
|
20
26
|
import Svg, { Circle, G, Path, type SvgProps } from 'react-native-svg';
|
|
@@ -226,11 +232,20 @@ export function ChevronDownIcon({ size = 16, color, ...props }: IconProps) {
|
|
|
226
232
|
*
|
|
227
233
|
* Only for glyphs whose meaning *is* a direction. An icon that happens to be
|
|
228
234
|
* asymmetric — a pencil, a magnifier — means the same thing either way round,
|
|
229
|
-
* and flipping it is just a wrong drawing.
|
|
235
|
+
* and flipping it is just a wrong drawing. The vertical axis never mirrors, so
|
|
236
|
+
* the up and down glyphs stay as they are drawn.
|
|
237
|
+
*
|
|
238
|
+
* Left-to-right gets an identity transform rather than no transform at all.
|
|
239
|
+
* Dropping the prop leaves the last matrix the view was given in place, so a
|
|
240
|
+
* glyph mirrored once stays mirrored when the direction flips back — the
|
|
241
|
+
* arrows in an app that can switch direction at runtime end up pointing at the
|
|
242
|
+
* text one toggle in, and never recover.
|
|
230
243
|
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
const IDENTITY = 'translate(0 0)';
|
|
245
|
+
const MIRROR = 'scale(-1 1) translate(-24 0)';
|
|
246
|
+
|
|
247
|
+
function useFlip(): { transform: string } {
|
|
248
|
+
return { transform: useDirection() === 'rtl' ? MIRROR : IDENTITY };
|
|
234
249
|
}
|
|
235
250
|
|
|
236
251
|
export function ChevronLeftIcon({ size = 16, color, ...props }: IconProps) {
|
|
@@ -325,6 +340,7 @@ export function SearchIcon({ size = 16, color, ...props }: IconProps) {
|
|
|
325
340
|
|
|
326
341
|
export function ArrowUpRightIcon({ size = 20, color, ...props }: IconProps) {
|
|
327
342
|
const resolved = useResolvedColor(color, '#fff');
|
|
343
|
+
const flip = useFlip();
|
|
328
344
|
return (
|
|
329
345
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
330
346
|
<Path
|
|
@@ -333,6 +349,7 @@ export function ArrowUpRightIcon({ size = 20, color, ...props }: IconProps) {
|
|
|
333
349
|
strokeWidth={2}
|
|
334
350
|
strokeLinecap="round"
|
|
335
351
|
strokeLinejoin="round"
|
|
352
|
+
{...flip}
|
|
336
353
|
/>
|
|
337
354
|
</Svg>
|
|
338
355
|
);
|
|
@@ -618,6 +635,7 @@ export function ReceiptIcon({ size = 16, color, ...props }: IconProps) {
|
|
|
618
635
|
/** Paper plane — sent, submitted, approved-and-forwarded. */
|
|
619
636
|
export function SendIcon({ size = 16, color, ...props }: IconProps) {
|
|
620
637
|
const resolved = useResolvedColor(color, '#737373');
|
|
638
|
+
const flip = useFlip();
|
|
621
639
|
return (
|
|
622
640
|
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none" {...props}>
|
|
623
641
|
<Path
|
|
@@ -625,6 +643,7 @@ export function SendIcon({ size = 16, color, ...props }: IconProps) {
|
|
|
625
643
|
stroke={resolved}
|
|
626
644
|
strokeWidth={2}
|
|
627
645
|
strokeLinejoin="round"
|
|
646
|
+
{...flip}
|
|
628
647
|
/>
|
|
629
648
|
</Svg>
|
|
630
649
|
);
|
package/src/index.ts
CHANGED
|
@@ -296,7 +296,7 @@ export {
|
|
|
296
296
|
type CalendarSelection,
|
|
297
297
|
type DateRange,
|
|
298
298
|
} from './components/calendar';
|
|
299
|
-
export { Card, type CardProps } from './components/card';
|
|
299
|
+
export { Card, type CardProps, type CardWashProps } from './components/card';
|
|
300
300
|
export { Checkbox, type CheckboxProps } from './components/checkbox';
|
|
301
301
|
export {
|
|
302
302
|
Chip,
|
|
@@ -326,6 +326,7 @@ export {
|
|
|
326
326
|
type DrawerCloseProps,
|
|
327
327
|
type DrawerSide,
|
|
328
328
|
type DrawerSize,
|
|
329
|
+
type DrawerCloseSide,
|
|
329
330
|
} from './components/drawer';
|
|
330
331
|
export {
|
|
331
332
|
EmptyState,
|
|
@@ -390,6 +391,8 @@ export {
|
|
|
390
391
|
type PanelsideTriggerProps,
|
|
391
392
|
type PanelsideMode,
|
|
392
393
|
type PanelsideSwipeFrom,
|
|
394
|
+
type PanelsideItemSize,
|
|
395
|
+
type PanelsideCtaSize,
|
|
393
396
|
type UsePanelsideResult,
|
|
394
397
|
} from './components/panelside';
|
|
395
398
|
export {
|
|
@@ -621,6 +624,15 @@ export {
|
|
|
621
624
|
type ScrollTextEffect,
|
|
622
625
|
type ScrollTextSplit,
|
|
623
626
|
} from './components/scroll-text';
|
|
627
|
+
export {
|
|
628
|
+
TextAnimation,
|
|
629
|
+
type TextAnimationProps,
|
|
630
|
+
type TextAnimationTypingProps,
|
|
631
|
+
type TextAnimationRotatingProps,
|
|
632
|
+
type TextAnimationCountingProps,
|
|
633
|
+
type TextAnimationSlidingProps,
|
|
634
|
+
type TextAnimationScrollingProps,
|
|
635
|
+
} from './components/text-animation';
|
|
624
636
|
export {
|
|
625
637
|
ScrollCanvas,
|
|
626
638
|
type ScrollCanvasProps,
|