@ornikar/kitt-universal 27.5.1-canary.eac3fc19869888632e3a59913cf9f700a72b0dad.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 -4
- 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} +30 -32
- package/scripts/transformers/card-modal.js +0 -101
- package/scripts/transformers/fullscreen-modal.js +0 -101
- package/scripts/transformers/navigation-modal.js +0 -101
- /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
|
@@ -1893,43 +1893,8 @@ const highlight = {
|
|
|
1893
1893
|
}
|
|
1894
1894
|
};
|
|
1895
1895
|
|
|
1896
|
-
const getIconSizeFromFontSize = fontSize => {
|
|
1897
|
-
if (fontSize <= 14) return 16;
|
|
1898
|
-
if (fontSize <= 16) return 20;
|
|
1899
|
-
return 24;
|
|
1900
|
-
};
|
|
1901
|
-
const createTypographyIconSizeConfig = (baseAndSmallFontSize, mediumAndWideFontSize) => {
|
|
1902
|
-
const baseAndSmallIconSize = getIconSizeFromFontSize(baseAndSmallFontSize);
|
|
1903
|
-
const mediumAndWideIconSize = getIconSizeFromFontSize(mediumAndWideFontSize);
|
|
1904
|
-
return {
|
|
1905
|
-
baseAndSmall: {
|
|
1906
|
-
iconSize: baseAndSmallIconSize
|
|
1907
|
-
},
|
|
1908
|
-
mediumAndWide: {
|
|
1909
|
-
iconSize: mediumAndWideIconSize
|
|
1910
|
-
}
|
|
1911
|
-
};
|
|
1912
|
-
};
|
|
1913
1896
|
const icon = {
|
|
1914
|
-
defaultSize: 20
|
|
1915
|
-
// Note: this is based on typography updated sizes, not current https://github.com/ornikar/kitt/pull/2130
|
|
1916
|
-
typographySize: {
|
|
1917
|
-
// also known as xxlarge
|
|
1918
|
-
header1: createTypographyIconSizeConfig(40, 56),
|
|
1919
|
-
// also known as xlarge
|
|
1920
|
-
header2: createTypographyIconSizeConfig(32, 48),
|
|
1921
|
-
// also known as medium
|
|
1922
|
-
header3: createTypographyIconSizeConfig(24, 40),
|
|
1923
|
-
// also known as xsmall
|
|
1924
|
-
header4: createTypographyIconSizeConfig(18, 24),
|
|
1925
|
-
// also known as xxsmall
|
|
1926
|
-
header5: createTypographyIconSizeConfig(18, 18),
|
|
1927
|
-
'body-large': createTypographyIconSizeConfig(18, 24),
|
|
1928
|
-
'body-medium': createTypographyIconSizeConfig(18, 18),
|
|
1929
|
-
body: createTypographyIconSizeConfig(16, 16),
|
|
1930
|
-
'body-small': createTypographyIconSizeConfig(14, 14),
|
|
1931
|
-
'body-xsmall': createTypographyIconSizeConfig(12, 12)
|
|
1932
|
-
}
|
|
1897
|
+
defaultSize: 20
|
|
1933
1898
|
};
|
|
1934
1899
|
|
|
1935
1900
|
const iconButton = {
|
|
@@ -2356,6 +2321,183 @@ const skeleton$1 = {
|
|
|
2356
2321
|
}
|
|
2357
2322
|
};
|
|
2358
2323
|
|
|
2324
|
+
const tabBar = {
|
|
2325
|
+
underline: {
|
|
2326
|
+
default: {
|
|
2327
|
+
active: {
|
|
2328
|
+
color: {
|
|
2329
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2330
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2331
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2332
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2333
|
+
},
|
|
2334
|
+
indicator: {
|
|
2335
|
+
backgroundColor: deepPurpleColorPalette['deepPurple.8']
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
inactive: {
|
|
2339
|
+
color: {
|
|
2340
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2341
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2342
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2343
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2344
|
+
},
|
|
2345
|
+
indicator: {
|
|
2346
|
+
backgroundColor: undefined
|
|
2347
|
+
}
|
|
2348
|
+
},
|
|
2349
|
+
disabled: {
|
|
2350
|
+
color: {
|
|
2351
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2352
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2353
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2354
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2355
|
+
},
|
|
2356
|
+
indicator: {
|
|
2357
|
+
backgroundColor: undefined
|
|
2358
|
+
}
|
|
2359
|
+
},
|
|
2360
|
+
borderBottomColor: deepPurpleColorPalette['beige.3']
|
|
2361
|
+
},
|
|
2362
|
+
revert: {
|
|
2363
|
+
active: {
|
|
2364
|
+
color: {
|
|
2365
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2366
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2367
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2368
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2369
|
+
},
|
|
2370
|
+
indicator: {
|
|
2371
|
+
backgroundColor: deepPurpleColorPalette['grey.0']
|
|
2372
|
+
}
|
|
2373
|
+
},
|
|
2374
|
+
inactive: {
|
|
2375
|
+
color: {
|
|
2376
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2377
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2378
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2379
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2380
|
+
},
|
|
2381
|
+
indicator: {
|
|
2382
|
+
backgroundColor: undefined
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
disabled: {
|
|
2386
|
+
color: {
|
|
2387
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2388
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2389
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2390
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2391
|
+
},
|
|
2392
|
+
indicator: {
|
|
2393
|
+
backgroundColor: undefined
|
|
2394
|
+
}
|
|
2395
|
+
},
|
|
2396
|
+
borderBottomColor: deepPurpleColorPalette['white-alpha.20']
|
|
2397
|
+
}
|
|
2398
|
+
},
|
|
2399
|
+
solid: {
|
|
2400
|
+
default: {
|
|
2401
|
+
active: {
|
|
2402
|
+
color: {
|
|
2403
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2404
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2405
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2406
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2407
|
+
},
|
|
2408
|
+
backgroundColor: {
|
|
2409
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2410
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2411
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2412
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2413
|
+
},
|
|
2414
|
+
borderRadius: 4,
|
|
2415
|
+
indicator: {
|
|
2416
|
+
backgroundColor: undefined
|
|
2417
|
+
}
|
|
2418
|
+
},
|
|
2419
|
+
inactive: {
|
|
2420
|
+
color: {
|
|
2421
|
+
default: deepPurpleColorPalette['grey.5'],
|
|
2422
|
+
focused: deepPurpleColorPalette['grey.5'],
|
|
2423
|
+
hovered: deepPurpleColorPalette['grey.5'],
|
|
2424
|
+
pressed: deepPurpleColorPalette['grey.5']
|
|
2425
|
+
},
|
|
2426
|
+
backgroundColor: {
|
|
2427
|
+
default: undefined,
|
|
2428
|
+
focused: undefined,
|
|
2429
|
+
hovered: deepPurpleColorPalette['beige.1'],
|
|
2430
|
+
pressed: deepPurpleColorPalette['beige.1']
|
|
2431
|
+
},
|
|
2432
|
+
borderRadius: 4,
|
|
2433
|
+
indicator: {
|
|
2434
|
+
backgroundColor: undefined
|
|
2435
|
+
}
|
|
2436
|
+
},
|
|
2437
|
+
disabled: {
|
|
2438
|
+
color: {
|
|
2439
|
+
default: deepPurpleColorPalette['grey.3'],
|
|
2440
|
+
focused: deepPurpleColorPalette['grey.3'],
|
|
2441
|
+
hovered: deepPurpleColorPalette['grey.3'],
|
|
2442
|
+
pressed: deepPurpleColorPalette['grey.3']
|
|
2443
|
+
},
|
|
2444
|
+
indicator: {
|
|
2445
|
+
backgroundColor: undefined
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
revert: {
|
|
2450
|
+
active: {
|
|
2451
|
+
color: {
|
|
2452
|
+
default: deepPurpleColorPalette['deepPurple.8'],
|
|
2453
|
+
focused: deepPurpleColorPalette['deepPurple.8'],
|
|
2454
|
+
hovered: deepPurpleColorPalette['deepPurple.8'],
|
|
2455
|
+
pressed: deepPurpleColorPalette['deepPurple.8']
|
|
2456
|
+
},
|
|
2457
|
+
backgroundColor: {
|
|
2458
|
+
default: deepPurpleColorPalette['grey.0'],
|
|
2459
|
+
focused: deepPurpleColorPalette['grey.0'],
|
|
2460
|
+
hovered: deepPurpleColorPalette['grey.0'],
|
|
2461
|
+
pressed: deepPurpleColorPalette['grey.0']
|
|
2462
|
+
},
|
|
2463
|
+
borderRadius: 4,
|
|
2464
|
+
indicator: {
|
|
2465
|
+
backgroundColor: undefined
|
|
2466
|
+
}
|
|
2467
|
+
},
|
|
2468
|
+
inactive: {
|
|
2469
|
+
color: {
|
|
2470
|
+
default: deepPurpleColorPalette['white-alpha.80'],
|
|
2471
|
+
focused: deepPurpleColorPalette['white-alpha.80'],
|
|
2472
|
+
hovered: deepPurpleColorPalette['white-alpha.80'],
|
|
2473
|
+
pressed: deepPurpleColorPalette['white-alpha.80']
|
|
2474
|
+
},
|
|
2475
|
+
backgroundColor: {
|
|
2476
|
+
default: undefined,
|
|
2477
|
+
focused: undefined,
|
|
2478
|
+
hovered: deepPurpleColorPalette['white-alpha.10'],
|
|
2479
|
+
pressed: deepPurpleColorPalette['white-alpha.10']
|
|
2480
|
+
},
|
|
2481
|
+
borderRadius: 4,
|
|
2482
|
+
indicator: {
|
|
2483
|
+
backgroundColor: undefined
|
|
2484
|
+
}
|
|
2485
|
+
},
|
|
2486
|
+
disabled: {
|
|
2487
|
+
color: {
|
|
2488
|
+
default: deepPurpleColorPalette['white-alpha.20'],
|
|
2489
|
+
focused: deepPurpleColorPalette['white-alpha.20'],
|
|
2490
|
+
hovered: deepPurpleColorPalette['white-alpha.20'],
|
|
2491
|
+
pressed: deepPurpleColorPalette['white-alpha.20']
|
|
2492
|
+
},
|
|
2493
|
+
indicator: {
|
|
2494
|
+
backgroundColor: undefined
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
|
|
2359
2501
|
const tag = {
|
|
2360
2502
|
borderRadius: 16,
|
|
2361
2503
|
icon: {
|
|
@@ -2495,6 +2637,7 @@ const theme = {
|
|
|
2495
2637
|
picker,
|
|
2496
2638
|
shadows,
|
|
2497
2639
|
skeleton: skeleton$1,
|
|
2640
|
+
tabBar,
|
|
2498
2641
|
tag,
|
|
2499
2642
|
tooltip,
|
|
2500
2643
|
typography,
|
|
@@ -2918,6 +3061,13 @@ const getTypographyFamilyWithAncestorValue = (type, typographyFamilyInContext) =
|
|
|
2918
3061
|
if (typographyFamilyInContext != null) return typographyFamilyInContext;
|
|
2919
3062
|
throw new Error('You must set a "base" prop or wrap this Typography in one that does.');
|
|
2920
3063
|
};
|
|
3064
|
+
const getTypographyTypeWithAncestorValue = (type, typographyTypeInContext) => {
|
|
3065
|
+
// check if all values are not undefined
|
|
3066
|
+
const isAllValuesUndefined = Object.values(type).every(value => value === undefined);
|
|
3067
|
+
|
|
3068
|
+
// if every values are undefined and we hgave a typographyTypeInContext, we use the parent typography type (typographyTypeInContext)
|
|
3069
|
+
return !!isAllValuesUndefined && !!typographyTypeInContext ? typographyTypeInContext : type;
|
|
3070
|
+
};
|
|
2921
3071
|
|
|
2922
3072
|
const TypographyFamilyContext = /*#__PURE__*/react.createContext(null);
|
|
2923
3073
|
const TypographyTypeContext = /*#__PURE__*/react.createContext(null);
|
|
@@ -2925,9 +3075,6 @@ const TypographyColorContext = /*#__PURE__*/react.createContext('black');
|
|
|
2925
3075
|
function useTypographyColor() {
|
|
2926
3076
|
return react.useContext(TypographyColorContext);
|
|
2927
3077
|
}
|
|
2928
|
-
function useTypographyAncestorType() {
|
|
2929
|
-
return react.useContext(TypographyTypeContext);
|
|
2930
|
-
}
|
|
2931
3078
|
const TypographyDefaultColorContext = /*#__PURE__*/react.createContext(undefined);
|
|
2932
3079
|
function useTypographyDefaultColor() {
|
|
2933
3080
|
return react.useContext(TypographyDefaultColorContext);
|
|
@@ -3050,9 +3197,11 @@ function Typography({
|
|
|
3050
3197
|
}) {
|
|
3051
3198
|
const sx = nativeBase.useSx();
|
|
3052
3199
|
const typographyFamilyInContext = react.useContext(TypographyFamilyContext);
|
|
3200
|
+
const typographyTypeInContext = react.useContext(TypographyTypeContext);
|
|
3053
3201
|
const defaultColor = useTypographyDefaultColor();
|
|
3054
3202
|
const hasTypographyAncestor = typographyFamilyInContext !== null;
|
|
3055
|
-
const
|
|
3203
|
+
const typographyType = getTypographyTypeWithAncestorValue(type, typographyTypeInContext);
|
|
3204
|
+
const baseOrDefaultToBody = typographyType.base ?? 'body-m';
|
|
3056
3205
|
const typographyFamily = getTypographyFamilyWithAncestorValue(baseOrDefaultToBody, typographyFamilyInContext);
|
|
3057
3206
|
const fontSizeForNativeBase = createNativeBaseFontSize({
|
|
3058
3207
|
...type,
|
|
@@ -3091,7 +3240,7 @@ function Typography({
|
|
|
3091
3240
|
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(TypographyFamilyContext.Provider, {
|
|
3092
3241
|
value: typographyFamily,
|
|
3093
3242
|
children: /*#__PURE__*/jsxRuntime.jsx(TypographyTypeContext.Provider, {
|
|
3094
|
-
value:
|
|
3243
|
+
value: typographyType,
|
|
3095
3244
|
children: text
|
|
3096
3245
|
})
|
|
3097
3246
|
}) : text;
|
|
@@ -3192,30 +3341,11 @@ function Icon({
|
|
|
3192
3341
|
});
|
|
3193
3342
|
}
|
|
3194
3343
|
|
|
3195
|
-
function getIconSizeConfigKeyFromTypeName(breakpointName) {
|
|
3196
|
-
return breakpointName === KittBreakpointNameEnum.BASE || breakpointName === KittBreakpointNameEnum.SMALL ? 'baseAndSmall' : 'mediumAndWide';
|
|
3197
|
-
}
|
|
3198
|
-
function createNativeBaseIconSize(type) {
|
|
3199
|
-
const typeWithMediumForced = {
|
|
3200
|
-
...type,
|
|
3201
|
-
medium: type.medium || type.small || type.base
|
|
3202
|
-
};
|
|
3203
|
-
const iconSizeForNativeBase = {};
|
|
3204
|
-
[KittBreakpointNameEnum.BASE, KittBreakpointNameEnum.SMALL, KittBreakpointNameEnum.MEDIUM, KittBreakpointNameEnum.LARGE, KittBreakpointNameEnum.WIDE].forEach(typeName => {
|
|
3205
|
-
const value = typeWithMediumForced[typeName];
|
|
3206
|
-
if (value) {
|
|
3207
|
-
iconSizeForNativeBase[typeName] = `kitt.icon.typographySize.${value}.${getIconSizeConfigKeyFromTypeName(typeName)}.iconSize`;
|
|
3208
|
-
}
|
|
3209
|
-
});
|
|
3210
|
-
return iconSizeForNativeBase;
|
|
3211
|
-
}
|
|
3212
3344
|
function TypographyIconSpecifiedColor({
|
|
3213
3345
|
color,
|
|
3214
3346
|
size,
|
|
3215
3347
|
...props
|
|
3216
3348
|
}) {
|
|
3217
|
-
const ancestorType = useTypographyAncestorType();
|
|
3218
|
-
const iconSize = size || (ancestorType ? createNativeBaseIconSize(ancestorType) : undefined);
|
|
3219
3349
|
const colorValue = getTypographyColorValue(color);
|
|
3220
3350
|
const sx = nativeBase.useSx();
|
|
3221
3351
|
const {
|
|
@@ -3225,7 +3355,7 @@ function TypographyIconSpecifiedColor({
|
|
|
3225
3355
|
});
|
|
3226
3356
|
return /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
3227
3357
|
...props,
|
|
3228
|
-
size:
|
|
3358
|
+
size: size,
|
|
3229
3359
|
color: colorStyleValue
|
|
3230
3360
|
});
|
|
3231
3361
|
}
|
|
@@ -8806,6 +8936,148 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8806
8936
|
backgroundColor: theme.picker.web.optionsContainer.backgroundColor
|
|
8807
8937
|
}
|
|
8808
8938
|
}
|
|
8939
|
+
},
|
|
8940
|
+
tabBar: {
|
|
8941
|
+
underline: {
|
|
8942
|
+
default: {
|
|
8943
|
+
active: {
|
|
8944
|
+
color: {
|
|
8945
|
+
default: theme.tabBar.underline.default.active.color.default,
|
|
8946
|
+
focused: theme.tabBar.underline.default.active.color.focused,
|
|
8947
|
+
hovered: theme.tabBar.underline.default.active.color.hovered,
|
|
8948
|
+
pressed: theme.tabBar.underline.default.active.color.pressed
|
|
8949
|
+
},
|
|
8950
|
+
indicator: {
|
|
8951
|
+
backgroundColor: theme.tabBar.underline.default.active.indicator.backgroundColor
|
|
8952
|
+
}
|
|
8953
|
+
},
|
|
8954
|
+
inactive: {
|
|
8955
|
+
color: {
|
|
8956
|
+
default: theme.tabBar.underline.default.inactive.color.default,
|
|
8957
|
+
focused: theme.tabBar.underline.default.inactive.color.focused,
|
|
8958
|
+
hovered: theme.tabBar.underline.default.inactive.color.hovered,
|
|
8959
|
+
pressed: theme.tabBar.underline.default.inactive.color.pressed
|
|
8960
|
+
}
|
|
8961
|
+
},
|
|
8962
|
+
disabled: {
|
|
8963
|
+
color: {
|
|
8964
|
+
default: theme.tabBar.underline.default.disabled.color.default,
|
|
8965
|
+
focused: theme.tabBar.underline.default.disabled.color.focused,
|
|
8966
|
+
hovered: theme.tabBar.underline.default.disabled.color.hovered,
|
|
8967
|
+
pressed: theme.tabBar.underline.default.disabled.color.pressed
|
|
8968
|
+
}
|
|
8969
|
+
},
|
|
8970
|
+
borderBottomColor: theme.tabBar.underline.default.borderBottomColor
|
|
8971
|
+
},
|
|
8972
|
+
revert: {
|
|
8973
|
+
active: {
|
|
8974
|
+
color: {
|
|
8975
|
+
default: theme.tabBar.underline.revert.active.color.default,
|
|
8976
|
+
focused: theme.tabBar.underline.revert.active.color.focused,
|
|
8977
|
+
hovered: theme.tabBar.underline.revert.active.color.hovered,
|
|
8978
|
+
pressed: theme.tabBar.underline.revert.active.color.pressed
|
|
8979
|
+
},
|
|
8980
|
+
indicator: {
|
|
8981
|
+
backgroundColor: theme.tabBar.underline.revert.active.indicator.backgroundColor
|
|
8982
|
+
}
|
|
8983
|
+
},
|
|
8984
|
+
inactive: {
|
|
8985
|
+
color: {
|
|
8986
|
+
default: theme.tabBar.underline.revert.inactive.color.default,
|
|
8987
|
+
focused: theme.tabBar.underline.revert.inactive.color.focused,
|
|
8988
|
+
hovered: theme.tabBar.underline.revert.inactive.color.hovered,
|
|
8989
|
+
pressed: theme.tabBar.underline.revert.inactive.color.pressed
|
|
8990
|
+
}
|
|
8991
|
+
},
|
|
8992
|
+
disabled: {
|
|
8993
|
+
color: {
|
|
8994
|
+
default: theme.tabBar.underline.revert.disabled.color.default,
|
|
8995
|
+
focused: theme.tabBar.underline.revert.disabled.color.focused,
|
|
8996
|
+
hovered: theme.tabBar.underline.revert.disabled.color.hovered,
|
|
8997
|
+
pressed: theme.tabBar.underline.revert.disabled.color.pressed
|
|
8998
|
+
}
|
|
8999
|
+
},
|
|
9000
|
+
borderBottomColor: theme.tabBar.underline.revert.borderBottomColor
|
|
9001
|
+
}
|
|
9002
|
+
},
|
|
9003
|
+
solid: {
|
|
9004
|
+
default: {
|
|
9005
|
+
active: {
|
|
9006
|
+
color: {
|
|
9007
|
+
default: theme.tabBar.solid.default.active.color.default,
|
|
9008
|
+
focused: theme.tabBar.solid.default.active.color.focused,
|
|
9009
|
+
hovered: theme.tabBar.solid.default.active.color.hovered,
|
|
9010
|
+
pressed: theme.tabBar.solid.default.active.color.pressed
|
|
9011
|
+
},
|
|
9012
|
+
backgroundColor: {
|
|
9013
|
+
default: theme.tabBar.solid.default.active.backgroundColor?.default,
|
|
9014
|
+
focused: theme.tabBar.solid.default.active.backgroundColor?.focused,
|
|
9015
|
+
hovered: theme.tabBar.solid.default.active.backgroundColor?.hovered,
|
|
9016
|
+
pressed: theme.tabBar.solid.default.active.backgroundColor?.pressed
|
|
9017
|
+
}
|
|
9018
|
+
},
|
|
9019
|
+
inactive: {
|
|
9020
|
+
color: {
|
|
9021
|
+
default: theme.tabBar.solid.default.inactive.color.default,
|
|
9022
|
+
focused: theme.tabBar.solid.default.inactive.color.focused,
|
|
9023
|
+
hovered: theme.tabBar.solid.default.inactive.color.hovered,
|
|
9024
|
+
pressed: theme.tabBar.solid.default.inactive.color.pressed
|
|
9025
|
+
},
|
|
9026
|
+
backgroundColor: {
|
|
9027
|
+
default: theme.tabBar.solid.default.inactive.backgroundColor?.default,
|
|
9028
|
+
focused: theme.tabBar.solid.default.inactive.backgroundColor?.focused,
|
|
9029
|
+
hovered: theme.tabBar.solid.default.inactive.backgroundColor?.hovered,
|
|
9030
|
+
pressed: theme.tabBar.solid.default.inactive.backgroundColor?.pressed
|
|
9031
|
+
}
|
|
9032
|
+
},
|
|
9033
|
+
disabled: {
|
|
9034
|
+
color: {
|
|
9035
|
+
default: theme.tabBar.solid.default.disabled.color.default,
|
|
9036
|
+
focused: theme.tabBar.solid.default.disabled.color.focused,
|
|
9037
|
+
hovered: theme.tabBar.solid.default.disabled.color.hovered,
|
|
9038
|
+
pressed: theme.tabBar.solid.default.disabled.color.pressed
|
|
9039
|
+
}
|
|
9040
|
+
}
|
|
9041
|
+
},
|
|
9042
|
+
revert: {
|
|
9043
|
+
active: {
|
|
9044
|
+
color: {
|
|
9045
|
+
default: theme.tabBar.solid.revert.active.color.default,
|
|
9046
|
+
focused: theme.tabBar.solid.revert.active.color.focused,
|
|
9047
|
+
hovered: theme.tabBar.solid.revert.active.color.hovered,
|
|
9048
|
+
pressed: theme.tabBar.solid.revert.active.color.pressed
|
|
9049
|
+
},
|
|
9050
|
+
backgroundColor: {
|
|
9051
|
+
default: theme.tabBar.solid.revert.active.backgroundColor?.default,
|
|
9052
|
+
focused: theme.tabBar.solid.revert.active.backgroundColor?.focused,
|
|
9053
|
+
hovered: theme.tabBar.solid.revert.active.backgroundColor?.hovered,
|
|
9054
|
+
pressed: theme.tabBar.solid.revert.active.backgroundColor?.pressed
|
|
9055
|
+
}
|
|
9056
|
+
},
|
|
9057
|
+
inactive: {
|
|
9058
|
+
color: {
|
|
9059
|
+
default: theme.tabBar.solid.revert.inactive.color.default,
|
|
9060
|
+
focused: theme.tabBar.solid.revert.inactive.color.focused,
|
|
9061
|
+
hovered: theme.tabBar.solid.revert.inactive.color.hovered,
|
|
9062
|
+
pressed: theme.tabBar.solid.revert.inactive.color.pressed
|
|
9063
|
+
},
|
|
9064
|
+
backgroundColor: {
|
|
9065
|
+
default: theme.tabBar.solid.revert.inactive.backgroundColor?.default,
|
|
9066
|
+
focused: theme.tabBar.solid.revert.inactive.backgroundColor?.focused,
|
|
9067
|
+
hovered: theme.tabBar.solid.revert.inactive.backgroundColor?.hovered,
|
|
9068
|
+
pressed: theme.tabBar.solid.revert.inactive.backgroundColor?.pressed
|
|
9069
|
+
}
|
|
9070
|
+
},
|
|
9071
|
+
disabled: {
|
|
9072
|
+
color: {
|
|
9073
|
+
default: theme.tabBar.solid.revert.disabled.color.default,
|
|
9074
|
+
focused: theme.tabBar.solid.revert.disabled.color.focused,
|
|
9075
|
+
hovered: theme.tabBar.solid.revert.disabled.color.hovered,
|
|
9076
|
+
pressed: theme.tabBar.solid.revert.disabled.color.pressed
|
|
9077
|
+
}
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
}
|
|
8809
9081
|
}
|
|
8810
9082
|
},
|
|
8811
9083
|
app: appTheme?.colors
|
|
@@ -8882,6 +9154,44 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
8882
9154
|
highlight: {
|
|
8883
9155
|
borderRadius: theme.highlight.borderRadius
|
|
8884
9156
|
},
|
|
9157
|
+
tabBar: {
|
|
9158
|
+
underline: {
|
|
9159
|
+
default: {
|
|
9160
|
+
active: {
|
|
9161
|
+
borderRadius: theme.tabBar.underline.default.active.borderRadius
|
|
9162
|
+
},
|
|
9163
|
+
inactive: {
|
|
9164
|
+
borderRadius: theme.tabBar.underline.default.inactive.borderRadius
|
|
9165
|
+
}
|
|
9166
|
+
},
|
|
9167
|
+
revert: {
|
|
9168
|
+
active: {
|
|
9169
|
+
borderRadius: theme.tabBar.underline.revert.active.borderRadius
|
|
9170
|
+
},
|
|
9171
|
+
inactive: {
|
|
9172
|
+
borderRadius: theme.tabBar.underline.revert.inactive.borderRadius
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
},
|
|
9176
|
+
solid: {
|
|
9177
|
+
default: {
|
|
9178
|
+
active: {
|
|
9179
|
+
borderRadius: theme.tabBar.solid.default.active.borderRadius
|
|
9180
|
+
},
|
|
9181
|
+
inactive: {
|
|
9182
|
+
borderRadius: theme.tabBar.solid.default.inactive.borderRadius
|
|
9183
|
+
}
|
|
9184
|
+
},
|
|
9185
|
+
revert: {
|
|
9186
|
+
active: {
|
|
9187
|
+
borderRadius: theme.tabBar.solid.revert.active.borderRadius
|
|
9188
|
+
},
|
|
9189
|
+
inactive: {
|
|
9190
|
+
borderRadius: theme.tabBar.solid.revert.inactive.borderRadius
|
|
9191
|
+
}
|
|
9192
|
+
}
|
|
9193
|
+
}
|
|
9194
|
+
},
|
|
8885
9195
|
tag: {
|
|
8886
9196
|
borderRadius: theme.tag.borderRadius
|
|
8887
9197
|
},
|
|
@@ -10928,7 +11238,7 @@ function Picker({
|
|
|
10928
11238
|
paddingY: "kitt.2",
|
|
10929
11239
|
children: childrenArray.map((child, index) => {
|
|
10930
11240
|
const currentValue = items[index];
|
|
10931
|
-
if (
|
|
11241
|
+
if (currentValue === undefined) throw new Error(`Picker: No value found for item at index ${index}`);
|
|
10932
11242
|
const {
|
|
10933
11243
|
onClick,
|
|
10934
11244
|
'aria-selected': ariaSelected,
|
|
@@ -11625,123 +11935,129 @@ const StoryGrid = {
|
|
|
11625
11935
|
Col: StoryGridCol
|
|
11626
11936
|
};
|
|
11627
11937
|
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11632
|
-
|
|
11633
|
-
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
return isActive ? kittTheme.colors.primary : kittTheme.colors.blackLight;
|
|
11644
|
-
}
|
|
11645
|
-
}
|
|
11646
|
-
}
|
|
11647
|
-
function useTabBarIndicatorColor(color, isActive) {
|
|
11648
|
-
const {
|
|
11649
|
-
kitt: kittTheme
|
|
11650
|
-
} = useKittTheme();
|
|
11651
|
-
switch (color) {
|
|
11652
|
-
case 'black':
|
|
11653
|
-
{
|
|
11654
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
11655
|
-
}
|
|
11656
|
-
case 'white':
|
|
11657
|
-
{
|
|
11658
|
-
return isActive ? kittTheme.palettes.deepPurple.white : kittTheme.palettes.deepPurple.transparent;
|
|
11659
|
-
}
|
|
11660
|
-
default:
|
|
11661
|
-
{
|
|
11662
|
-
return isActive ? kittTheme.colors.primary : kittTheme.palettes.deepPurple.transparent;
|
|
11663
|
-
}
|
|
11664
|
-
}
|
|
11665
|
-
}
|
|
11938
|
+
const getVariantFromColor = color => {
|
|
11939
|
+
if (color === 'white') return 'revert';
|
|
11940
|
+
return 'default';
|
|
11941
|
+
};
|
|
11942
|
+
const getTabBarItemActiveState = (isActive, disabled) => {
|
|
11943
|
+
if (disabled) return 'disabled';
|
|
11944
|
+
if (isActive) return 'active';
|
|
11945
|
+
return 'inactive';
|
|
11946
|
+
};
|
|
11947
|
+
const getTabBarItemState = (isHovered, isPressed, isFocused) => {
|
|
11948
|
+
if (isHovered) return 'hovered';
|
|
11949
|
+
if (isPressed) return 'pressed';
|
|
11950
|
+
if (isFocused) return 'focused';
|
|
11951
|
+
return 'default';
|
|
11952
|
+
};
|
|
11666
11953
|
function TabBarItem({
|
|
11667
11954
|
name,
|
|
11668
11955
|
icon,
|
|
11669
|
-
|
|
11956
|
+
variant = 'default',
|
|
11957
|
+
type = 'underline',
|
|
11958
|
+
color,
|
|
11670
11959
|
testID,
|
|
11960
|
+
disabled,
|
|
11671
11961
|
isActive = false,
|
|
11962
|
+
isFocusedInternal = false,
|
|
11963
|
+
isHoveredInternal = false,
|
|
11964
|
+
isPressedInternal = false,
|
|
11672
11965
|
onPress
|
|
11673
11966
|
}) {
|
|
11674
|
-
|
|
11675
|
-
const
|
|
11967
|
+
// Keep backward compatibility with color property
|
|
11968
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
11969
|
+
const activeState = getTabBarItemActiveState(isActive, disabled);
|
|
11970
|
+
const baseTheme = `kitt.tabBar.${type}.${definedVariant}.${activeState}`;
|
|
11676
11971
|
return /*#__PURE__*/jsxRuntime.jsx(Pressable, {
|
|
11972
|
+
disabled: disabled,
|
|
11677
11973
|
testID: testID,
|
|
11678
11974
|
onPress: onPress,
|
|
11679
|
-
children:
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
children:
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
,
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11975
|
+
children: ({
|
|
11976
|
+
isHovered,
|
|
11977
|
+
isPressed,
|
|
11978
|
+
isFocused
|
|
11979
|
+
}) => {
|
|
11980
|
+
const state = getTabBarItemState(isHovered || isHoveredInternal, isPressed || isPressedInternal, isFocused || isFocusedInternal);
|
|
11981
|
+
return /*#__PURE__*/jsxRuntime.jsxs(HStack, {
|
|
11982
|
+
alignItems: "center",
|
|
11983
|
+
position: "relative",
|
|
11984
|
+
paddingY: "kitt.2",
|
|
11985
|
+
paddingRight: "kitt.2",
|
|
11986
|
+
paddingLeft: icon ? undefined : 'kitt.2',
|
|
11987
|
+
backgroundColor: `${baseTheme}.backgroundColor.${state}`,
|
|
11988
|
+
borderRadius: `${baseTheme}.borderRadius`,
|
|
11989
|
+
children: [icon ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
11990
|
+
marginRight: "kitt.2",
|
|
11991
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
|
|
11992
|
+
color: `${baseTheme}.color.${state}`,
|
|
11993
|
+
icon: icon
|
|
11994
|
+
})
|
|
11995
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
|
|
11996
|
+
base: "label-large",
|
|
11997
|
+
numberOfLines: 1,
|
|
11998
|
+
color: `${baseTheme}.color.${state}`,
|
|
11999
|
+
children: name
|
|
12000
|
+
}), type !== 'solid' ? /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
12001
|
+
backgroundColor: `${baseTheme}.indicator.backgroundColor`,
|
|
12002
|
+
position: "absolute",
|
|
12003
|
+
bottom: -1 // in order to be over tab bar's border bottom
|
|
12004
|
+
,
|
|
12005
|
+
left: 0,
|
|
12006
|
+
right: 0,
|
|
12007
|
+
height: 2
|
|
12008
|
+
}) : null]
|
|
12009
|
+
});
|
|
12010
|
+
}
|
|
11704
12011
|
});
|
|
11705
12012
|
}
|
|
11706
12013
|
|
|
11707
12014
|
function TabBar({
|
|
11708
12015
|
tabs,
|
|
11709
|
-
|
|
12016
|
+
variant = 'default',
|
|
12017
|
+
type = 'underline',
|
|
11710
12018
|
align = 'left',
|
|
12019
|
+
color,
|
|
11711
12020
|
activeTabIndex = 0,
|
|
11712
12021
|
renderTabItem,
|
|
11713
|
-
onChangeTab
|
|
11714
|
-
...props
|
|
12022
|
+
onChangeTab
|
|
11715
12023
|
}) {
|
|
11716
12024
|
const sx = nativeBase.useSx();
|
|
11717
|
-
const {
|
|
11718
|
-
kitt: kittTheme
|
|
11719
|
-
} = useKittTheme();
|
|
11720
12025
|
const tabItems = tabs.map((tab, index) => renderTabItem({
|
|
11721
12026
|
tab,
|
|
11722
12027
|
index,
|
|
11723
12028
|
isActive: activeTabIndex === index
|
|
11724
12029
|
}));
|
|
11725
|
-
|
|
12030
|
+
let styles = {
|
|
11726
12031
|
justifyContent: align,
|
|
11727
12032
|
paddingRight: align === 'center' ? 'kitt.2' : 'kitt.12',
|
|
11728
|
-
minWidth: '100%'
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
12033
|
+
minWidth: '100%'
|
|
12034
|
+
};
|
|
12035
|
+
|
|
12036
|
+
// Keep backward compatibility with color property
|
|
12037
|
+
const definedVariant = color ? getVariantFromColor(color) : variant;
|
|
12038
|
+
if (type !== 'solid') {
|
|
12039
|
+
styles = {
|
|
12040
|
+
...styles,
|
|
12041
|
+
borderBottomWidth: 1,
|
|
12042
|
+
borderBottomColor: `kitt.tabBar.${type}.${definedVariant}.borderBottomColor`
|
|
12043
|
+
};
|
|
12044
|
+
}
|
|
12045
|
+
const scrollViewStyles = sx(styles);
|
|
12046
|
+
const space = type === 'solid' ? 'kitt.2' : 'kitt.4';
|
|
11732
12047
|
return /*#__PURE__*/jsxRuntime.jsx(ScrollView, {
|
|
11733
12048
|
horizontal: true,
|
|
11734
12049
|
showsHorizontalScrollIndicator: false,
|
|
11735
12050
|
contentContainerStyle: scrollViewStyles,
|
|
11736
12051
|
children: /*#__PURE__*/jsxRuntime.jsx(HStack, {
|
|
11737
|
-
space: align === 'center' ? 'kitt.16' :
|
|
11738
|
-
...props,
|
|
12052
|
+
space: align === 'center' ? 'kitt.16' : space,
|
|
11739
12053
|
children: react.Children.map(tabItems, (child, index) => {
|
|
11740
12054
|
const tab = tabs[index];
|
|
11741
12055
|
if (!tab) throw new Error(`TabBar: tab is undefined at index ${index}`);
|
|
11742
12056
|
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
11743
12057
|
children: /*#__PURE__*/react.cloneElement(child, {
|
|
11744
12058
|
color,
|
|
12059
|
+
variant: definedVariant,
|
|
12060
|
+
type,
|
|
11745
12061
|
onPress: event => {
|
|
11746
12062
|
onChangeTab({
|
|
11747
12063
|
tab,
|