2.1.2 • Published 9 months ago

@ode-react-ui/core v2.1.2

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
9 months ago

Edifice React Core

npm bundlephobia

Getting Started

This library exports OdeClientProvider which is a React context provider to access ode-ts-client through an application.

It defines session, conf, user, theme to code an application.

You can have access to all these elements:

appCode: Current app name applications: List of user's applications configurationFramework: a re-export of ode-ts-client configurationFramework currentApp: Current app object (displayName, prefix, url, ...) currentLanguage: Current language used by the user http: http method re-export from ode-ts-client i18n: Method to translate i18n keys init: If an app is ready or still loading session: A re-export of ode-ts-client sessionFramework.session theme: Current theme used with some utilities (basePath, bootstrapPath, skinName, ...) user: User info userDescription: User description userProfile: User profile type

Some of them can be accessed directly with their custom hook:

useI18n useTheme useUser

Dev

Build

pnpm run build

Lint

pnpm run lint

If pnpm run lint shows issues, run this command to fix them.

pnpm run fix

Prettier

pnpm run format

Structure

Component

  • Folder name always in PascalCase: Button
  • Component file in PascalCase: Button.tsx
  • Export types & interfaces inside Component file
  • Stories file in PascalCase + *.stories.tsx : Button.stories.tsx
src
  -- <Component>Folder
    -- <Component>.tsx
    -- <Component>.stories.tsx
    -- index.ts
  • Re-export the Component inside his own index file: index.ts
  • Export everything if Component has types & interfaces
export { default as Component } from "./Component";
export * from "./Component";

Hook

  • Folder name starts with use and written in camelCase: useSession
  • Component file in camelCase: useSession.ts
  • Export types & interfaces inside Hook file
  • Stories file in PascalCase + *.stories.tsx : useSession.stories.tsx
src
  -- use<Hook>
    -- use<Hook>.tsx
    -- use<Hook>.stories.tsx
    -- index.ts
  • Re-export the Hook inside his own index file: index.ts
  • Export everything if Hook has types & interfaces
export { default as useSession } from "./useSession";
export * from "./useSession";

Guideline

  • Always document basic guideline of Component with JSDoc format. Used by Storybook to generate documentation.
/**
 * Primary UI component for user interaction
 */

Interface description

  • Always document typescript types and interface with JSDoc syntax. Used by Storybook to generate documentation.
// Interface description (e.g: TreeViewProps.tsx)
export interface ButtonProps {
  /**
   * Is this the principal call to action on the page?
   */
  primary?: boolean;
  /**
   * What background color to use
   */
  backgroundColor?: string;
  /**
   * How large should the button be?
   */
  size?: "small" | "medium" | "large";
  /**
   * Button contents
   */
  label: string;
  /**
   * Optional click handler
   */
  onClick?: () => void;
}

Index file inside src folder

  • Entry point of this React Library.
  • Import your component inside index.ts file.
export * from "./Button";

Dev

You can build your component using Storybook. See README

2.1.1-dev.5

10 months ago

2.1.1-dev.4

10 months ago

2.1.1-dev.2

10 months ago

2.1.1-dev.1

10 months ago

2.1.1-dev.0

11 months ago

2.1.1-dev.6

10 months ago

2.1.2

9 months ago

2.1.1

10 months ago

2.1.0-dev.15

11 months ago

2.1.0-dev.14

11 months ago

2.1.0-dev.13

11 months ago

2.1.0

11 months ago

2.0.0-dev.10

12 months ago

1.0.7

1 year ago

2.1.0-dev.12

11 months ago

2.1.0-dev.11

11 months ago

2.1.0-dev.10

11 months ago

2.0.0-dev.12

12 months ago

2.0.0-dev.11

12 months ago

2.0.0

12 months ago

2.1.0-dev.7

11 months ago

2.1.0-dev.9

11 months ago

2.1.0-dev.3

12 months ago

2.0.1-dev.1

12 months ago

2.0.1-dev.0

12 months ago

1.0.8-dev.0

1 year ago

2.0.0-dev.1

1 year ago

2.0.0-dev.3

1 year ago

2.0.0-dev.2

1 year ago

2.0.0-dev.5

1 year ago

2.0.0-dev.4

1 year ago

2.0.0-dev.7

12 months ago

2.0.0-dev.6

1 year ago

2.0.0-dev.9

12 months ago

2.0.0-dev.8

12 months ago

1.0.7-dev.51

1 year ago

1.0.7-dev.52

1 year ago

1.0.7-dev.55

1 year ago

1.0.7-dev.56

1 year ago

1.0.7-dev.53

1 year ago

1.0.7-dev.54

1 year ago

1.0.7-dev.57

1 year ago

1.0.7-dev.58

1 year ago

1.0.7-dev.62

1 year ago

1.0.7-dev.63

1 year ago

1.0.7-dev.60

1 year ago

1.0.7-dev.61

1 year ago

1.0.7-dev.39

1 year ago

1.0.7-dev.34

1 year ago

1.0.7-dev.37

1 year ago

1.0.7-dev.38

1 year ago

1.0.7-dev.35

1 year ago

1.0.7-dev.36

1 year ago

1.0.7-dev.40

1 year ago

1.0.7-dev.41

1 year ago

1.0.7-dev.44

1 year ago

1.0.7-dev.45

1 year ago

1.0.7-dev.42

1 year ago

1.0.7-dev.48

1 year ago

1.0.7-dev.49

1 year ago

1.0.7-dev.46

1 year ago

1.0.7-dev.47

1 year ago

1.0.7-dev.50

1 year ago

1.0.7-dev.19

1 year ago

1.0.7-dev.4

1 year ago

1.0.7-dev.5

1 year ago

1.0.7-dev.17

1 year ago

1.0.7-dev.2

1 year ago

1.0.7-dev.18

1 year ago

1.0.7-dev.3

1 year ago

1.0.7-dev.8

1 year ago

1.0.7-dev.9

1 year ago

1.0.7-dev.6

1 year ago

1.0.7-dev.7

1 year ago

1.0.7-dev.0

1 year ago

1.0.6

1 year ago

1.0.7-dev.1

1 year ago

1.0.7-dev.30

1 year ago

1.0.7-dev.33

1 year ago

1.0.7-dev.11

1 year ago

1.0.7-dev.12

1 year ago

1.0.7-dev.32

1 year ago

1.0.7-dev.10

1 year ago

1.0.7-dev.15

1 year ago

1.0.7-dev.16

1 year ago

1.0.7-dev.13

1 year ago

1.0.7-dev.14

1 year ago

1.0.7-dev.28

1 year ago

1.0.7-dev.29

1 year ago

1.0.7-dev.22

1 year ago

1.0.7-dev.23

1 year ago

1.0.7-dev.20

1 year ago

1.0.7-dev.26

1 year ago

1.0.7-dev.27

1 year ago

1.0.7-dev.24

1 year ago

1.0.7-dev.25

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.4

1 year ago

1.0.3

1 year ago

0.1.0

2 years ago

1.0.0

2 years ago