@proximus/lavender-styling-native 0.1.0-alpha.3 → 0.1.0-beta.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.
@@ -0,0 +1,6 @@
1
+ import * as proximusTokens from '@proximus/lavender-styling/dist/js/proximus/themesTokens.js';
2
+ import { ThemeName } from './themes';
3
+ export const myProximusTheme = {
4
+ name: ThemeName.MYPROXIMUS,
5
+ t: (key) => proximusTokens[key],
6
+ };
@@ -0,0 +1,6 @@
1
+ import * as scarletTokens from '@proximus/lavender-styling/dist/js/scarlet/themesTokens.js';
2
+ import { ThemeName } from './themes';
3
+ export const scarletTheme = {
4
+ name: ThemeName.SCARLET,
5
+ t: (key) => scarletTokens[key],
6
+ };
@@ -0,0 +1,9 @@
1
+ import React, { useContext } from 'react';
2
+ import { myProximusTheme } from './ProximusTheme';
3
+ export const ThemeContext = React.createContext({
4
+ theme: myProximusTheme,
5
+ });
6
+ export function useTheme() {
7
+ const theme = useContext(ThemeContext);
8
+ return theme || {};
9
+ }
@@ -0,0 +1,15 @@
1
+ import React, { useState } from 'react';
2
+ import { ThemeContext, useTheme } from './ThemeContext';
3
+ export function ThemeProvider({ theme, children, }) {
4
+ const [themeValue, setTheme] = useState(theme);
5
+ return (React.createElement(ThemeContext.Provider, { value: {
6
+ theme: themeValue,
7
+ setTheme,
8
+ } }, children));
9
+ }
10
+ export function withTheme(WrappedComponent) {
11
+ return (props) => {
12
+ const { theme, setTheme } = useTheme();
13
+ return (React.createElement(WrappedComponent, { ...props, theme: theme, onThemeChanged: setTheme }));
14
+ };
15
+ }
package/dist/themes.js ADDED
@@ -0,0 +1,5 @@
1
+ export var ThemeName;
2
+ (function (ThemeName) {
3
+ ThemeName["MYPROXIMUS"] = "myproximus";
4
+ ThemeName["SCARLET"] = "scarlet";
5
+ })(ThemeName || (ThemeName = {}));
package/package.json CHANGED
@@ -1,27 +1,16 @@
1
1
  {
2
2
  "name": "@proximus/lavender-styling-native",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-beta.0",
4
4
  "description": "Commmon styling constants",
5
- "main": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist"
8
+ ],
6
9
  "type": "module",
7
10
  "publishConfig": {
8
11
  "access": "public"
9
12
  },
10
- "scripts": {
11
- "clean": "rm -rf dist",
12
- "build": "npx tsc -p tsconfig.json",
13
- "prepublish": "yarn clean && yarn build"
14
- },
15
- "lerna": {
16
- "command": {
17
- "publish": {
18
- "assets": [
19
- "dist",
20
- "src",
21
- "package.json"
22
- ]
23
- }
24
- }
25
- },
26
- "gitHead": "6e9252a716a08ededdfbfd6f5b1db70ab21e026e"
13
+ "peerDependencies": {
14
+ "@proximus/lavender-styling": "*"
15
+ }
27
16
  }
