@ornikar/kitt-universal 27.5.1-canary.4d3ec9b2bbb3371c254ae88141f81bb445a59f73.0 → 27.6.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/CHANGELOG.md +6 -5
- 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/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/icon.d.ts +0 -20
- package/dist/definitions/themes/late-ocean/icon.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 +565 -250
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +565 -250
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +456 -140
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +457 -141
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +456 -140
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +457 -141
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +567 -242
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +566 -241
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +179 -36
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +179 -36
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.js +179 -36
- package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
- package/dist/linaria-themes-node-22.17.cjs.web.js +179 -36
- package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-22.17.es.mjs +179 -36
- package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
- package/dist/linaria-themes-node-22.17.es.web.mjs +179 -36
- package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +179 -36
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +179 -36
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
- package/scripts/codemods/card-modal.js +155 -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} +12 -12
- package/scripts/transformers/card-modal.js +0 -136
- package/scripts/transformers/fullscreen-modal.js +0 -138
- package/scripts/transformers/navigation-modal.js +0 -138
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/basic.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/basic.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/withExpressions.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/withExpressions.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/wrongOrder.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/card-modal/wrongOrder.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/basic.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/basic.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/withExpressions.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/withExpressions.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/wrongOrder.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/fullscreen-modal/wrongOrder.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/basic.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/basic.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/withExpressions.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/withExpressions.output.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/wrongOrder.input.js +0 -0
- /package/scripts/{transformers → codemods}/__testfixtures__/navigation-modal/wrongOrder.output.js +0 -0
- /package/scripts/{transformers → codemods}/__tests__/card-modal.test.js +0 -0
- /package/scripts/{transformers → codemods}/__tests__/fullscreen-modal.test.js +0 -0
- /package/scripts/{transformers → codemods}/__tests__/navigation-modal.test.js +0 -0
|
@@ -1886,43 +1886,8 @@ const highlight = {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
1888
|
|
|
1889
|
-
const getIconSizeFromFontSize = fontSize => {
|
|
1890
|
-
if (fontSize <= 14) return 16;
|
|
1891
|
-
if (fontSize <= 16) return 20;
|
|
1892
|
-
return 24;
|
|
1893
|
-
};
|
|
1894
|
-
const createTypographyIconSizeConfig = (baseAndSmallFontSize, mediumAndWideFontSize) => {
|
|
1895
|
-
const baseAndSmallIconSize = getIconSizeFromFontSize(baseAndSmallFontSize);
|
|
1896
|
-
const mediumAndWideIconSize = getIconSizeFromFontSize(mediumAndWideFontSize);
|
|
1897
|
-
return {
|
|
1898
|
-
baseAndSmall: {
|
|
1899
|
-
iconSize: baseAndSmallIconSize
|
|
1900
|
-
},
|
|
1901
|
-
mediumAndWide: {
|
|
1902
|
-
iconSize: mediumAndWideIconSize
|
|
1903
|
-
}
|
|
1904
|
-
};
|
|
1905
|
-
};
|
|
1906
1889
|
const icon = {
|
|
1907
|
-
defaultSize: 20
|
|
1908
|
-
// Note: this is based on typography updated sizes, not current https://github.com/ornikar/kitt/pull/2130
|
|
1909
|
-
typographySize: {
|
|
1910
|
-
// also known as xxlarge
|
|
1911
|
-
header1: createTypographyIconSizeConfig(40, 56),
|
|
1912
|
-
// also known as xlarge
|
|
1913
|
-
header2: createTypographyIconSizeConfig(32, 48),
|
|
1914
|
-
// also known as medium
|
|
1915
|
-
header3: createTypographyIconSizeConfig(24, 40),
|
|
1916
|
-
// also known as xsmall
|
|
1917
|
-
header4: createTypographyIconSizeConfig(18, 24),
|
|
1918
|
-
// also known as xxsmall
|
|
1919
|
-
header5: createTypographyIconSizeConfig(18, 18),
|
|
1920
|
-
'body-large': createTypographyIconSizeConfig(18, 24),
|
|
1921
|
-
'body-medium': createTypographyIconSizeConfig(18, 18),
|
|
1922
|
-
body: createTypographyIconSizeConfig(16, 16),
|
|
1923
|
-
'body-small': createTypographyIconSizeConfig(14, 14),
|
|
1924
|
-
'body-xsmall': createTypographyIconSizeConfig(12, 12)
|
|
1925
|
-
}
|
|
1890
|
+
defaultSize: 20
|
|
1926
1891
|
};
|
|
1927
1892
|
|
|
1928
1893
|
const iconButton = {
|
|
@@ -2349,6 +2314,183 @@ const skeleton$1 = {
|
|
|
2349
2314
|
}
|
|
2350
2315
|
};
|
|
2351
2316
|
|
|
2317
|
+
const tabBar = {
|
|
2318
|
+
underline: {
|
|
2319
|
+
default: {
|
|
2320
|
+
active: {
|
|
2321
|
+
color: {
|
|
2322
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2323
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2324
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2325
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2326
|
+
},
|
|
2327
|
+
indicator: {
|
|
2328
|
+
backgroundColor: deepPurpleColorPalette['deepPurple.8']
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
inactive: {
|
|
2332
|
+
color: {
|
|
2333
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2334
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2335
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2336
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2337
|
+
},
|
|
2338
|
+
indicator: {
|
|
2339
|
+
backgroundColor: undefined
|
|
2340
|
+
}
|
|
2341
|
+
},
|
|
2342
|
+
disabled: {
|
|
2343
|
+
color: {
|
|
2344
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2345
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2346
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2347
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2348
|
+
},
|
|
2349
|
+
indicator: {
|
|
2350
|
+
backgroundColor: undefined
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2353
|
+
borderBottomColor: deepPurpleColorPalette['beige.3']
|
|
2354
|
+
},
|
|
2355
|
+
revert: {
|
|
2356
|
+
active: {
|
|
2357
|
+
color: {
|
|
2358
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2359
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2360
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2361
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2362
|
+
},
|
|
2363
|
+
indicator: {
|
|
2364
|
+
backgroundColor: deepPurpleColorPalette['grey.0']
|
|
2365
|
+
}
|
|
2366
|
+
},
|
|
2367
|
+
inactive: {
|
|
2368
|
+
color: {
|
|
2369
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2370
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2371
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2372
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2373
|
+
},
|
|
2374
|
+
indicator: {
|
|
2375
|
+
backgroundColor: undefined
|
|
2376
|
+
}
|
|
2377
|
+
},
|
|
2378
|
+
disabled: {
|
|
2379
|
+
color: {
|
|
2380
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2381
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2382
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2383
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2384
|
+
},
|
|
2385
|
+
indicator: {
|
|
2386
|
+
backgroundColor: undefined
|
|
2387
|
+
}
|
|
2388
|
+
},
|
|
2389
|
+
borderBottomColor: deepPurpleColorPalette['white-alpha.20']
|
|
2390
|
+
}
|
|
2391
|
+
},
|
|
2392
|
+
solid: {
|
|
2393
|
+
default: {
|
|
2394
|
+
active: {
|
|
2395
|
+
color: {
|
|
2396
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2397
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2398
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2399
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2400
|
+
},
|
|
2401
|
+
backgroundColor: {
|
|
2402
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2403
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2404
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2405
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2406
|
+
},
|
|
2407
|
+
borderRadius: 4,
|
|
2408
|
+
indicator: {
|
|
2409
|
+
backgroundColor: undefined
|
|
2410
|
+
}
|
|
2411
|
+
},
|
|
2412
|
+
inactive: {
|
|
2413
|
+
color: {
|
|
2414
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2415
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2416
|
+
hovered: deepPurpleColorPalette['grey.5'],
|
|
2417
|
+
pressed: deepPurpleColorPalette['grey.5']
|
|
2418
|
+
},
|
|
2419
|
+
backgroundColor: {
|
|
2420
|
+
default: undefined,
|
|
2421
|
+
focused: undefined,
|
|
2422
|
+
hovered: deepPurpleColorPalette['beige.1'],
|
|
2423
|
+
pressed: deepPurpleColorPalette['beige.1']
|
|
2424
|
+
},
|
|
2425
|
+
borderRadius: 4,
|
|
2426
|
+
indicator: {
|
|
2427
|
+
backgroundColor: undefined
|
|
2428
|
+
}
|
|
2429
|
+
},
|
|
2430
|
+
disabled: {
|
|
2431
|
+
color: {
|
|
2432
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2433
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2434
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2435
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2436
|
+
},
|
|
2437
|
+
indicator: {
|
|
2438
|
+
backgroundColor: undefined
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
},
|
|
2442
|
+
revert: {
|
|
2443
|
+
active: {
|
|
2444
|
+
color: {
|
|
2445
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2446
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2447
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2448
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2449
|
+
},
|
|
2450
|
+
backgroundColor: {
|
|
2451
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2452
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2453
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2454
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2455
|
+
},
|
|
2456
|
+
borderRadius: 4,
|
|
2457
|
+
indicator: {
|
|
2458
|
+
backgroundColor: undefined
|
|
2459
|
+
}
|
|
2460
|
+
},
|
|
2461
|
+
inactive: {
|
|
2462
|
+
color: {
|
|
2463
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2464
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2465
|
+
hovered: deepPurpleColorPalette['white-alpha.80'],
|
|
2466
|
+
pressed: deepPurpleColorPalette['white-alpha.80']
|
|
2467
|
+
},
|
|
2468
|
+
backgroundColor: {
|
|
2469
|
+
default: undefined,
|
|
2470
|
+
focused: undefined,
|
|
2471
|
+
hovered: deepPurpleColorPalette['white-alpha.10'],
|
|
2472
|
+
pressed: deepPurpleColorPalette['white-alpha.10']
|
|
2473
|
+
},
|
|
2474
|
+
borderRadius: 4,
|
|
2475
|
+
indicator: {
|
|
2476
|
+
backgroundColor: undefined
|
|
2477
|
+
}
|
|
2478
|
+
},
|
|
2479
|
+
disabled: {
|
|
2480
|
+
color: {
|
|
2481
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2482
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2483
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2484
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2485
|
+
},
|
|
2486
|
+
indicator: {
|
|
2487
|
+
backgroundColor: undefined
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
};
|
|
2493
|
+
|
|
2352
2494
|
const tag = {
|
|
2353
2495
|
borderRadius: 16,
|
|
2354
2496
|
icon: {
|
|
@@ -2488,6 +2630,7 @@ const theme = {
|
|
|
2488
2630
|
picker,
|
|
2489
2631
|
shadows,
|
|
2490
2632
|
skeleton: skeleton$1,
|
|
2633
|
+
tabBar,
|
|
2491
2634
|
tag,
|
|
2492
2635
|
tooltip,
|
|
2493
2636
|
typography,
|
|
@@ -2911,6 +3054,13 @@ const getTypographyFamilyWithAncestorValue = (type, typographyFamilyInContext) =
|
|
|
2911
3054
|
if (typographyFamilyInContext != null) return typographyFamilyInContext;
|
|
2912
3055
|
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
2913
3056
|
};
|
|
3057
|
+
const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
|
|
3058
|
+
// check if all values are not undefined
|
|
3059
|
+
const isAllValuesUndefined = Object.values(type).every(value => value === undefined);
|
|
3060
|
+
|
|
3061
|
+
// if every values are undefined and we hgave a typographyTypeInContext, we use the parent typography type (typographyTypeInContext)
|
|
3062
|
+
return !!isAllValuesUndefined && !!typographyTypeInContext ? typographyTypeInContext : type;
|
|
3063
|
+
};
|
|
2914
3064
|
|
|
2915
3065
|
const TypographyFamilyContext = /*#__PURE__*/createContext(null);
|
|
2916
3066
|
const TypographyTypeContext = /*#__PURE__*/createContext(null);
|
|
@@ -2918,9 +3068,6 @@ const TypographyColorContext = /*#__PURE__*/createContext('black');
|
|
|
2918
3068
|
function useTypographyColor() {
|
|
2919
3069
|
return useContext(TypographyColorContext);
|
|
2920
3070
|
}
|
|
2921
|
-
function useTypographyAncestorType() {
|
|
2922
|
-
return useContext(TypographyTypeContext);
|
|
2923
|
-
}
|
|
2924
3071
|
const TypographyDefaultColorContext = /*#__PURE__*/createContext(undefined);
|
|
2925
3072
|
function useTypographyDefaultColor() {
|
|
2926
3073
|
return useContext(TypographyDefaultColorContext);
|
|
@@ -3043,9 +3190,11 @@ function Typography({
|
|
|
3043
3190
|
}) {
|
|
3044
3191
|
const sx = useSx();
|
|
3045
3192
|
const typographyFamilyInContext = useContext(TypographyFamilyContext);
|
|
3193
|
+
const typographyTypeInContext = useContext(TypographyTypeContext);
|
|
3046
3194
|
const defaultColor = useTypographyDefaultColor();
|
|
3047
3195
|
const hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3048
|
-
const
|
|
3196
|
+
const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3197
|
+
const baseOrDefaultToBody = typographyType.base ?? 'body-m';
|
|
3049
3198
|
const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3050
3199
|
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3051
3200
|
...type,
|
|
@@ -3084,7 +3233,7 @@ function Typography({
|
|
|
3084
3233
|
const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
|
|
3085
3234
|
value: typographyFamily,
|
|
3086
3235
|
children: /*#__PURE__*/jsx(TypographyTypeContext.Provider, {
|
|
3087
|
-
value:
|
|
3236
|
+
value: typographyType,
|
|
3088
3237
|
children: text
|
|
3089
3238
|
})
|
|
3090
3239
|
}) : text;
|
|
@@ -3185,30 +3334,11 @@ function Icon({
|
|
|
3185
3334
|
});
|
|
3186
3335
|
}
|
|
3187
3336
|
|
|
3188
|
-
function getIconSizeConfigKeyFromTypeName(breakpointName) {
|
|
3189
|
-
return breakpointName === KittBreakpointNameEnum.BASE || breakpointName === KittBreakpointNameEnum.SMALL ? 'baseAndSmall' : 'mediumAndWide';
|
|
3190
|
-
}
|
|
3191
|
-
function createNativeBaseIconSize(type) {
|
|
3192
|
-
const typeWithMediumForced = {
|
|
3193
|
-
...type,
|
|
3194
|
-
medium: type.medium || type.small || type.base
|
|
3195
|
-
};
|
|
3196
|
-
const iconSizeForNativeBase = {};
|
|
3197
|
-
[KittBreakpointNameEnum.BASE, KittBreakpointNameEnum.SMALL, KittBreakpointNameEnum.MEDIUM, KittBreakpointNameEnum.LARGE, KittBreakpointNameEnum.WIDE].forEach(typeName => {
|
|
3198
|
-
const value = typeWithMediumForced[typeName];
|
|
3199
|
-
if (value) {
|
|
3200
|
-
iconSizeForNativeBase[typeName] = `kitt.icon.typographySize.${value}.${getIconSizeConfigKeyFromTypeName(typeName)}.iconSize`;
|
|
3201
|
-
}
|
|
3202
|
-
});
|
|
3203
|
-
return iconSizeForNativeBase;
|
|
3204
|
-
}
|
|
3205
3337
|
function TypographyIconSpecifiedColor({
|
|
3206
3338
|
color,
|
|
3207
3339
|
size,
|
|
3208
3340
|
...props
|
|
3209
3341
|
}) {
|
|
3210
|
-
const ancestorType = useTypographyAncestorType();
|
|
3211
|
-
const iconSize = size || (ancestorType ? createNativeBaseIconSize(ancestorType) : undefined);
|
|
3212
3342
|
const colorValue = getTypographyColorValue(color);
|
|
3213
3343
|
const sx = useSx();
|
|
3214
3344
|
const {
|
|
@@ -3218,7 +3348,7 @@ function TypographyIconSpecifiedColor({
|
|
|
3218
3348
|
});
|
|
3219
3349
|
return /*#__PURE__*/jsx(Icon, {
|
|
3220
3350
|
...props,
|
|
3221
|
-
size:
|
|
3351
|
+
size: size,
|
|
3222
3352
|
color: colorStyleValue
|
|
3223
3353
|
});
|
|
3224
3354
|
}
|
|
@@ -8799,6 +8929,148 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8799
8929
|
backgroundColor: theme.picker.web.optionsContainer.backgroundColor
|
|
8800
8930
|
}
|
|
8801
8931
|
}
|
|
8932
|
+
},
|
|
8933
|
+
tabBar: {
|
|
8934
|
+
underline: {
|
|
8935
|
+
default: {
|
|
8936
|
+
active: {
|
|
8937
|
+
color: {
|
|
8938
|
+
default: theme.tabBar.underline.default.active.color.default,
|
|
8939
|
+
focused: theme.tabBar.underline.default.active.color.focused,
|
|
8940
|
+
hovered: theme.tabBar.underline.default.active.color.hovered,
|
|
8941
|
+
pressed: theme.tabBar.underline.default.active.color.pressed
|
|
8942
|
+
},
|
|
8943
|
+
indicator: {
|
|
8944
|
+
backgroundColor: theme.tabBar.underline.default.active.indicator.backgroundColor
|
|
8945
|
+
}
|
|
8946
|
+
},
|
|
8947
|
+
inactive: {
|
|
8948
|
+
color: {
|
|
8949
|
+
default: theme.tabBar.underline.default.inactive.color.default,
|
|
8950
|
+
focused: theme.tabBar.underline.default.inactive.color.focused,
|
|
8951
|
+
hovered: theme.tabBar.underline.default.inactive.color.hovered,
|
|
8952
|
+
pressed: theme.tabBar.underline.default.inactive.color.pressed
|
|
8953
|
+
}
|
|
8954
|
+
},
|
|
8955
|
+
disabled: {
|
|
8956
|
+
color: {
|
|
8957
|
+
default: theme.tabBar.underline.default.disabled.color.default,
|
|
8958
|
+
focused: theme.tabBar.underline.default.disabled.color.focused,
|
|
8959
|
+
hovered: theme.tabBar.underline.default.disabled.color.hovered,
|
|
8960
|
+
pressed: theme.tabBar.underline.default.disabled.color.pressed
|
|
8961
|
+
}
|
|
8962
|
+
},
|
|
8963
|
+
borderBottomColor: theme.tabBar.underline.default.borderBottomColor
|
|
8964
|
+
},
|
|
8965
|
+
revert: {
|
|
8966
|
+
active: {
|
|
8967
|
+
color: {
|
|
8968
|
+
default: theme.tabBar.underline.revert.active.color.default,
|
|
8969
|
+
focused: theme.tabBar.underline.revert.active.color.focused,
|
|
8970
|
+
hovered: theme.tabBar.underline.revert.active.color.hovered,
|
|
8971
|
+
pressed: theme.tabBar.underline.revert.active.color.pressed
|
|
8972
|
+
},
|
|
8973
|
+
indicator: {
|
|
8974
|
+
backgroundColor: theme.tabBar.underline.revert.active.indicator.backgroundColor
|
|
8975
|
+
}
|
|
8976
|
+
},
|
|
8977
|
+
inactive: {
|
|
8978
|
+
color: {
|
|
8979
|
+
default: theme.tabBar.underline.revert.inactive.color.default,
|
|
8980
|
+
focused: theme.tabBar.underline.revert.inactive.color.focused,
|
|
8981
|
+
hovered: theme.tabBar.underline.revert.inactive.color.hovered,
|
|
8982
|
+
pressed: theme.tabBar.underline.revert.inactive.color.pressed
|
|
8983
|
+
}
|
|
8984
|
+
},
|
|
8985
|
+
disabled: {
|
|
8986
|
+
color: {
|
|
8987
|
+
default: theme.tabBar.underline.revert.disabled.color.default,
|
|
8988
|
+
focused: theme.tabBar.underline.revert.disabled.color.focused,
|
|
8989
|
+
hovered: theme.tabBar.underline.revert.disabled.color.hovered,
|
|
8990
|
+
pressed: theme.tabBar.underline.revert.disabled.color.pressed
|
|
8991
|
+
}
|
|
8992
|
+
},
|
|
8993
|
+
borderBottomColor: theme.tabBar.underline.revert.borderBottomColor
|
|
8994
|
+
}
|
|
8995
|
+
},
|
|
8996
|
+
solid: {
|
|
8997
|
+
default: {
|
|
8998
|
+
active: {
|
|
8999
|
+
color: {
|
|
9000
|
+
default: theme.tabBar.solid.default.active.color.default,
|
|
9001
|
+
focused: theme.tabBar.solid.default.active.color.focused,
|
|
9002
|
+
hovered: theme.tabBar.solid.default.active.color.hovered,
|
|
9003
|
+
pressed: theme.tabBar.solid.default.active.color.pressed
|
|
9004
|
+
},
|
|
9005
|
+
backgroundColor: {
|
|
9006
|
+
default: theme.tabBar.solid.default.active.backgroundColor?.default,
|
|
9007
|
+
focused: theme.tabBar.solid.default.active.backgroundColor?.focused,
|
|
9008
|
+
hovered: theme.tabBar.solid.default.active.backgroundColor?.hovered,
|
|
9009
|
+
pressed: theme.tabBar.solid.default.active.backgroundColor?.pressed
|
|
9010
|
+
}
|
|
9011
|
+
},
|
|
9012
|
+
inactive: {
|
|
9013
|
+
color: {
|
|
9014
|
+
default: theme.tabBar.solid.default.inactive.color.default,
|
|
9015
|
+
focused: theme.tabBar.solid.default.inactive.color.focused,
|
|
9016
|
+
hovered: theme.tabBar.solid.default.inactive.color.hovered,
|
|
9017
|
+
pressed: theme.tabBar.solid.default.inactive.color.pressed
|
|
9018
|
+
},
|
|
9019
|
+
backgroundColor: {
|
|
9020
|
+
default: theme.tabBar.solid.default.inactive.backgroundColor?.default,
|
|
9021
|
+
focused: theme.tabBar.solid.default.inactive.backgroundColor?.focused,
|
|
9022
|
+
hovered: theme.tabBar.solid.default.inactive.backgroundColor?.hovered,
|
|
9023
|
+
pressed: theme.tabBar.solid.default.inactive.backgroundColor?.pressed
|
|
9024
|
+
}
|
|
9025
|
+
},
|
|
9026
|
+
disabled: {
|
|
9027
|
+
color: {
|
|
9028
|
+
default: theme.tabBar.solid.default.disabled.color.default,
|
|
9029
|
+
focused: theme.tabBar.solid.default.disabled.color.focused,
|
|
9030
|
+
hovered: theme.tabBar.solid.default.disabled.color.hovered,
|
|
9031
|
+
pressed: theme.tabBar.solid.default.disabled.color.pressed
|
|
9032
|
+
}
|
|
9033
|
+
}
|
|
9034
|
+
},
|
|
9035
|
+
revert: {
|
|
9036
|
+
active: {
|
|
9037
|
+
color: {
|
|
9038
|
+
default: theme.tabBar.solid.revert.active.color.default,
|
|
9039
|
+
focused: theme.tabBar.solid.revert.active.color.focused,
|
|
9040
|
+
hovered: theme.tabBar.solid.revert.active.color.hovered,
|
|
9041
|
+
pressed: theme.tabBar.solid.revert.active.color.pressed
|
|
9042
|
+
},
|
|
9043
|
+
backgroundColor: {
|
|
9044
|
+
default: theme.tabBar.solid.revert.active.backgroundColor?.default,
|
|
9045
|
+
focused: theme.tabBar.solid.revert.active.backgroundColor?.focused,
|
|
9046
|
+
hovered: theme.tabBar.solid.revert.active.backgroundColor?.hovered,
|
|
9047
|
+
pressed: theme.tabBar.solid.revert.active.backgroundColor?.pressed
|
|
9048
|
+
}
|
|
9049
|
+
},
|
|
9050
|
+
inactive: {
|
|
9051
|
+
color: {
|
|
9052
|
+
default: theme.tabBar.solid.revert.inactive.color.default,
|
|
9053
|
+
focused: theme.tabBar.solid.revert.inactive.color.focused,
|
|
9054
|
+
hovered: theme.tabBar.solid.revert.inactive.color.hovered,
|
|
9055
|
+
pressed: theme.tabBar.solid.revert.inactive.color.pressed
|
|
9056
|
+
},
|
|
9057
|
+
backgroundColor: {
|
|
9058
|
+
default: theme.tabBar.solid.revert.inactive.backgroundColor?.default,
|
|
9059
|
+
focused: theme.tabBar.solid.revert.inactive.backgroundColor?.focused,
|
|
9060
|
+
hovered: theme.tabBar.solid.revert.inactive.backgroundColor?.hovered,
|
|
9061
|
+
pressed: theme.tabBar.solid.revert.inactive.backgroundColor?.pressed
|
|
9062
|
+
}
|
|
9063
|
+
},
|
|
9064
|
+
disabled: {
|
|
9065
|
+
color: {
|
|
9066
|
+
default: theme.tabBar.solid.revert.disabled.color.default,
|
|
9067
|
+
focused: theme.tabBar.solid.revert.disabled.color.focused,
|
|
9068
|
+
hovered: theme.tabBar.solid.revert.disabled.color.hovered,
|
|
9069
|
+
pressed: theme.tabBar.solid.revert.disabled.color.pressed
|
|
9070
|
+
}
|
|
9071
|
+
}
|
|
9072
|
+
}
|
|
9073
|
+
}
|
|
8802
9074
|
}
|
|
8803
9075
|
},
|
|
8804
9076
|
app: appTheme?.colors
|
|
@@ -8875,6 +9147,44 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8875
9147
|
highlight: {
|
|
8876
9148
|
borderRadius: theme.highlight.borderRadius
|
|
8877
9149
|
},
|
|
9150
|
+
tabBar: {
|
|
9151
|
+
underline: {
|
|
9152
|
+
default: {
|
|
9153
|
+
active: {
|
|
9154
|
+
borderRadius: theme.tabBar.underline.default.active.borderRadius
|
|
9155
|
+
},
|
|
9156
|
+
inactive: {
|
|
9157
|
+
borderRadius: theme.tabBar.underline.default.inactive.borderRadius
|
|
9158
|
+
}
|
|
9159
|
+
},
|
|
9160
|
+
revert: {
|
|
9161
|
+
active: {
|
|
9162
|
+
borderRadius: theme.tabBar.underline.revert.active.borderRadius
|
|
9163
|
+
},
|
|
9164
|
+
inactive: {
|
|
9165
|
+
borderRadius: theme.tabBar.underline.revert.inactive.borderRadius
|
|
9166
|
+
}
|
|
9167
|
+
}
|
|
9168
|
+
},
|
|
9169
|
+
solid: {
|
|
9170
|
+
default: {
|
|
9171
|
+
active: {
|
|
9172
|
+
borderRadius: theme.tabBar.solid.default.active.borderRadius
|
|
9173
|
+
},
|
|
9174
|
+
inactive: {
|
|
9175
|
+
borderRadius: theme.tabBar.solid.default.inactive.borderRadius
|
|
9176
|
+
}
|
|
9177
|
+
},
|
|
9178
|
+
revert: {
|
|
9179
|
+
active: {
|
|
9180
|
+
borderRadius: theme.tabBar.solid.revert.active.borderRadius
|
|
9181
|
+
},
|
|
9182
|
+
inactive: {
|
|
9183
|
+
borderRadius: theme.tabBar.solid.revert.inactive.borderRadius
|
|
9184
|
+
}
|
|
9185
|
+
}
|
|
9186
|
+
}
|
|
9187
|
+
},
|
|
8878
9188
|
tag: {
|
|
8879
9189
|
borderRadius: theme.tag.borderRadius
|
|
8880
9190
|
},
|
|
@@ -10921,7 +11231,7 @@ function Picker({
|
|
|
10921
11231
|
paddingY: "kitt.2",
|
|
10922
11232
|
children: childrenArray.map((child, index) => {
|
|
10923
11233
|
const currentValue = items[index];
|
|
10924
|
-
if (
|
|
11234
|
+
if (currentValue === undefined) throw new Error(`Picker: No value found for item at index ${index}`);
|
|
10925
11235
|
const {
|
|
10926
11236
|
onClick,
|
|
10927
11237
|
'aria-selected': ariaSelected,
|
|
@@ -11618,123 +11928,129 @@ const StoryGrid = {
|
|
|
11618
11928
|
Col: StoryGridCol
|
|
11619
11929
|
};
|
|
11620
11930
|
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11632
|
-
|
|
11633
|
-
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
return isActive ? kittTheme.colors.primary : kittTheme.colors.blackLight;
|
|
11637
|
-
}
|
|
11638
|
-
}
|
|
11639
|
-
}
|
|
11640
|
-
function useTabBarIndicatorColor(color, isActive) {
|
|
11641
|
-
const {
|
|
11642
|
-
kitt: kittTheme
|
|
11643
|
-
} = useKittTheme();
|
|
11644
|
-
switch (color) {
|
|
11645
|
-
case 'black':
|
|
11646
|
-
{
|
|
11647
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
11648
|
-
}
|
|
11649
|
-
case 'white':
|
|
11650
|
-
{
|
|
11651
|
-
return isActive ? kittTheme.palettes.deepPurple.white : kittTheme.palettes.deepPurple.transparent;
|
|
11652
|
-
}
|
|
11653
|
-
default:
|
|
11654
|
-
{
|
|
11655
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
11656
|
-
}
|
|
11657
|
-
}
|
|
11658
|
-
}
|
|
11931
|
+
const getVariantFromColor = color => {
|
|
11932
|
+
if (color === 'white') return 'revert';
|
|
11933
|
+
return 'default';
|
|
11934
|
+
};
|
|
11935
|
+
const getTabBarItemActiveState = (isActive, disabled) => {
|
|
11936
|
+
if (disabled) return 'disabled';
|
|
11937
|
+
if (isActive) return 'active';
|
|
11938
|
+
return 'inactive';
|
|
11939
|
+
};
|
|
11940
|
+
const getTabBarItemState = (isHovered, isPressed, isFocused) => {
|
|
11941
|
+
if (isHovered) return 'hovered';
|
|
11942
|
+
if (isPressed) return 'pressed';
|
|
11943
|
+
if (isFocused) return 'focused';
|
|
11944
|
+
return 'default';
|
|
11945
|
+
};
|
|
11659
11946
|
function TabBarItem({
|
|
11660
11947
|
name,
|
|
11661
11948
|
icon,
|
|
11662
|
-
|
|
11949
|
+
variant = 'default',
|
|
11950
|
+
type = 'underline',
|
|
11951
|
+
color,
|
|
11663
11952
|
testID,
|
|
11953
|
+
disabled,
|
|
11664
11954
|
isActive = false,
|
|
11955
|
+
isFocusedInternal = false,
|
|
11956
|
+
isHoveredInternal = false,
|
|
11957
|
+
isPressedInternal = false,
|
|
11665
11958
|
onPress
|
|
11666
11959
|
}) {
|
|
11667
|
-
|
|
11668
|
-
const
|
|
11960
|
+
// Keep backward compatibility with color property
|
|
11961
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
11962
|
+
const activeState = getTabBarItemActiveState(isActive, disabled);
|
|
11963
|
+
const baseTheme = `kitt.tabBar.${type}.${definedVariant}.${activeState}`;
|
|
11669
11964
|
return /*#__PURE__*/jsx(Pressable, {
|
|
11965
|
+
disabled: disabled,
|
|
11670
11966
|
testID: testID,
|
|
11671
11967
|
onPress: onPress,
|
|
11672
|
-
children:
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
children:
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
,
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11968
|
+
children: ({
|
|
11969
|
+
isHovered,
|
|
11970
|
+
isPressed,
|
|
11971
|
+
isFocused
|
|
11972
|
+
}) => {
|
|
11973
|
+
const state = getTabBarItemState(isHovered || isHoveredInternal, isPressed || isPressedInternal, isFocused || isFocusedInternal);
|
|
11974
|
+
return /*#__PURE__*/jsxs(HStack, {
|
|
11975
|
+
alignItems: "center",
|
|
11976
|
+
position: "relative",
|
|
11977
|
+
paddingY: "kitt.2",
|
|
11978
|
+
paddingRight: "kitt.2",
|
|
11979
|
+
paddingLeft: icon ? undefined : 'kitt.2',
|
|
11980
|
+
backgroundColor: `${baseTheme}.backgroundColor.${state}`,
|
|
11981
|
+
borderRadius: `${baseTheme}.borderRadius`,
|
|
11982
|
+
children: [icon ? /*#__PURE__*/jsx(View, {
|
|
11983
|
+
marginRight: "kitt.2",
|
|
11984
|
+
children: /*#__PURE__*/jsx(TypographyIcon, {
|
|
11985
|
+
color: `${baseTheme}.color.${state}`,
|
|
11986
|
+
icon: icon
|
|
11987
|
+
})
|
|
11988
|
+
}) : null, /*#__PURE__*/jsx(Typography.Text, {
|
|
11989
|
+
base: "label-large",
|
|
11990
|
+
numberOfLines: 1,
|
|
11991
|
+
color: `${baseTheme}.color.${state}`,
|
|
11992
|
+
children: name
|
|
11993
|
+
}), type !== 'solid' ? /*#__PURE__*/jsx(View, {
|
|
11994
|
+
backgroundColor: `${baseTheme}.indicator.backgroundColor`,
|
|
11995
|
+
position: "absolute",
|
|
11996
|
+
bottom: -1 // in order to be over tab bar's border bottom
|
|
11997
|
+
,
|
|
11998
|
+
left: 0,
|
|
11999
|
+
right: 0,
|
|
12000
|
+
height: 2
|
|
12001
|
+
}) : null]
|
|
12002
|
+
});
|
|
12003
|
+
}
|
|
11697
12004
|
});
|
|
11698
12005
|
}
|
|
11699
12006
|
|
|
11700
12007
|
function TabBar({
|
|
11701
12008
|
tabs,
|
|
11702
|
-
|
|
12009
|
+
variant = 'default',
|
|
12010
|
+
type = 'underline',
|
|
11703
12011
|
align = 'left',
|
|
12012
|
+
color,
|
|
11704
12013
|
activeTabIndex = 0,
|
|
11705
12014
|
renderTabItem,
|
|
11706
|
-
onChangeTab
|
|
11707
|
-
...props
|
|
12015
|
+
onChangeTab
|
|
11708
12016
|
}) {
|
|
11709
12017
|
const sx = useSx();
|
|
11710
|
-
const {
|
|
11711
|
-
kitt: kittTheme
|
|
11712
|
-
} = useKittTheme();
|
|
11713
12018
|
const tabItems = tabs.map((tab, index) => renderTabItem({
|
|
11714
12019
|
tab,
|
|
11715
12020
|
index,
|
|
11716
12021
|
isActive: activeTabIndex === index
|
|
11717
12022
|
}));
|
|
11718
|
-
|
|
12023
|
+
let styles = {
|
|
11719
12024
|
justifyContent: align,
|
|
11720
12025
|
paddingRight: align === 'center' ? 'kitt.2' : 'kitt.12',
|
|
11721
|
-
minWidth: '100%'
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
12026
|
+
minWidth: '100%'
|
|
12027
|
+
};
|
|
12028
|
+
|
|
12029
|
+
// Keep backward compatibility with color property
|
|
12030
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
12031
|
+
if (type !== 'solid') {
|
|
12032
|
+
styles = {
|
|
12033
|
+
...styles,
|
|
12034
|
+
borderBottomWidth: 1,
|
|
12035
|
+
borderBottomColor: `kitt.tabBar.${type}.${definedVariant}.borderBottomColor`
|
|
12036
|
+
};
|
|
12037
|
+
}
|
|
12038
|
+
const scrollViewStyles = sx(styles);
|
|
12039
|
+
const space = type === 'solid' ? 'kitt.2' : 'kitt.4';
|
|
11725
12040
|
return /*#__PURE__*/jsx(ScrollView, {
|
|
11726
12041
|
horizontal: true,
|
|
11727
12042
|
showsHorizontalScrollIndicator: false,
|
|
11728
12043
|
contentContainerStyle: scrollViewStyles,
|
|
11729
12044
|
children: /*#__PURE__*/jsx(HStack, {
|
|
11730
|
-
space: align === 'center' ? 'kitt.16' :
|
|
11731
|
-
...props,
|
|
12045
|
+
space: align === 'center' ? 'kitt.16' : space,
|
|
11732
12046
|
children: Children.map(tabItems, (child, index) => {
|
|
11733
12047
|
const tab = tabs[index];
|
|
11734
12048
|
if (!tab) throw new Error(`TabBar: tab is undefined at index ${index}`);
|
|
11735
12049
|
return /*#__PURE__*/jsx(View, {
|
|
11736
12050
|
children: /*#__PURE__*/cloneElement(child, {
|
|
11737
12051
|
color,
|
|
12052
|
+
variant: definedVariant,
|
|
12053
|
+
type,
|
|
11738
12054
|
onPress: event => {
|
|
11739
12055
|
onChangeTab({
|
|
11740
12056
|
tab,
|