@ornikar/kitt-universal 27.4.0 → 27.5.1-canary.3a59d4ae3422049417956fa37f27d2e8f5f84aba.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/AGENTS.md +30 -0
- package/CHANGELOG.md +28 -0
- package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/FullscreenModal/FullscreenModalAnimation.web.d.ts.map +1 -1
- package/dist/definitions/GoogleMapsAutocompleteProvider/GoogleMapsAutocompleteProvider.d.ts.map +1 -1
- package/dist/definitions/MapMarker/MapMarker.d.ts +2 -5
- package/dist/definitions/MapMarker/MapMarker.d.ts.map +1 -1
- package/dist/definitions/MapMarker/constants.d.ts +6 -0
- package/dist/definitions/MapMarker/constants.d.ts.map +1 -0
- package/dist/definitions/MapMarker/utils/getBackgroundColor.d.ts +2 -1
- package/dist/definitions/MapMarker/utils/getBackgroundColor.d.ts.map +1 -1
- package/dist/definitions/Picker/Picker.web.d.ts.map +1 -1
- package/dist/definitions/TabBar/TabBar.d.ts +6 -4
- package/dist/definitions/TabBar/TabBar.d.ts.map +1 -1
- package/dist/definitions/TabBar/TabBarItem.d.ts +11 -1
- package/dist/definitions/TabBar/TabBarItem.d.ts.map +1 -1
- package/dist/definitions/TimePicker/TimePicker.web.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +180 -12
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/default.d.ts +1 -12
- package/dist/definitions/themes/default.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/cardModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/cardModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/dialogModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/dialogModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts +21 -4
- package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/icon.d.ts +0 -20
- package/dist/definitions/themes/late-ocean/icon.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/shadows.d.ts +4 -2
- package/dist/definitions/themes/late-ocean/shadows.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/skeleton.d.ts +2 -1
- package/dist/definitions/themes/late-ocean/skeleton.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tabBar.d.ts +34 -0
- package/dist/definitions/themes/late-ocean/tabBar.d.ts.map +1 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
- package/dist/definitions/typography/utils/getTypographyFamily.d.ts +2 -1
- package/dist/definitions/typography/utils/getTypographyFamily.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +665 -289
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +665 -289
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +555 -178
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.css +2 -2
- package/dist/index-node-22.17.cjs.web.js +522 -172
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +555 -178
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.css +2 -2
- package/dist/index-node-22.17.es.web.mjs +522 -172
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +664 -316
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +641 -284
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +219 -46
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +219 -46
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.js +219 -46
- package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.web.js +219 -46
- package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-22.17.es.mjs +219 -46
- package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
- package/dist/linaria-themes-node-22.17.es.web.mjs +219 -46
- package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +219 -46
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +219 -46
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
- package/scripts/codemods/__testfixtures__/card-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/card-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/card-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/card-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.input.tsx +11 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/decorator.output.tsx +17 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/default.input.tsx +88 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/default.output.tsx +94 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.input.tsx +21 -0
- package/scripts/codemods/__testfixtures__/csf1-csf2/parameters.output.tsx +28 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/fullscreen-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/basic.input.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/basic.output.js +15 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.input.js +23 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/withExpressions.output.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.input.js +19 -0
- package/scripts/codemods/__testfixtures__/navigation-modal/wrongOrder.output.js +15 -0
- package/scripts/codemods/__tests__/card-modal.test.js +10 -0
- package/scripts/codemods/__tests__/csf1-csf2.test.ts +10 -0
- package/scripts/codemods/__tests__/fullscreen-modal.test.js +10 -0
- package/scripts/codemods/__tests__/navigation-modal.test.js +10 -0
- package/scripts/codemods/card-modal.js +155 -0
- package/scripts/codemods/csf1-csf2.js +257 -0
- package/scripts/codemods/fullscreen-modal.js +155 -0
- package/scripts/codemods/navigation-modal.js +155 -0
- package/scripts/{run-transformers.js → run-codemods.js} +30 -32
- package/scripts/transformers/modals.js +0 -102
|
@@ -737,9 +737,19 @@ const card = {
|
|
|
737
737
|
};
|
|
738
738
|
|
|
739
739
|
const webAnimationContentDuration$2 = 400;
|
|
740
|
-
const webAnimationContentEasing$2 =
|
|
740
|
+
const webAnimationContentEasing$2 = {
|
|
741
|
+
x1: 0.77,
|
|
742
|
+
y1: 0,
|
|
743
|
+
x2: 0.175,
|
|
744
|
+
y2: 1
|
|
745
|
+
};
|
|
741
746
|
const webAnimationOverlayDuration$2 = 250;
|
|
742
|
-
const webAnimationOverlayEasing$2 =
|
|
747
|
+
const webAnimationOverlayEasing$2 = {
|
|
748
|
+
x1: 0.42,
|
|
749
|
+
y1: 0,
|
|
750
|
+
x2: 1,
|
|
751
|
+
y2: 1
|
|
752
|
+
};
|
|
743
753
|
const maxWidth = 540;
|
|
744
754
|
const overlayHorizontalPadding = 24;
|
|
745
755
|
const cardModal = {
|
|
@@ -831,9 +841,19 @@ const choices = {
|
|
|
831
841
|
};
|
|
832
842
|
|
|
833
843
|
const webAnimationContentDuration$1 = 400;
|
|
834
|
-
const webAnimationContentEasing$1 =
|
|
844
|
+
const webAnimationContentEasing$1 = {
|
|
845
|
+
x1: 0.77,
|
|
846
|
+
y1: 0,
|
|
847
|
+
x2: 0.175,
|
|
848
|
+
y2: 1
|
|
849
|
+
};
|
|
835
850
|
const webAnimationOverlayDuration$1 = 250;
|
|
836
|
-
const webAnimationOverlayEasing$1 =
|
|
851
|
+
const webAnimationOverlayEasing$1 = {
|
|
852
|
+
x1: 0.42,
|
|
853
|
+
y1: 0,
|
|
854
|
+
x2: 1,
|
|
855
|
+
y2: 1
|
|
856
|
+
};
|
|
837
857
|
const dialogModal = {
|
|
838
858
|
borderRadius: spacing * 2,
|
|
839
859
|
maxWidth: 540,
|
|
@@ -1765,9 +1785,19 @@ const forms = {
|
|
|
1765
1785
|
};
|
|
1766
1786
|
|
|
1767
1787
|
const webAnimationContentDuration = 600;
|
|
1768
|
-
const webAnimationContentEasing =
|
|
1788
|
+
const webAnimationContentEasing = {
|
|
1789
|
+
x1: 0.77,
|
|
1790
|
+
y1: 0,
|
|
1791
|
+
x2: 0.175,
|
|
1792
|
+
y2: 1
|
|
1793
|
+
};
|
|
1769
1794
|
const webAnimationOverlayDuration = 250;
|
|
1770
|
-
const webAnimationOverlayEasing =
|
|
1795
|
+
const webAnimationOverlayEasing = {
|
|
1796
|
+
x1: 0.42,
|
|
1797
|
+
y1: 0,
|
|
1798
|
+
x2: 1,
|
|
1799
|
+
y2: 1
|
|
1800
|
+
};
|
|
1771
1801
|
const fullscreenModal = {
|
|
1772
1802
|
header: {
|
|
1773
1803
|
height: 56
|
|
@@ -1860,43 +1890,8 @@ const highlight = {
|
|
|
1860
1890
|
}
|
|
1861
1891
|
};
|
|
1862
1892
|
|
|
1863
|
-
const getIconSizeFromFontSize = fontSize => {
|
|
1864
|
-
if (fontSize <= 14) return 16;
|
|
1865
|
-
if (fontSize <= 16) return 20;
|
|
1866
|
-
return 24;
|
|
1867
|
-
};
|
|
1868
|
-
const createTypographyIconSizeConfig = (baseAndSmallFontSize, mediumAndWideFontSize) => {
|
|
1869
|
-
const baseAndSmallIconSize = getIconSizeFromFontSize(baseAndSmallFontSize);
|
|
1870
|
-
const mediumAndWideIconSize = getIconSizeFromFontSize(mediumAndWideFontSize);
|
|
1871
|
-
return {
|
|
1872
|
-
baseAndSmall: {
|
|
1873
|
-
iconSize: baseAndSmallIconSize
|
|
1874
|
-
},
|
|
1875
|
-
mediumAndWide: {
|
|
1876
|
-
iconSize: mediumAndWideIconSize
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
};
|
|
1880
1893
|
const icon = {
|
|
1881
|
-
defaultSize: 20
|
|
1882
|
-
// Note: this is based on typography updated sizes, not current https://github.com/ornikar/kitt/pull/2130
|
|
1883
|
-
typographySize: {
|
|
1884
|
-
// also known as xxlarge
|
|
1885
|
-
header1: createTypographyIconSizeConfig(40, 56),
|
|
1886
|
-
// also known as xlarge
|
|
1887
|
-
header2: createTypographyIconSizeConfig(32, 48),
|
|
1888
|
-
// also known as medium
|
|
1889
|
-
header3: createTypographyIconSizeConfig(24, 40),
|
|
1890
|
-
// also known as xsmall
|
|
1891
|
-
header4: createTypographyIconSizeConfig(18, 24),
|
|
1892
|
-
// also known as xxsmall
|
|
1893
|
-
header5: createTypographyIconSizeConfig(18, 18),
|
|
1894
|
-
'body-large': createTypographyIconSizeConfig(18, 24),
|
|
1895
|
-
'body-medium': createTypographyIconSizeConfig(18, 18),
|
|
1896
|
-
body: createTypographyIconSizeConfig(16, 16),
|
|
1897
|
-
'body-small': createTypographyIconSizeConfig(14, 14),
|
|
1898
|
-
'body-xsmall': createTypographyIconSizeConfig(12, 12)
|
|
1899
|
-
}
|
|
1894
|
+
defaultSize: 20
|
|
1900
1895
|
};
|
|
1901
1896
|
|
|
1902
1897
|
const iconButton = {
|
|
@@ -1915,8 +1910,8 @@ const listItem = {
|
|
|
1915
1910
|
|
|
1916
1911
|
const mapMarker = {
|
|
1917
1912
|
home: {
|
|
1918
|
-
default:
|
|
1919
|
-
selected:
|
|
1913
|
+
default: deepPurpleColorPalette['grey.9'],
|
|
1914
|
+
selected: deepPurpleColorPalette['grey.7'],
|
|
1920
1915
|
svg: {
|
|
1921
1916
|
height: 36
|
|
1922
1917
|
},
|
|
@@ -1926,8 +1921,8 @@ const mapMarker = {
|
|
|
1926
1921
|
}
|
|
1927
1922
|
},
|
|
1928
1923
|
meetingPoint: {
|
|
1929
|
-
default:
|
|
1930
|
-
selected:
|
|
1924
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
1925
|
+
selected: deepPurpleColorPalette['deepPurple.6'],
|
|
1931
1926
|
svg: {
|
|
1932
1927
|
width: 40,
|
|
1933
1928
|
height: 43
|
|
@@ -2323,6 +2318,183 @@ const skeleton = {
|
|
|
2323
2318
|
}
|
|
2324
2319
|
};
|
|
2325
2320
|
|
|
2321
|
+
const tabBar = {
|
|
2322
|
+
underline: {
|
|
2323
|
+
default: {
|
|
2324
|
+
active: {
|
|
2325
|
+
color: {
|
|
2326
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2327
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2328
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2329
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2330
|
+
},
|
|
2331
|
+
indicator: {
|
|
2332
|
+
backgroundColor: deepPurpleColorPalette['deepPurple.8']
|
|
2333
|
+
}
|
|
2334
|
+
},
|
|
2335
|
+
inactive: {
|
|
2336
|
+
color: {
|
|
2337
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2338
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2339
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2340
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2341
|
+
},
|
|
2342
|
+
indicator: {
|
|
2343
|
+
backgroundColor: undefined
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
disabled: {
|
|
2347
|
+
color: {
|
|
2348
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2349
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2350
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2351
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2352
|
+
},
|
|
2353
|
+
indicator: {
|
|
2354
|
+
backgroundColor: undefined
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
borderBottomColor: deepPurpleColorPalette['beige.3']
|
|
2358
|
+
},
|
|
2359
|
+
revert: {
|
|
2360
|
+
active: {
|
|
2361
|
+
color: {
|
|
2362
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2363
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2364
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2365
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2366
|
+
},
|
|
2367
|
+
indicator: {
|
|
2368
|
+
backgroundColor: deepPurpleColorPalette['grey.0']
|
|
2369
|
+
}
|
|
2370
|
+
},
|
|
2371
|
+
inactive: {
|
|
2372
|
+
color: {
|
|
2373
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2374
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2375
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2376
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2377
|
+
},
|
|
2378
|
+
indicator: {
|
|
2379
|
+
backgroundColor: undefined
|
|
2380
|
+
}
|
|
2381
|
+
},
|
|
2382
|
+
disabled: {
|
|
2383
|
+
color: {
|
|
2384
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2385
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2386
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2387
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2388
|
+
},
|
|
2389
|
+
indicator: {
|
|
2390
|
+
backgroundColor: undefined
|
|
2391
|
+
}
|
|
2392
|
+
},
|
|
2393
|
+
borderBottomColor: deepPurpleColorPalette['white-alpha.20']
|
|
2394
|
+
}
|
|
2395
|
+
},
|
|
2396
|
+
solid: {
|
|
2397
|
+
default: {
|
|
2398
|
+
active: {
|
|
2399
|
+
color: {
|
|
2400
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2401
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2402
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2403
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2404
|
+
},
|
|
2405
|
+
backgroundColor: {
|
|
2406
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2407
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2408
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2409
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2410
|
+
},
|
|
2411
|
+
borderRadius: 4,
|
|
2412
|
+
indicator: {
|
|
2413
|
+
backgroundColor: undefined
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
inactive: {
|
|
2417
|
+
color: {
|
|
2418
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2419
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2420
|
+
hovered: deepPurpleColorPalette['grey.5'],
|
|
2421
|
+
pressed: deepPurpleColorPalette['grey.5']
|
|
2422
|
+
},
|
|
2423
|
+
backgroundColor: {
|
|
2424
|
+
default: undefined,
|
|
2425
|
+
focused: undefined,
|
|
2426
|
+
hovered: deepPurpleColorPalette['beige.1'],
|
|
2427
|
+
pressed: deepPurpleColorPalette['beige.1']
|
|
2428
|
+
},
|
|
2429
|
+
borderRadius: 4,
|
|
2430
|
+
indicator: {
|
|
2431
|
+
backgroundColor: undefined
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
disabled: {
|
|
2435
|
+
color: {
|
|
2436
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2437
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2438
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2439
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2440
|
+
},
|
|
2441
|
+
indicator: {
|
|
2442
|
+
backgroundColor: undefined
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
revert: {
|
|
2447
|
+
active: {
|
|
2448
|
+
color: {
|
|
2449
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2450
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2451
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2452
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2453
|
+
},
|
|
2454
|
+
backgroundColor: {
|
|
2455
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2456
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2457
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2458
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2459
|
+
},
|
|
2460
|
+
borderRadius: 4,
|
|
2461
|
+
indicator: {
|
|
2462
|
+
backgroundColor: undefined
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
inactive: {
|
|
2466
|
+
color: {
|
|
2467
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2468
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2469
|
+
hovered: deepPurpleColorPalette['white-alpha.80'],
|
|
2470
|
+
pressed: deepPurpleColorPalette['white-alpha.80']
|
|
2471
|
+
},
|
|
2472
|
+
backgroundColor: {
|
|
2473
|
+
default: undefined,
|
|
2474
|
+
focused: undefined,
|
|
2475
|
+
hovered: deepPurpleColorPalette['white-alpha.10'],
|
|
2476
|
+
pressed: deepPurpleColorPalette['white-alpha.10']
|
|
2477
|
+
},
|
|
2478
|
+
borderRadius: 4,
|
|
2479
|
+
indicator: {
|
|
2480
|
+
backgroundColor: undefined
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
disabled: {
|
|
2484
|
+
color: {
|
|
2485
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2486
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2487
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2488
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2489
|
+
},
|
|
2490
|
+
indicator: {
|
|
2491
|
+
backgroundColor: undefined
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2326
2498
|
const tag = {
|
|
2327
2499
|
borderRadius: 16,
|
|
2328
2500
|
icon: {
|
|
@@ -2462,6 +2634,7 @@ const theme = {
|
|
|
2462
2634
|
picker,
|
|
2463
2635
|
shadows,
|
|
2464
2636
|
skeleton,
|
|
2637
|
+
tabBar,
|
|
2465
2638
|
tag,
|
|
2466
2639
|
tooltip,
|
|
2467
2640
|
typography,
|
|
@@ -2874,6 +3047,13 @@ const getTypographyFamilyWithAncestorValue = (type, typographyFamilyInContext) =
|
|
|
2874
3047
|
if (typographyFamilyInContext != null) return typographyFamilyInContext;
|
|
2875
3048
|
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
2876
3049
|
};
|
|
3050
|
+
const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
|
|
3051
|
+
// check if all values are not undefined
|
|
3052
|
+
const isAllValuesUndefined = Object.values(type).every(value => value === undefined);
|
|
3053
|
+
|
|
3054
|
+
// if every values are undefined and we hgave a typographyTypeInContext, we use the parent typography type (typographyTypeInContext)
|
|
3055
|
+
return !!isAllValuesUndefined && !!typographyTypeInContext ? typographyTypeInContext : type;
|
|
3056
|
+
};
|
|
2877
3057
|
|
|
2878
3058
|
const TypographyFamilyContext = /*#__PURE__*/createContext(null);
|
|
2879
3059
|
const TypographyTypeContext = /*#__PURE__*/createContext(null);
|
|
@@ -2881,9 +3061,6 @@ const TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
|
2881
3061
|
function useTypographyColor() {
|
|
2882
3062
|
return useContext(TypographyColorContext);
|
|
2883
3063
|
}
|
|
2884
|
-
function useTypographyAncestorType() {
|
|
2885
|
-
return useContext(TypographyTypeContext);
|
|
2886
|
-
}
|
|
2887
3064
|
const TypographyDefaultColorContext = /*#__PURE__*/createContext(undefined);
|
|
2888
3065
|
function useTypographyDefaultColor() {
|
|
2889
3066
|
return useContext(TypographyDefaultColorContext);
|
|
@@ -3006,9 +3183,11 @@ function Typography({
|
|
|
3006
3183
|
}) {
|
|
3007
3184
|
const sx = useSx();
|
|
3008
3185
|
const typographyFamilyInContext = useContext(TypographyFamilyContext);
|
|
3186
|
+
const typographyTypeInContext = useContext(TypographyTypeContext);
|
|
3009
3187
|
const defaultColor = useTypographyDefaultColor();
|
|
3010
3188
|
const hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3011
|
-
const
|
|
3189
|
+
const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3190
|
+
const baseOrDefaultToBody = typographyType.base ?? 'body-m';
|
|
3012
3191
|
const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3013
3192
|
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3014
3193
|
...type,
|
|
@@ -3047,7 +3226,7 @@ function Typography({
|
|
|
3047
3226
|
const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
|
|
3048
3227
|
value: typographyFamily,
|
|
3049
3228
|
children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
|
|
3050
|
-
value:
|
|
3229
|
+
value: typographyType,
|
|
3051
3230
|
children: text
|
|
3052
3231
|
})
|
|
3053
3232
|
}) : text;
|
|
@@ -3148,30 +3327,11 @@ function Icon({
|
|
|
3148
3327
|
});
|
|
3149
3328
|
}
|
|
3150
3329
|
|
|
3151
|
-
function getIconSizeConfigKeyFromTypeName(breakpointName) {
|
|
3152
|
-
return breakpointName === KittBreakpointNameEnum.BASE || breakpointName === KittBreakpointNameEnum.SMALL ? 'baseAndSmall' : 'mediumAndWide';
|
|
3153
|
-
}
|
|
3154
|
-
function createNativeBaseIconSize(type) {
|
|
3155
|
-
const typeWithMediumForced = {
|
|
3156
|
-
...type,
|
|
3157
|
-
medium: type.medium || type.small || type.base
|
|
3158
|
-
};
|
|
3159
|
-
const iconSizeForNativeBase = {};
|
|
3160
|
-
[KittBreakpointNameEnum.BASE, KittBreakpointNameEnum.SMALL, KittBreakpointNameEnum.MEDIUM, KittBreakpointNameEnum.LARGE, KittBreakpointNameEnum.WIDE].forEach(typeName => {
|
|
3161
|
-
const value = typeWithMediumForced[typeName];
|
|
3162
|
-
if (value) {
|
|
3163
|
-
iconSizeForNativeBase[typeName] = `kitt.icon.typographySize.${value}.${getIconSizeConfigKeyFromTypeName(typeName)}.iconSize`;
|
|
3164
|
-
}
|
|
3165
|
-
});
|
|
3166
|
-
return iconSizeForNativeBase;
|
|
3167
|
-
}
|
|
3168
3330
|
function TypographyIconSpecifiedColor({
|
|
3169
3331
|
color,
|
|
3170
3332
|
size,
|
|
3171
3333
|
...props
|
|
3172
3334
|
}) {
|
|
3173
|
-
const ancestorType = useTypographyAncestorType();
|
|
3174
|
-
const iconSize = size || (ancestorType ? createNativeBaseIconSize(ancestorType) : undefined);
|
|
3175
3335
|
const colorValue = getTypographyColorValue(color);
|
|
3176
3336
|
const sx = useSx();
|
|
3177
3337
|
const {
|
|
@@ -3181,7 +3341,7 @@ function TypographyIconSpecifiedColor({
|
|
|
3181
3341
|
});
|
|
3182
3342
|
return /*#__PURE__*/jsx(Icon, {
|
|
3183
3343
|
...props,
|
|
3184
|
-
size:
|
|
3344
|
+
size: size,
|
|
3185
3345
|
color: colorStyleValue
|
|
3186
3346
|
});
|
|
3187
3347
|
}
|
|
@@ -4012,7 +4172,12 @@ function NativeOpacityAnimation$2({
|
|
|
4012
4172
|
duration,
|
|
4013
4173
|
easing
|
|
4014
4174
|
} = theme.kitt.cardModal.animation.overlay;
|
|
4015
|
-
const
|
|
4175
|
+
const {
|
|
4176
|
+
x1,
|
|
4177
|
+
y1,
|
|
4178
|
+
x2,
|
|
4179
|
+
y2
|
|
4180
|
+
} = easing;
|
|
4016
4181
|
return {
|
|
4017
4182
|
opacity: withTiming(visible ? 1 : 0, {
|
|
4018
4183
|
duration,
|
|
@@ -4050,7 +4215,12 @@ function NativeRotationAnimation$1({
|
|
|
4050
4215
|
duration,
|
|
4051
4216
|
easing
|
|
4052
4217
|
} = theme.kitt.cardModal.animation.content;
|
|
4053
|
-
const
|
|
4218
|
+
const {
|
|
4219
|
+
x1,
|
|
4220
|
+
y1,
|
|
4221
|
+
x2,
|
|
4222
|
+
y2
|
|
4223
|
+
} = easing;
|
|
4054
4224
|
rotation.value = withTiming(visible ? 0 : 5, {
|
|
4055
4225
|
duration,
|
|
4056
4226
|
easing: Easing$1.bezier(x1, y1, x2, y2)
|
|
@@ -4623,7 +4793,12 @@ function NativeOpacityAnimation$1({
|
|
|
4623
4793
|
duration,
|
|
4624
4794
|
easing
|
|
4625
4795
|
} = theme.kitt.dialogModal.animation.overlay;
|
|
4626
|
-
const
|
|
4796
|
+
const {
|
|
4797
|
+
x1,
|
|
4798
|
+
y1,
|
|
4799
|
+
x2,
|
|
4800
|
+
y2
|
|
4801
|
+
} = easing;
|
|
4627
4802
|
return {
|
|
4628
4803
|
opacity: withTiming(visible ? 1 : 0, {
|
|
4629
4804
|
duration,
|
|
@@ -4661,7 +4836,12 @@ function NativeRotationAnimation({
|
|
|
4661
4836
|
duration,
|
|
4662
4837
|
easing
|
|
4663
4838
|
} = theme.kitt.dialogModal.animation.content;
|
|
4664
|
-
const
|
|
4839
|
+
const {
|
|
4840
|
+
x1,
|
|
4841
|
+
y1,
|
|
4842
|
+
x2,
|
|
4843
|
+
y2
|
|
4844
|
+
} = easing;
|
|
4665
4845
|
rotation.value = withTiming(visible ? 0 : 5, {
|
|
4666
4846
|
duration,
|
|
4667
4847
|
easing: Easing$1.bezier(x1, y1, x2, y2)
|
|
@@ -6283,7 +6463,7 @@ function DocumentPicker({
|
|
|
6283
6463
|
...documentPickerOptions,
|
|
6284
6464
|
multiple: false
|
|
6285
6465
|
});
|
|
6286
|
-
if (!result.canceled && result.assets[0]
|
|
6466
|
+
if (!result.canceled && result.assets[0]?.file) {
|
|
6287
6467
|
onDocumentUpload(result.assets[0].file);
|
|
6288
6468
|
}
|
|
6289
6469
|
},
|
|
@@ -6310,7 +6490,7 @@ function ImagePicker({
|
|
|
6310
6490
|
...imagePickerOptions,
|
|
6311
6491
|
allowsMultipleSelection: false
|
|
6312
6492
|
});
|
|
6313
|
-
if (!result.canceled) {
|
|
6493
|
+
if (!result.canceled && result.assets[0]) {
|
|
6314
6494
|
onImageSelected(result.assets[0]);
|
|
6315
6495
|
}
|
|
6316
6496
|
},
|
|
@@ -6759,17 +6939,17 @@ function GoogleMapsAutocompleteProvider({
|
|
|
6759
6939
|
dispatch({
|
|
6760
6940
|
type: 'search-error'
|
|
6761
6941
|
});
|
|
6762
|
-
return;
|
|
6763
6942
|
}
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6943
|
+
if (results) {
|
|
6944
|
+
// We cache the results to avoid calling the API again if the user types the same value
|
|
6945
|
+
searchResultsCache.current[value] = results;
|
|
6946
|
+
dispatch({
|
|
6947
|
+
type: 'search-success',
|
|
6948
|
+
payload: {
|
|
6949
|
+
results
|
|
6950
|
+
}
|
|
6951
|
+
});
|
|
6952
|
+
}
|
|
6773
6953
|
} catch (error) {
|
|
6774
6954
|
dispatch({
|
|
6775
6955
|
type: 'search-error'
|
|
@@ -7847,7 +8027,12 @@ function NativeOpacityAnimation({
|
|
|
7847
8027
|
duration,
|
|
7848
8028
|
easing
|
|
7849
8029
|
} = theme.kitt.fullscreenModal.animation.overlay;
|
|
7850
|
-
const
|
|
8030
|
+
const {
|
|
8031
|
+
x1,
|
|
8032
|
+
y1,
|
|
8033
|
+
x2,
|
|
8034
|
+
y2
|
|
8035
|
+
} = easing;
|
|
7851
8036
|
return {
|
|
7852
8037
|
opacity: withTiming(visible ? 1 : 0, {
|
|
7853
8038
|
duration,
|
|
@@ -7886,7 +8071,12 @@ function NativeSlideInAnimation({
|
|
|
7886
8071
|
duration,
|
|
7887
8072
|
easing
|
|
7888
8073
|
} = theme.kitt.fullscreenModal.animation.content;
|
|
7889
|
-
const
|
|
8074
|
+
const {
|
|
8075
|
+
x1,
|
|
8076
|
+
y1,
|
|
8077
|
+
x2,
|
|
8078
|
+
y2
|
|
8079
|
+
} = easing;
|
|
7890
8080
|
return {
|
|
7891
8081
|
transform: [{
|
|
7892
8082
|
translateY: withTiming(visible ? 0 : wHeight, {
|
|
@@ -8544,12 +8734,11 @@ const SvgPinMarkerinline = props => /*#__PURE__*/jsxs("svg", {
|
|
|
8544
8734
|
width: 34,
|
|
8545
8735
|
height: 36,
|
|
8546
8736
|
viewBox: "0 0 34 36",
|
|
8547
|
-
fill: "
|
|
8737
|
+
fill: "currentColor",
|
|
8548
8738
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8549
8739
|
...props,
|
|
8550
8740
|
children: [/*#__PURE__*/jsx("path", {
|
|
8551
8741
|
d: "M17 .5C26.113.5 33.5 7.887 33.5 17c0 8.272-6.087 15.121-14.025 16.315-.05.008-.157.054-.337.211-.173.151-.351.345-.56.57a5.972 5.972 0 0 1-.662.637c-.232.181-.545.367-.916.367-.37 0-.684-.186-.916-.367a5.972 5.972 0 0 1-.662-.637c-.209-.224-.387-.419-.56-.57-.18-.157-.287-.203-.337-.21C6.586 32.12.5 25.271.5 17 .5 7.887 7.887.5 17 .5Z",
|
|
8552
|
-
fill: "#7B66FF",
|
|
8553
8742
|
stroke: "#fff"
|
|
8554
8743
|
}), /*#__PURE__*/jsx("path", {
|
|
8555
8744
|
d: "M17 10a5.506 5.506 0 0 0-5.5 5.5c0 4.706 5 8.26 5.213 8.41a.5.5 0 0 0 .574 0c.213-.15 5.213-3.704 5.213-8.41A5.506 5.506 0 0 0 17 10Zm0 3.5a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z",
|
|
@@ -8574,6 +8763,13 @@ const SvgShadowinline = props => /*#__PURE__*/jsx("svg", {
|
|
|
8574
8763
|
})
|
|
8575
8764
|
});
|
|
8576
8765
|
|
|
8766
|
+
let MapMarkerVariantEnum = /*#__PURE__*/function (MapMarkerVariantEnum) {
|
|
8767
|
+
MapMarkerVariantEnum["HOME"] = "home";
|
|
8768
|
+
MapMarkerVariantEnum["MEETING_POINT"] = "meetingPoint";
|
|
8769
|
+
MapMarkerVariantEnum["CLOSE_MEETING_POINT"] = "closeMeetingPoint";
|
|
8770
|
+
return MapMarkerVariantEnum;
|
|
8771
|
+
}({});
|
|
8772
|
+
|
|
8577
8773
|
const SCALE_DURATION = 300;
|
|
8578
8774
|
const TRANSLATE_Y_DURATION = 150;
|
|
8579
8775
|
const useNativeAnimation = ({
|
|
@@ -8630,18 +8826,12 @@ const getBackgroundColor = ({
|
|
|
8630
8826
|
isSelected,
|
|
8631
8827
|
variant
|
|
8632
8828
|
}) => {
|
|
8633
|
-
if (variant ===
|
|
8829
|
+
if (variant === MapMarkerVariantEnum.HOME || variant === MapMarkerVariantEnum.CLOSE_MEETING_POINT) {
|
|
8634
8830
|
return isSelected || isHovered ? theme.mapMarker.home.selected : theme.mapMarker.home.default;
|
|
8635
8831
|
}
|
|
8636
8832
|
return isSelected || isHovered ? theme.mapMarker.meetingPoint.selected : theme.mapMarker.meetingPoint.default;
|
|
8637
8833
|
};
|
|
8638
8834
|
|
|
8639
|
-
let MapMarkerVariantEnum = /*#__PURE__*/function (MapMarkerVariantEnum) {
|
|
8640
|
-
MapMarkerVariantEnum["HOME"] = "home";
|
|
8641
|
-
MapMarkerVariantEnum["MEETING_POINT"] = "meetingPoint";
|
|
8642
|
-
MapMarkerVariantEnum["CLOSE_MEETING_POINT"] = "closeMeetingPoint";
|
|
8643
|
-
return MapMarkerVariantEnum;
|
|
8644
|
-
}({});
|
|
8645
8835
|
function StaticMapMarker$1({
|
|
8646
8836
|
variant,
|
|
8647
8837
|
isHovered,
|
|
@@ -9554,6 +9744,148 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9554
9744
|
backgroundColor: theme.picker.web.optionsContainer.backgroundColor
|
|
9555
9745
|
}
|
|
9556
9746
|
}
|
|
9747
|
+
},
|
|
9748
|
+
tabBar: {
|
|
9749
|
+
underline: {
|
|
9750
|
+
default: {
|
|
9751
|
+
active: {
|
|
9752
|
+
color: {
|
|
9753
|
+
default: theme.tabBar.underline.default.active.color.default,
|
|
9754
|
+
focused: theme.tabBar.underline.default.active.color.focused,
|
|
9755
|
+
hovered: theme.tabBar.underline.default.active.color.hovered,
|
|
9756
|
+
pressed: theme.tabBar.underline.default.active.color.pressed
|
|
9757
|
+
},
|
|
9758
|
+
indicator: {
|
|
9759
|
+
backgroundColor: theme.tabBar.underline.default.active.indicator.backgroundColor
|
|
9760
|
+
}
|
|
9761
|
+
},
|
|
9762
|
+
inactive: {
|
|
9763
|
+
color: {
|
|
9764
|
+
default: theme.tabBar.underline.default.inactive.color.default,
|
|
9765
|
+
focused: theme.tabBar.underline.default.inactive.color.focused,
|
|
9766
|
+
hovered: theme.tabBar.underline.default.inactive.color.hovered,
|
|
9767
|
+
pressed: theme.tabBar.underline.default.inactive.color.pressed
|
|
9768
|
+
}
|
|
9769
|
+
},
|
|
9770
|
+
disabled: {
|
|
9771
|
+
color: {
|
|
9772
|
+
default: theme.tabBar.underline.default.disabled.color.default,
|
|
9773
|
+
focused: theme.tabBar.underline.default.disabled.color.focused,
|
|
9774
|
+
hovered: theme.tabBar.underline.default.disabled.color.hovered,
|
|
9775
|
+
pressed: theme.tabBar.underline.default.disabled.color.pressed
|
|
9776
|
+
}
|
|
9777
|
+
},
|
|
9778
|
+
borderBottomColor: theme.tabBar.underline.default.borderBottomColor
|
|
9779
|
+
},
|
|
9780
|
+
revert: {
|
|
9781
|
+
active: {
|
|
9782
|
+
color: {
|
|
9783
|
+
default: theme.tabBar.underline.revert.active.color.default,
|
|
9784
|
+
focused: theme.tabBar.underline.revert.active.color.focused,
|
|
9785
|
+
hovered: theme.tabBar.underline.revert.active.color.hovered,
|
|
9786
|
+
pressed: theme.tabBar.underline.revert.active.color.pressed
|
|
9787
|
+
},
|
|
9788
|
+
indicator: {
|
|
9789
|
+
backgroundColor: theme.tabBar.underline.revert.active.indicator.backgroundColor
|
|
9790
|
+
}
|
|
9791
|
+
},
|
|
9792
|
+
inactive: {
|
|
9793
|
+
color: {
|
|
9794
|
+
default: theme.tabBar.underline.revert.inactive.color.default,
|
|
9795
|
+
focused: theme.tabBar.underline.revert.inactive.color.focused,
|
|
9796
|
+
hovered: theme.tabBar.underline.revert.inactive.color.hovered,
|
|
9797
|
+
pressed: theme.tabBar.underline.revert.inactive.color.pressed
|
|
9798
|
+
}
|
|
9799
|
+
},
|
|
9800
|
+
disabled: {
|
|
9801
|
+
color: {
|
|
9802
|
+
default: theme.tabBar.underline.revert.disabled.color.default,
|
|
9803
|
+
focused: theme.tabBar.underline.revert.disabled.color.focused,
|
|
9804
|
+
hovered: theme.tabBar.underline.revert.disabled.color.hovered,
|
|
9805
|
+
pressed: theme.tabBar.underline.revert.disabled.color.pressed
|
|
9806
|
+
}
|
|
9807
|
+
},
|
|
9808
|
+
borderBottomColor: theme.tabBar.underline.revert.borderBottomColor
|
|
9809
|
+
}
|
|
9810
|
+
},
|
|
9811
|
+
solid: {
|
|
9812
|
+
default: {
|
|
9813
|
+
active: {
|
|
9814
|
+
color: {
|
|
9815
|
+
default: theme.tabBar.solid.default.active.color.default,
|
|
9816
|
+
focused: theme.tabBar.solid.default.active.color.focused,
|
|
9817
|
+
hovered: theme.tabBar.solid.default.active.color.hovered,
|
|
9818
|
+
pressed: theme.tabBar.solid.default.active.color.pressed
|
|
9819
|
+
},
|
|
9820
|
+
backgroundColor: {
|
|
9821
|
+
default: theme.tabBar.solid.default.active.backgroundColor?.default,
|
|
9822
|
+
focused: theme.tabBar.solid.default.active.backgroundColor?.focused,
|
|
9823
|
+
hovered: theme.tabBar.solid.default.active.backgroundColor?.hovered,
|
|
9824
|
+
pressed: theme.tabBar.solid.default.active.backgroundColor?.pressed
|
|
9825
|
+
}
|
|
9826
|
+
},
|
|
9827
|
+
inactive: {
|
|
9828
|
+
color: {
|
|
9829
|
+
default: theme.tabBar.solid.default.inactive.color.default,
|
|
9830
|
+
focused: theme.tabBar.solid.default.inactive.color.focused,
|
|
9831
|
+
hovered: theme.tabBar.solid.default.inactive.color.hovered,
|
|
9832
|
+
pressed: theme.tabBar.solid.default.inactive.color.pressed
|
|
9833
|
+
},
|
|
9834
|
+
backgroundColor: {
|
|
9835
|
+
default: theme.tabBar.solid.default.inactive.backgroundColor?.default,
|
|
9836
|
+
focused: theme.tabBar.solid.default.inactive.backgroundColor?.focused,
|
|
9837
|
+
hovered: theme.tabBar.solid.default.inactive.backgroundColor?.hovered,
|
|
9838
|
+
pressed: theme.tabBar.solid.default.inactive.backgroundColor?.pressed
|
|
9839
|
+
}
|
|
9840
|
+
},
|
|
9841
|
+
disabled: {
|
|
9842
|
+
color: {
|
|
9843
|
+
default: theme.tabBar.solid.default.disabled.color.default,
|
|
9844
|
+
focused: theme.tabBar.solid.default.disabled.color.focused,
|
|
9845
|
+
hovered: theme.tabBar.solid.default.disabled.color.hovered,
|
|
9846
|
+
pressed: theme.tabBar.solid.default.disabled.color.pressed
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
},
|
|
9850
|
+
revert: {
|
|
9851
|
+
active: {
|
|
9852
|
+
color: {
|
|
9853
|
+
default: theme.tabBar.solid.revert.active.color.default,
|
|
9854
|
+
focused: theme.tabBar.solid.revert.active.color.focused,
|
|
9855
|
+
hovered: theme.tabBar.solid.revert.active.color.hovered,
|
|
9856
|
+
pressed: theme.tabBar.solid.revert.active.color.pressed
|
|
9857
|
+
},
|
|
9858
|
+
backgroundColor: {
|
|
9859
|
+
default: theme.tabBar.solid.revert.active.backgroundColor?.default,
|
|
9860
|
+
focused: theme.tabBar.solid.revert.active.backgroundColor?.focused,
|
|
9861
|
+
hovered: theme.tabBar.solid.revert.active.backgroundColor?.hovered,
|
|
9862
|
+
pressed: theme.tabBar.solid.revert.active.backgroundColor?.pressed
|
|
9863
|
+
}
|
|
9864
|
+
},
|
|
9865
|
+
inactive: {
|
|
9866
|
+
color: {
|
|
9867
|
+
default: theme.tabBar.solid.revert.inactive.color.default,
|
|
9868
|
+
focused: theme.tabBar.solid.revert.inactive.color.focused,
|
|
9869
|
+
hovered: theme.tabBar.solid.revert.inactive.color.hovered,
|
|
9870
|
+
pressed: theme.tabBar.solid.revert.inactive.color.pressed
|
|
9871
|
+
},
|
|
9872
|
+
backgroundColor: {
|
|
9873
|
+
default: theme.tabBar.solid.revert.inactive.backgroundColor?.default,
|
|
9874
|
+
focused: theme.tabBar.solid.revert.inactive.backgroundColor?.focused,
|
|
9875
|
+
hovered: theme.tabBar.solid.revert.inactive.backgroundColor?.hovered,
|
|
9876
|
+
pressed: theme.tabBar.solid.revert.inactive.backgroundColor?.pressed
|
|
9877
|
+
}
|
|
9878
|
+
},
|
|
9879
|
+
disabled: {
|
|
9880
|
+
color: {
|
|
9881
|
+
default: theme.tabBar.solid.revert.disabled.color.default,
|
|
9882
|
+
focused: theme.tabBar.solid.revert.disabled.color.focused,
|
|
9883
|
+
hovered: theme.tabBar.solid.revert.disabled.color.hovered,
|
|
9884
|
+
pressed: theme.tabBar.solid.revert.disabled.color.pressed
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9888
|
+
}
|
|
9557
9889
|
}
|
|
9558
9890
|
},
|
|
9559
9891
|
app: appTheme?.colors
|
|
@@ -9630,6 +9962,44 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
9630
9962
|
highlight: {
|
|
9631
9963
|
borderRadius: theme.highlight.borderRadius
|
|
9632
9964
|
},
|
|
9965
|
+
tabBar: {
|
|
9966
|
+
underline: {
|
|
9967
|
+
default: {
|
|
9968
|
+
active: {
|
|
9969
|
+
borderRadius: theme.tabBar.underline.default.active.borderRadius
|
|
9970
|
+
},
|
|
9971
|
+
inactive: {
|
|
9972
|
+
borderRadius: theme.tabBar.underline.default.inactive.borderRadius
|
|
9973
|
+
}
|
|
9974
|
+
},
|
|
9975
|
+
revert: {
|
|
9976
|
+
active: {
|
|
9977
|
+
borderRadius: theme.tabBar.underline.revert.active.borderRadius
|
|
9978
|
+
},
|
|
9979
|
+
inactive: {
|
|
9980
|
+
borderRadius: theme.tabBar.underline.revert.inactive.borderRadius
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
9983
|
+
},
|
|
9984
|
+
solid: {
|
|
9985
|
+
default: {
|
|
9986
|
+
active: {
|
|
9987
|
+
borderRadius: theme.tabBar.solid.default.active.borderRadius
|
|
9988
|
+
},
|
|
9989
|
+
inactive: {
|
|
9990
|
+
borderRadius: theme.tabBar.solid.default.inactive.borderRadius
|
|
9991
|
+
}
|
|
9992
|
+
},
|
|
9993
|
+
revert: {
|
|
9994
|
+
active: {
|
|
9995
|
+
borderRadius: theme.tabBar.solid.revert.active.borderRadius
|
|
9996
|
+
},
|
|
9997
|
+
inactive: {
|
|
9998
|
+
borderRadius: theme.tabBar.solid.revert.inactive.borderRadius
|
|
9999
|
+
}
|
|
10000
|
+
}
|
|
10001
|
+
}
|
|
10002
|
+
},
|
|
9633
10003
|
tag: {
|
|
9634
10004
|
borderRadius: theme.tag.borderRadius
|
|
9635
10005
|
},
|
|
@@ -12465,125 +12835,132 @@ const StoryGrid = {
|
|
|
12465
12835
|
Col: StoryGridCol
|
|
12466
12836
|
};
|
|
12467
12837
|
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
return isActive ? kittTheme.colors.primary : kittTheme.colors.blackLight;
|
|
12484
|
-
}
|
|
12485
|
-
}
|
|
12486
|
-
}
|
|
12487
|
-
function useTabBarIndicatorColor(color, isActive) {
|
|
12488
|
-
const {
|
|
12489
|
-
kitt: kittTheme
|
|
12490
|
-
} = useKittTheme();
|
|
12491
|
-
switch (color) {
|
|
12492
|
-
case 'black':
|
|
12493
|
-
{
|
|
12494
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
12495
|
-
}
|
|
12496
|
-
case 'white':
|
|
12497
|
-
{
|
|
12498
|
-
return isActive ? kittTheme.palettes.deepPurple.white : kittTheme.palettes.deepPurple.transparent;
|
|
12499
|
-
}
|
|
12500
|
-
default:
|
|
12501
|
-
{
|
|
12502
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
12503
|
-
}
|
|
12504
|
-
}
|
|
12505
|
-
}
|
|
12838
|
+
const getVariantFromColor = color => {
|
|
12839
|
+
if (color === 'white') return 'revert';
|
|
12840
|
+
return 'default';
|
|
12841
|
+
};
|
|
12842
|
+
const getTabBarItemActiveState = (isActive, disabled) => {
|
|
12843
|
+
if (disabled) return 'disabled';
|
|
12844
|
+
if (isActive) return 'active';
|
|
12845
|
+
return 'inactive';
|
|
12846
|
+
};
|
|
12847
|
+
const getTabBarItemState = (isHovered, isPressed, isFocused) => {
|
|
12848
|
+
if (isHovered) return 'hovered';
|
|
12849
|
+
if (isPressed) return 'pressed';
|
|
12850
|
+
if (isFocused) return 'focused';
|
|
12851
|
+
return 'default';
|
|
12852
|
+
};
|
|
12506
12853
|
function TabBarItem({
|
|
12507
12854
|
name,
|
|
12508
12855
|
icon,
|
|
12509
|
-
|
|
12856
|
+
variant = 'default',
|
|
12857
|
+
type = 'underline',
|
|
12858
|
+
color,
|
|
12510
12859
|
testID,
|
|
12860
|
+
disabled,
|
|
12511
12861
|
isActive = false,
|
|
12862
|
+
isFocusedInternal = false,
|
|
12863
|
+
isHoveredInternal = false,
|
|
12864
|
+
isPressedInternal = false,
|
|
12512
12865
|
onPress
|
|
12513
12866
|
}) {
|
|
12514
|
-
|
|
12515
|
-
const
|
|
12867
|
+
// Keep backward compatibility with color property
|
|
12868
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
12869
|
+
const activeState = getTabBarItemActiveState(isActive, disabled);
|
|
12870
|
+
const baseTheme = `kitt.tabBar.${type}.${definedVariant}.${activeState}`;
|
|
12516
12871
|
return /*#__PURE__*/jsx(Pressable, {
|
|
12872
|
+
disabled: disabled,
|
|
12517
12873
|
testID: testID,
|
|
12518
12874
|
onPress: onPress,
|
|
12519
|
-
children:
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
children:
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12539
|
-
,
|
|
12540
|
-
|
|
12541
|
-
|
|
12542
|
-
|
|
12543
|
-
|
|
12875
|
+
children: ({
|
|
12876
|
+
isHovered,
|
|
12877
|
+
isPressed,
|
|
12878
|
+
isFocused
|
|
12879
|
+
}) => {
|
|
12880
|
+
const state = getTabBarItemState(isHovered || isHoveredInternal, isPressed || isPressedInternal, isFocused || isFocusedInternal);
|
|
12881
|
+
return /*#__PURE__*/jsxs(HStack, {
|
|
12882
|
+
alignItems: "center",
|
|
12883
|
+
position: "relative",
|
|
12884
|
+
paddingY: "kitt.2",
|
|
12885
|
+
paddingRight: "kitt.2",
|
|
12886
|
+
paddingLeft: icon ? undefined : 'kitt.2',
|
|
12887
|
+
backgroundColor: `${baseTheme}.backgroundColor.${state}`,
|
|
12888
|
+
borderRadius: `${baseTheme}.borderRadius`,
|
|
12889
|
+
children: [icon ? /*#__PURE__*/jsx(View, {
|
|
12890
|
+
marginRight: "kitt.2",
|
|
12891
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
12892
|
+
color: `${baseTheme}.color.${state}`,
|
|
12893
|
+
icon: icon
|
|
12894
|
+
})
|
|
12895
|
+
}) : null, /*#__PURE__*/jsx(Typography.Text, {
|
|
12896
|
+
base: "label-large",
|
|
12897
|
+
numberOfLines: 1,
|
|
12898
|
+
color: `${baseTheme}.color.${state}`,
|
|
12899
|
+
children: name
|
|
12900
|
+
}), type !== 'solid' ? /*#__PURE__*/jsx(View, {
|
|
12901
|
+
backgroundColor: `${baseTheme}.indicator.backgroundColor`,
|
|
12902
|
+
position: "absolute",
|
|
12903
|
+
bottom: -1 // in order to be over tab bar's border bottom
|
|
12904
|
+
,
|
|
12905
|
+
left: 0,
|
|
12906
|
+
right: 0,
|
|
12907
|
+
height: 2
|
|
12908
|
+
}) : null]
|
|
12909
|
+
});
|
|
12910
|
+
}
|
|
12544
12911
|
});
|
|
12545
12912
|
}
|
|
12546
12913
|
|
|
12547
12914
|
function TabBar({
|
|
12548
12915
|
tabs,
|
|
12549
|
-
|
|
12916
|
+
variant = 'default',
|
|
12917
|
+
type = 'underline',
|
|
12550
12918
|
align = 'left',
|
|
12919
|
+
color,
|
|
12551
12920
|
activeTabIndex = 0,
|
|
12552
12921
|
renderTabItem,
|
|
12553
|
-
onChangeTab
|
|
12554
|
-
...props
|
|
12922
|
+
onChangeTab
|
|
12555
12923
|
}) {
|
|
12556
12924
|
const sx = useSx();
|
|
12557
|
-
const {
|
|
12558
|
-
kitt: kittTheme
|
|
12559
|
-
} = useKittTheme();
|
|
12560
12925
|
const tabItems = tabs.map((tab, index) => renderTabItem({
|
|
12561
12926
|
tab,
|
|
12562
12927
|
index,
|
|
12563
12928
|
isActive: activeTabIndex === index
|
|
12564
12929
|
}));
|
|
12565
|
-
|
|
12930
|
+
let styles = {
|
|
12566
12931
|
justifyContent: align,
|
|
12567
12932
|
paddingRight: align === 'center' ? 'kitt.2' : 'kitt.12',
|
|
12568
|
-
minWidth: '100%'
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12933
|
+
minWidth: '100%'
|
|
12934
|
+
};
|
|
12935
|
+
|
|
12936
|
+
// Keep backward compatibility with color property
|
|
12937
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
12938
|
+
if (type !== 'solid') {
|
|
12939
|
+
styles = {
|
|
12940
|
+
...styles,
|
|
12941
|
+
borderBottomWidth: 1,
|
|
12942
|
+
borderBottomColor: `kitt.tabBar.${type}.${definedVariant}.borderBottomColor`
|
|
12943
|
+
};
|
|
12944
|
+
}
|
|
12945
|
+
const scrollViewStyles = sx(styles);
|
|
12946
|
+
const space = type === 'solid' ? 'kitt.2' : 'kitt.4';
|
|
12572
12947
|
return /*#__PURE__*/jsx(ScrollView, {
|
|
12573
12948
|
horizontal: true,
|
|
12574
12949
|
showsHorizontalScrollIndicator: false,
|
|
12575
12950
|
contentContainerStyle: scrollViewStyles,
|
|
12576
12951
|
children: /*#__PURE__*/jsx(HStack, {
|
|
12577
|
-
space: align === 'center' ? 'kitt.16' :
|
|
12578
|
-
...props,
|
|
12952
|
+
space: align === 'center' ? 'kitt.16' : space,
|
|
12579
12953
|
children: Children.map(tabItems, (child, index) => {
|
|
12580
12954
|
const tab = tabs[index];
|
|
12955
|
+
if (!tab) throw new Error(`TabBar: tab is undefined at index ${index}`);
|
|
12581
12956
|
return /*#__PURE__*/jsx(View, {
|
|
12582
12957
|
children: /*#__PURE__*/cloneElement(child, {
|
|
12583
12958
|
color,
|
|
12959
|
+
variant: definedVariant,
|
|
12960
|
+
type,
|
|
12584
12961
|
onPress: event => {
|
|
12585
12962
|
onChangeTab({
|
|
12586
|
-
tab
|
|
12963
|
+
tab,
|
|
12587
12964
|
index
|
|
12588
12965
|
});
|
|
12589
12966
|
child.props.onPress?.(event);
|