package/CHANGELOG.md DELETED
@@ -1,31 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [0.1.0-alpha.3](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-styling-native@0.1.0-alpha.2...@proximus/lavender-styling-native@0.1.0-alpha.3) (2025-09-19)
7
-
8
- ### Features
9
-
10
- - **BCRI-4249550:** message card + tag components ([#22](https://github.com/Pxs-Corporate/react-native-lavender/issues/22)) ([39fb91c](https://github.com/Pxs-Corporate/react-native-lavender/commit/39fb91cc294a37d07e63fca2b4e993d90b867082))
11
-
12
- # [0.1.0-alpha.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-styling-native@0.1.0-alpha.1...@proximus/lavender-styling-native@0.1.0-alpha.2) (2025-09-05)
13
-
14
- ### Features
15
-
16
- - **BCRI-4279213:** update token architecture and component styles ([#18](https://github.com/Pxs-Corporate/react-native-lavender/issues/18)) ([2fabf41](https://github.com/Pxs-Corporate/react-native-lavender/commit/2fabf416ce069e9756daa868c3012181db87e7f5))
17
-
18
- # [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-styling-native@0.1.0-alpha.0...@proximus/lavender-styling-native@0.1.0-alpha.1) (2025-08-13)
19
-
20
- ### Bug Fixes
21
-
22
- - **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
23
-
24
- # 0.1.0-alpha.0 (2025-08-13)
25
-
26
- ### Features
27
-
28
- - **BCRI-3651606:** mono repo creation ([d19f852](https://github.com/Pxs-Corporate/react-native-lavender/commit/d19f852a710963ff85b1a9d31d18188217aa23ab))
29
- - **BCRI-3702949:** tertiary button ([db24455](https://github.com/Pxs-Corporate/react-native-lavender/commit/db24455bd9687d80920be3e42c9e1fc14703a571))
30
- - **BCRI-3810979:** tile components ([46fc5c7](https://github.com/Pxs-Corporate/react-native-lavender/commit/46fc5c7a0ddff6c2db43fba0de9929626092f265))
31
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
@@ -1,7 +0,0 @@
1
- import * as proximusTokens from '@proximus/lavender-styling/dist/js/proximus/themesTokens.js';
2
- import { type ITheme, ThemeName } from './themes';
3
-
4
- export const myProximusTheme: ITheme = {
5
- name: ThemeName.MYPROXIMUS,
6
- t: (key) => proximusTokens[key],
7
- };
@@ -1,7 +0,0 @@
1
- import * as scarletTokens from '@proximus/lavender-styling/dist/js/scarlet/themesTokens.js';
2
- import { ITheme, ThemeName } from './themes';
3
-
4
- export const scarletTheme: ITheme = {
5
- name: ThemeName.SCARLET,
6
- t: (key) => scarletTokens[key],
7
- };
@@ -1,13 +0,0 @@
1
- import React, { useContext } from 'react';
2
-
3
- import { type IThemeContext } from './themes';
4
- import { myProximusTheme } from './ProximusTheme';
5
-
6
- export const ThemeContext = React.createContext<IThemeContext>({
7
- theme: myProximusTheme,
8
- });
9
-
10
- export function useTheme() {
11
- const theme = useContext(ThemeContext);
12
- return theme || {};
13
- }
@@ -1,34 +0,0 @@
1
- import React, { ComponentType, ReactNode, useState } from 'react';
2
-
3
- import { ThemeContext, useTheme } from './ThemeContext';
4
- import { ITheme } from './themes';
5
-
6
- export function ThemeProvider({
7
- theme,
8
- children,
9
- }: {
10
- theme: ITheme;
11
- children: ReactNode;
12
- }) {
13
- const [themeValue, setTheme] = useState<ITheme>(theme);
14
-
15
- return (
16
- <ThemeContext.Provider
17
- value={{
18
- theme: themeValue,
19
- setTheme,
20
- }}
21
- >
22
- {children}
23
- </ThemeContext.Provider>
24
- );
25
- }
26
-
27
- export function withTheme<T>(WrappedComponent: ComponentType<T>) {
28
- return (props: T) => {
29
- const { theme, setTheme } = useTheme();
30
- return (
31
- <WrappedComponent {...props} theme={theme} onThemeChanged={setTheme} />
32
- );
33
- };
34
- }
package/src/themes.ts DELETED
@@ -1,37 +0,0 @@
1
- import * as proximusTokens from '@proximus/lavender-styling/dist/js/proximus/themesTokens.js';
2
- import * as scarletTokens from '@proximus/lavender-styling/dist/js/scarlet/themesTokens.js';
3
-
4
- export enum ThemeName {
5
- MYPROXIMUS = 'myproximus',
6
- SCARLET = 'scarlet',
7
- }
8
-
9
- type TokenValuesTypes =
10
- | string
11
- | { color: string; position: number }[]
12
- | number
13
- | {
14
- original: string | number;
15
- number: number;
16
- decimal: number;
17
- scale: number;
18
- };
19
-
20
- export interface IAbstractTheme<
21
- TOKENS extends Record<string, TokenValuesTypes> = Record<
22
- string,
23
- TokenValuesTypes
24
- >,
25
- > {
26
- name: ThemeName;
27
-
28
- t<K extends keyof TOKENS>(key: K): TOKENS[K];
29
- }
30
-
31
- export interface ITheme
32
- extends IAbstractTheme<typeof proximusTokens | typeof scarletTokens> {}
33
-
34
- export interface IThemeContext {
35
- theme: ITheme;
36
- setTheme?: (theme: ITheme) => void;
37
- }
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.npm.json",
3
- "compilerOptions": {
4
- "outDir": "dist"
5
- },
6
- "include": ["src","../../lib.d.ts"],
7
- "exclude": ["dist", "node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"]
8
- }
File without changes