benivo-ui-library 1.9.64 → 1.9.66
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/.design-sync/NOTES.md +59 -0
- package/.design-sync/config.json +11 -0
- package/.design-sync/conventions.md +71 -0
- package/.prettierrc.json +8 -0
- package/.storybook/main.js +65 -0
- package/.storybook/preview.js +15 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/mcp.json +9 -0
- package/.vscode/settings.json +6 -0
- package/Benivo.UI.lib.csproj +21 -0
- package/Benivo.UI.lib.sln +33 -0
- package/LICENSE +21 -0
- package/Properties/launchSettings.json +27 -0
- package/jest.config.js +20 -0
- package/lib/README.md +38 -0
- package/{currencyInput.less → lib/currencyInput.less} +41 -33
- package/lib/index.js +2 -0
- package/{index.js.LICENSE.txt → lib/index.js.LICENSE.txt} +1 -1
- package/lib/package.json +137 -0
- package/mocking/fileMock.js +7 -0
- package/mocking/mock.worker.js +25 -0
- package/mocking/setup.js +1 -0
- package/mocking/styleMock.js +1 -0
- package/package.json +1 -1
- package/tsconfig.json +18 -0
- package/webpack.config.dev.js +91 -0
- package/index.js +0 -2
- /package/{arrowButton.less → lib/arrowButton.less} +0 -0
- /package/{asideSummaryCard.less → lib/asideSummaryCard.less} +0 -0
- /package/{asideSummaryCardSection.less → lib/asideSummaryCardSection.less} +0 -0
- /package/{assignmentSelectBox.less → lib/assignmentSelectBox.less} +0 -0
- /package/{autoComplete.less → lib/autoComplete.less} +0 -0
- /package/{benivo-ui-lib.less → lib/benivo-ui-lib.less} +0 -0
- /package/{benivoLogo.less → lib/benivoLogo.less} +0 -0
- /package/{button.less → lib/button.less} +0 -0
- /package/{buttonOld.less → lib/buttonOld.less} +0 -0
- /package/{checkbox.less → lib/checkbox.less} +0 -0
- /package/{copyInput.less → lib/copyInput.less} +0 -0
- /package/{countryFlag.less → lib/countryFlag.less} +0 -0
- /package/{data-table.less → lib/data-table.less} +0 -0
- /package/{datePicker.less → lib/datePicker.less} +0 -0
- /package/{drawer.less → lib/drawer.less} +0 -0
- /package/{dropdownButton.less → lib/dropdownButton.less} +0 -0
- /package/{expander.less → lib/expander.less} +0 -0
- /package/{fantasyButton.less → lib/fantasyButton.less} +0 -0
- /package/{forms.less → lib/forms.less} +0 -0
- /package/{frame.less → lib/frame.less} +0 -0
- /package/{freshDeskChat.less → lib/freshDeskChat.less} +0 -0
- /package/{googleTranslate.less → lib/googleTranslate.less} +0 -0
- /package/{image.less → lib/image.less} +0 -0
- /package/{infoMessageBanner.less → lib/infoMessageBanner.less} +0 -0
- /package/{input.less → lib/input.less} +0 -0
- /package/{loader.less → lib/loader.less} +0 -0
- /package/{main.less → lib/main.less} +0 -0
- /package/{mixins.less → lib/mixins.less} +0 -0
- /package/{navigation.less → lib/navigation.less} +0 -0
- /package/{notifications.less → lib/notifications.less} +0 -0
- /package/{phoneNumber.less → lib/phoneNumber.less} +0 -0
- /package/{pop-up.less → lib/pop-up.less} +0 -0
- /package/{radiobutton.less → lib/radiobutton.less} +0 -0
- /package/{select.less → lib/select.less} +0 -0
- /package/{sidebarMenu.less → lib/sidebarMenu.less} +0 -0
- /package/{spacing.less → lib/spacing.less} +0 -0
- /package/{spinner.less → lib/spinner.less} +0 -0
- /package/{splashScreen.less → lib/splashScreen.less} +0 -0
- /package/{status.less → lib/status.less} +0 -0
- /package/{swiper-a11y.less → lib/swiper-a11y.less} +0 -0
- /package/{swiper-effect-cube.less → lib/swiper-effect-cube.less} +0 -0
- /package/{swiper-effect-fade.less → lib/swiper-effect-fade.less} +0 -0
- /package/{swiper-effect-flip.less → lib/swiper-effect-flip.less} +0 -0
- /package/{swiper-lazy.less → lib/swiper-lazy.less} +0 -0
- /package/{swiper-navigation.less → lib/swiper-navigation.less} +0 -0
- /package/{swiper-pagination.less → lib/swiper-pagination.less} +0 -0
- /package/{swiper-scrollbar.less → lib/swiper-scrollbar.less} +0 -0
- /package/{swiper-thumb.less → lib/swiper-thumb.less} +0 -0
- /package/{swiper-zoom.less → lib/swiper-zoom.less} +0 -0
- /package/{swiper.less → lib/swiper.less} +0 -0
- /package/{tabGroup.less → lib/tabGroup.less} +0 -0
- /package/{table-sort.less → lib/table-sort.less} +0 -0
- /package/{tabs.less → lib/tabs.less} +0 -0
- /package/{tagsSelect.less → lib/tagsSelect.less} +0 -0
- /package/{textarea.less → lib/textarea.less} +0 -0
- /package/{tooltip.less → lib/tooltip.less} +0 -0
- /package/{typography-helper.less → lib/typography-helper.less} +0 -0
- /package/{typography.less → lib/typography.less} +0 -0
- /package/{variables.less → lib/variables.less} +0 -0
- /package/{withPortal.less → lib/withPortal.less} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Benivo UI Library — Design Sync Notes
|
|
2
|
+
|
|
3
|
+
## Build configuration
|
|
4
|
+
|
|
5
|
+
- **Entry**: `src/index.js` (ES module with `export { ... }` for 49 components)
|
|
6
|
+
- **Bundle global**: `window.BenivoUiLibrary`
|
|
7
|
+
- **Build tool**: esbuild via `.ds-sync/lib/bundle.mjs`
|
|
8
|
+
- **Alias resolution**: `tsconfigPathsPlugin` reading `tsconfig.json` (added to repo for this purpose)
|
|
9
|
+
- **Synthetic `.d.ts`**: `lib/index.d.ts` enumerates all 49 PascalCase component exports — required because the package ships no TypeScript declarations. `package.json` has `"types": "lib/index.d.ts"` so `exportedNames()` in `dts.mjs` can find it.
|
|
10
|
+
|
|
11
|
+
## Windows-specific fixes
|
|
12
|
+
|
|
13
|
+
### `tsconfigPathsPlugin` directory-alias error
|
|
14
|
+
`existsSync()` on an alias that resolves to a directory (e.g. `Component` → `src/components/`) throws "Incorrect function" on Windows. Fixed in `.ds-sync/lib/bundle.mjs` with `statSync().isFile()` check — falls through to esbuild's default resolution for directory aliases and picks up the `index.js` correctly.
|
|
15
|
+
|
|
16
|
+
### JSX in `.js` files
|
|
17
|
+
11 source files contain JSX but use the `.js` extension (esbuild's default loader doesn't handle JSX in `.js`). Files were renamed to `.jsx`:
|
|
18
|
+
- `src/components/TableSort.js`
|
|
19
|
+
- `src/components/dnd/index.js`
|
|
20
|
+
- `src/components/frame/index.js`
|
|
21
|
+
- `src/components/pop-up/index.js`
|
|
22
|
+
- `src/contexts/entry-popup/provider.js`
|
|
23
|
+
- `src/components/ErrorBoundary.js`
|
|
24
|
+
- `src/lazyLoader.js`
|
|
25
|
+
- `src/components/DataTable.skeleton.js`
|
|
26
|
+
- `src/components/SharedCells.js`
|
|
27
|
+
- `src/components/TableCheck.js`
|
|
28
|
+
- `src/components/TableRowMenu.js`
|
|
29
|
+
|
|
30
|
+
## Non-blocking warnings (accepted)
|
|
31
|
+
|
|
32
|
+
- `[TOKENS_MISSING]`: 5 Swiper CSS vars (`--swiper-slides-offset-before`, `--swiper-slides-offset-after`, `--swiper-centered-offset-before`, `--swiper-centered-offset-after`, `--text-200`) — internal to the Swiper.js library, not part of the Benivo DS token set. Ignored.
|
|
33
|
+
- `[FONT_MISSING]`: "icomoon" and "proxima-nova" — no `@font-face` declarations ship in the package CSS. The "Benivo DS" project already has Proxima Nova TTFs in `fonts/`. Designs render correctly using those. icomoon icons will render as rectangles in the design agent preview (acceptable for design use).
|
|
34
|
+
|
|
35
|
+
## Component grades
|
|
36
|
+
|
|
37
|
+
| Component | Verdict | Note |
|
|
38
|
+
|-----------|---------|------|
|
|
39
|
+
| Button | `close` (6/6) | Correct primary blue; canvas scale smaller than Storybook (consistent delta across all interactive components) |
|
|
40
|
+
| Checkbox | `close` | Correct checked/unchecked state styling; smaller canvas |
|
|
41
|
+
| CopyInput | `match` (6/6) | Pixel-faithful |
|
|
42
|
+
| FantasyButton | `close` (6/6) | All 5 state colors correct; smaller canvas |
|
|
43
|
+
| Input | `match` (6/6) | Pixel-faithful |
|
|
44
|
+
| RadioButton | `close` (6/6) | Radio circle + label correct; smaller canvas |
|
|
45
|
+
| TagsSelect | `match` (6/6) | Pixel-faithful |
|
|
46
|
+
|
|
47
|
+
The "smaller canvas" delta is a consistent framing difference between the Storybook viewport and the preview canvas — not a component rendering issue. It cannot be fixed at the component level.
|
|
48
|
+
|
|
49
|
+
## Re-sync risks
|
|
50
|
+
|
|
51
|
+
- **Adding new stories to an existing component**: the `.cache/compare/<Name>.json` snapshot becomes stale → run `resync.mjs` without `--force` and the driver will detect it (sources unchanged, but story list changed) and prompt for a new grade.
|
|
52
|
+
- **Upgrading benivo-ui-library**: any package version bump changes the bundle hash → all components lose their carry-forward status → full re-verify run required.
|
|
53
|
+
- **Renaming an alias in tsconfig.json**: if new aliases point to a directory (not an `index.js` file), the Windows `statSync().isFile()` fix in `bundle.mjs` handles it. No extra action needed.
|
|
54
|
+
- **Adding more `.js` files with JSX**: rename to `.jsx` before running the sync.
|
|
55
|
+
- **Storybook configuration changes**: if `.storybook/main.js` changes the stories glob, the `sb-reference` snapshot becomes stale → delete `.design-sync/sb-reference/` and re-run `resync.mjs` to regenerate.
|
|
56
|
+
|
|
57
|
+
## Scope
|
|
58
|
+
|
|
59
|
+
Only 7 components were in scope for this sync (the ones with Storybook stories). The full library has 49 exports. Components without stories (`DataTable`, `Tabs`, `Drawer`, `Tooltip`, `SwiperSlider`, `GoogleAutoComplete`, etc.) are bundled in `_ds_bundle.js` and available at `window.BenivoUiLibrary.*` but have no preview cards or `.prompt.md` files. To add them: create story files and re-run `resync.mjs`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectId": "019e21a8-1874-714a-bb62-eeaa9040ee77",
|
|
3
|
+
"pkg": "benivo-ui-library",
|
|
4
|
+
"shape": "storybook",
|
|
5
|
+
"storybookConfigDir": ".storybook",
|
|
6
|
+
"storybookStatic": ".design-sync/sb-reference",
|
|
7
|
+
"entry": "src/index.js",
|
|
8
|
+
"tsconfig": "tsconfig.json",
|
|
9
|
+
"buildCmd": "npm run build",
|
|
10
|
+
"readmeHeader": ".design-sync/conventions.md"
|
|
11
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Benivo UI Library — Design Conventions
|
|
2
|
+
|
|
3
|
+
**Package:** `benivo-ui-library` · **Global:** `window.BenivoUiLibrary`
|
|
4
|
+
|
|
5
|
+
This is the Benivo component library used across all Benivo React frontend apps (EPApp, MPApp, VPApp, AdminApp). Import from `'benivo-ui-library'`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component categories
|
|
10
|
+
|
|
11
|
+
### Form inputs
|
|
12
|
+
`Input`, `Textarea`, `Checkbox`, `RadioButton`, `Select`, `AsyncSelect`, `TagsSelect`, `DatePicker`, `CopyInput`
|
|
13
|
+
|
|
14
|
+
All form inputs expose a controlled-value `value` prop and an `onChange` callback. Most pair with a hook: `useInput`, `useCheckbox`, `useRadioButton`, `useSelect`, `useDatePicker`, `useTextarea`. Use hooks for clean state management.
|
|
15
|
+
|
|
16
|
+
`Input` accepts optional `prePost` (object with `pre`/`post` string labels, e.g. `{ pre: "$", post: "USD" }`) and `icons` (object with `start`/`end` icomoon class strings).
|
|
17
|
+
|
|
18
|
+
`TagsSelect` wraps react-select for multi-value tag selection. Use `value`/`onChange` with an array; pass `getOptionLabel`/`getOptionValue` for custom shapes.
|
|
19
|
+
|
|
20
|
+
### Buttons
|
|
21
|
+
`Button`, `FantasyButton`, `ArrowButton`, `DropdownButton`
|
|
22
|
+
|
|
23
|
+
`Button` variants: `type` prop (`"contained"` default, `"ghost"`, `"text"`); `color` prop (`"primary"`, `"danger"`, `"success"`, `"warning"`, `"grey"`). Always pass `onClick`; use `disabled` for non-interactive states.
|
|
24
|
+
|
|
25
|
+
`FantasyButton` is the async-action button with built-in state machine: `status` prop (`"idle"` | `"loading"` | `"completed"` | `"failed"`). Shows animated progress fill during loading.
|
|
26
|
+
|
|
27
|
+
### Data display
|
|
28
|
+
`DataTable`, `Status`, `Amount`, `CountryFlag`, `Expander`, `AsideSummaryCard`, `AsideSummaryCardSection`, `InfoMessageBanner`, `PageNoData`
|
|
29
|
+
|
|
30
|
+
`DataTable` wraps PrimeReact DataTable. Pass `columns` array with `{field, header}` and `data` array. Supports sorting, pagination, and row menus via `rowMenu` prop.
|
|
31
|
+
|
|
32
|
+
### Navigation & layout
|
|
33
|
+
`Tabs`, `TabGroup`, `TabItem`, `Drawer`, `SidebarMenu`, `SidebarMenuItem`, `SidebarMenuButton`
|
|
34
|
+
|
|
35
|
+
`Tabs` is the full tab component; use `TabGroup`/`TabItem` for custom compositions.
|
|
36
|
+
|
|
37
|
+
### Overlays & portals
|
|
38
|
+
`Tooltip`, `WithPortal`
|
|
39
|
+
|
|
40
|
+
`Tooltip` wraps any child and shows tooltip text on hover. `WithPortal` renders children into a portal.
|
|
41
|
+
|
|
42
|
+
### Media & assets
|
|
43
|
+
`Image`, `Logo`, `BnvLogo`, `SwiperSlider`, `CountryFlag`
|
|
44
|
+
|
|
45
|
+
### Loaders
|
|
46
|
+
`Loader`, `Spinner`, `SplashScreen`
|
|
47
|
+
|
|
48
|
+
### Address / location
|
|
49
|
+
`GoogleAutoComplete`, `AzureAutoComplete`, `HereAutocomplete`, `FallbackAutoComplete`, `AddressView`
|
|
50
|
+
|
|
51
|
+
### Entry popup system
|
|
52
|
+
`EntryPopupProvider`, `EntryPopupFrame`
|
|
53
|
+
|
|
54
|
+
Wrap the app tree in `EntryPopupProvider` to use the entry popup context. Use `useEntryPopup` hook to open/close.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Styling conventions
|
|
59
|
+
|
|
60
|
+
- Components consume CSS variables from the Benivo token set (e.g. `--primary-color`, `--danger-color`). Always render within the Benivo LESS/CSS environment.
|
|
61
|
+
- The icomoon icon font is required for icon-bearing components (`Input` with icons, action indicators). Icons are passed as CSS class strings (e.g. `"icon-search"`).
|
|
62
|
+
- Proxima Nova is the brand typeface. Components fall back to system sans-serif gracefully.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Key patterns
|
|
67
|
+
|
|
68
|
+
- **Controlled inputs only.** All form components are fully controlled; never rely on uncontrolled behavior.
|
|
69
|
+
- **Hooks for form state.** Prefer `useInput(initialValue)` → `{ value, onChange, reset }` over bare `useState`.
|
|
70
|
+
- **`label` prop for field labels.** Most form inputs accept a `label` string and render it above the field. Pass `required` boolean for the asterisk indicator.
|
|
71
|
+
- **`error` prop for validation messages.** Pass a string to show an error below the field with red styling.
|
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
4
|
+
|
|
5
|
+
const config = {
|
|
6
|
+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
7
|
+
|
|
8
|
+
addons: [
|
|
9
|
+
'@storybook/addon-webpack5-compiler-swc',
|
|
10
|
+
'@storybook/addon-onboarding',
|
|
11
|
+
'@storybook/addon-links',
|
|
12
|
+
'@storybook/addon-essentials',
|
|
13
|
+
'@chromatic-com/storybook',
|
|
14
|
+
'@storybook/addon-interactions',
|
|
15
|
+
'@storybook/addon-styling-webpack',
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
framework: {
|
|
19
|
+
name: '@storybook/react-webpack5',
|
|
20
|
+
options: {
|
|
21
|
+
builder: { useSWC: true }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
swc: () => ({
|
|
26
|
+
jsc: {
|
|
27
|
+
parser: {
|
|
28
|
+
syntax: 'ecmascript',
|
|
29
|
+
jsx: true,
|
|
30
|
+
},
|
|
31
|
+
transform: {
|
|
32
|
+
react: {
|
|
33
|
+
runtime: 'automatic',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
|
|
39
|
+
webpackFinal: async (config) => {
|
|
40
|
+
config.resolve.alias = {
|
|
41
|
+
...config.resolve.alias,
|
|
42
|
+
'@': path.resolve(__dirname, '../src/'),
|
|
43
|
+
Hooks: path.resolve(__dirname, '../src/hooks'),
|
|
44
|
+
HOC: path.resolve(__dirname, '../src/components/HOC'),
|
|
45
|
+
Utils: path.resolve(__dirname, '../src/utils'),
|
|
46
|
+
Component: path.resolve(__dirname, '../src/components'),
|
|
47
|
+
Contexts: path.resolve(__dirname, '../src/contexts'),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
config.module.rules.push({
|
|
51
|
+
test: /\.less$/,
|
|
52
|
+
use: [
|
|
53
|
+
MiniCssExtractPlugin.loader,
|
|
54
|
+
{ loader: 'css-loader', options: { sourceMap: true } },
|
|
55
|
+
{ loader: 'less-loader', options: { sourceMap: true } }
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
config.plugins.push(new MiniCssExtractPlugin());
|
|
60
|
+
|
|
61
|
+
return config;
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default config;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @type { import('@storybook/react').Preview } */
|
|
2
|
+
import '../src/assets/main.less';
|
|
3
|
+
|
|
4
|
+
const preview = {
|
|
5
|
+
parameters: {
|
|
6
|
+
controls: {
|
|
7
|
+
matchers: {
|
|
8
|
+
color: /(background|color)$/i,
|
|
9
|
+
date: /Date$/i,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default preview;
|
package/.vscode/mcp.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
2
|
+
|
|
3
|
+
<PropertyGroup Label="Globals">
|
|
4
|
+
<SccProjectName>SAK</SccProjectName>
|
|
5
|
+
<SccProvider>SAK</SccProvider>
|
|
6
|
+
<SccAuxPath>SAK</SccAuxPath>
|
|
7
|
+
<SccLocalPath>SAK</SccLocalPath>
|
|
8
|
+
</PropertyGroup>
|
|
9
|
+
|
|
10
|
+
<PropertyGroup>
|
|
11
|
+
<TargetFramework>netcoreapp3.1</TargetFramework>
|
|
12
|
+
</PropertyGroup>
|
|
13
|
+
|
|
14
|
+
<ItemGroup>
|
|
15
|
+
<Compile Remove="lib\**" />
|
|
16
|
+
<Content Remove="lib\**" />
|
|
17
|
+
<EmbeddedResource Remove="lib\**" />
|
|
18
|
+
<None Remove="lib\**" />
|
|
19
|
+
</ItemGroup>
|
|
20
|
+
|
|
21
|
+
</Project>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
3
|
+
# Visual Studio Version 16
|
|
4
|
+
VisualStudioVersion = 16.0.30503.244
|
|
5
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
|
6
|
+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benivo.UI.lib", "Benivo.UI.lib.csproj", "{1AA1D8F2-00EE-407C-8520-FB4A67381AF5}"
|
|
7
|
+
EndProject
|
|
8
|
+
Global
|
|
9
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
10
|
+
Debug|Any CPU = Debug|Any CPU
|
|
11
|
+
Release|Any CPU = Release|Any CPU
|
|
12
|
+
EndGlobalSection
|
|
13
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
14
|
+
{1AA1D8F2-00EE-407C-8520-FB4A67381AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
15
|
+
{1AA1D8F2-00EE-407C-8520-FB4A67381AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
16
|
+
{1AA1D8F2-00EE-407C-8520-FB4A67381AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
17
|
+
{1AA1D8F2-00EE-407C-8520-FB4A67381AF5}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
18
|
+
EndGlobalSection
|
|
19
|
+
GlobalSection(SolutionProperties) = preSolution
|
|
20
|
+
HideSolutionNode = FALSE
|
|
21
|
+
EndGlobalSection
|
|
22
|
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
23
|
+
SolutionGuid = {262C0D48-5B19-41E7-96BD-5B2C9D72BD07}
|
|
24
|
+
EndGlobalSection
|
|
25
|
+
GlobalSection(TeamFoundationVersionControl) = preSolution
|
|
26
|
+
SccNumberOfProjects = 2
|
|
27
|
+
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
|
28
|
+
SccTeamFoundationServer = https://brandjourney.visualstudio.com/
|
|
29
|
+
SccLocalPath0 = .
|
|
30
|
+
SccProjectUniqueName1 = Benivo.UI.lib.csproj
|
|
31
|
+
SccLocalPath1 = .
|
|
32
|
+
EndGlobalSection
|
|
33
|
+
EndGlobal
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Benivo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"iisSettings": {
|
|
3
|
+
"windowsAuthentication": false,
|
|
4
|
+
"anonymousAuthentication": true,
|
|
5
|
+
"iisExpress": {
|
|
6
|
+
"applicationUrl": "http://localhost:62524/",
|
|
7
|
+
"sslPort": 44383
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"profiles": {
|
|
11
|
+
"IIS Express": {
|
|
12
|
+
"commandName": "IISExpress",
|
|
13
|
+
"launchBrowser": true,
|
|
14
|
+
"environmentVariables": {
|
|
15
|
+
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"Benivo.UI.lib": {
|
|
19
|
+
"commandName": "Project",
|
|
20
|
+
"launchBrowser": true,
|
|
21
|
+
"environmentVariables": {
|
|
22
|
+
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
23
|
+
},
|
|
24
|
+
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
testEnvironment: 'jsdom',
|
|
4
|
+
setupFiles: ['<rootDir>/mocking/setup.js', '<rootDir>/mocking/mock.worker.js'],
|
|
5
|
+
moduleFileExtensions: ["js", "json", "jsx"],
|
|
6
|
+
moduleNameMapper: {
|
|
7
|
+
"\\.(css|less)$": "identity-obj-proxy",
|
|
8
|
+
"\\.(gif|ttf|eot|svg)$": "<rootDir>/mocking/fileMock.js",
|
|
9
|
+
"^Component(.*)$": "<rootDir>/src/components$1",
|
|
10
|
+
"^Utils(.*)$": "<rootDir>/src/utils$1",
|
|
11
|
+
"^Hooks(.*)$": "<rootDir>/src/hooks$1",
|
|
12
|
+
"^HOK(.*)$": "<rootDir>/src/HOK$1",
|
|
13
|
+
"^Contexts(.*)$": "<rootDir>/src/contexts$1",
|
|
14
|
+
},
|
|
15
|
+
transform: {
|
|
16
|
+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/mocking/fileMock.js",
|
|
17
|
+
"^.+\\.jsx?$": "babel-jest"
|
|
18
|
+
},
|
|
19
|
+
transformIgnorePatterns: ["/node_modules/"],
|
|
20
|
+
}
|
package/lib/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# benivo-ui-library
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/joemccann/dillinger)
|
|
4
|
+
|
|
5
|
+
`benivo-ui-library` is a collection of react hooks and components for faster development.
|
|
6
|
+
|
|
7
|
+
# Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
$npm install benivo-ui-library --save
|
|
11
|
+
```
|
|
12
|
+
# Basic usage
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { Input, Select, Checkbox, Button } from 'benivo-ui-library';
|
|
17
|
+
import { useInput, useSelect, useCheckbox } from 'benivo-ui-library';
|
|
18
|
+
import { withTransition } from 'benivo-ui-library';
|
|
19
|
+
|
|
20
|
+
function MyApp() {
|
|
21
|
+
const email = useInput('initialvalue@gmail.com');
|
|
22
|
+
const agree = useCheckbox(false);
|
|
23
|
+
const event= useSelect('all');
|
|
24
|
+
const eventOptions=['all', 'news', 'promotional'];
|
|
25
|
+
const handleSubmit=()=>{
|
|
26
|
+
//some smart code here
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<form>
|
|
31
|
+
<Input label="Email" {...email.bind} />
|
|
32
|
+
<Select label="Events" options={eventOptions} {...event.bind}/>
|
|
33
|
+
<Checkbox label="I agree" {...agree.bind} />
|
|
34
|
+
<Button onClick={handleSubmit}>Subscribe</Button>
|
|
35
|
+
</form>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -134,39 +134,6 @@
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
.currency-input-menu {
|
|
138
|
-
position: absolute;
|
|
139
|
-
top: ~'calc(100% + 6px)';
|
|
140
|
-
right: 0;
|
|
141
|
-
min-width: 100%;
|
|
142
|
-
margin: 0;
|
|
143
|
-
padding: 0.25rem 0;
|
|
144
|
-
list-style: none;
|
|
145
|
-
z-index: @zindex-dropdown;
|
|
146
|
-
background: var(--white);
|
|
147
|
-
border: 1px solid var(--border-200);
|
|
148
|
-
.border-radius(@form-border-radius);
|
|
149
|
-
.box-shadow(0 4px 12px 0 rgba(16, 24, 40, 0.12));
|
|
150
|
-
max-height: 240px;
|
|
151
|
-
overflow-y: auto;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.currency-input-option {
|
|
155
|
-
padding: 0.5rem 0.75rem;
|
|
156
|
-
font-size: @font-size-sm;
|
|
157
|
-
cursor: pointer;
|
|
158
|
-
white-space: nowrap;
|
|
159
|
-
|
|
160
|
-
&:hover {
|
|
161
|
-
background: var(--bg-50);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&.selected {
|
|
165
|
-
font-weight: @font-weight-semibold;
|
|
166
|
-
background: var(--bg-50);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
137
|
.currency-input-hint {
|
|
171
138
|
display: block;
|
|
172
139
|
margin-top: 0.25rem;
|
|
@@ -175,3 +142,44 @@
|
|
|
175
142
|
color: var(--text-300);
|
|
176
143
|
}
|
|
177
144
|
}
|
|
145
|
+
|
|
146
|
+
// Menu is rendered through a portal into document.body, so its styles must live
|
|
147
|
+
// at the top level rather than nested under .currency-input.
|
|
148
|
+
.currency-input-menu {
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: ~'calc(100% + 6px)';
|
|
151
|
+
right: 0;
|
|
152
|
+
min-width: 100%;
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0.25rem 0;
|
|
155
|
+
list-style: none;
|
|
156
|
+
z-index: @zindex-dropdown;
|
|
157
|
+
background: var(--white);
|
|
158
|
+
border: 1px solid var(--border-200);
|
|
159
|
+
.border-radius(@form-border-radius);
|
|
160
|
+
.box-shadow(0 4px 12px 0 rgba(16, 24, 40, 0.12));
|
|
161
|
+
max-height: 240px;
|
|
162
|
+
overflow-y: auto;
|
|
163
|
+
|
|
164
|
+
&.currency-input-menu--portal {
|
|
165
|
+
position: fixed;
|
|
166
|
+
top: auto;
|
|
167
|
+
z-index: @zindex-modal;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.currency-input-option {
|
|
172
|
+
padding: 0.5rem 0.75rem;
|
|
173
|
+
font-size: @font-size-sm;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
white-space: nowrap;
|
|
176
|
+
|
|
177
|
+
&:hover {
|
|
178
|
+
background: var(--bg-50);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.selected {
|
|
182
|
+
font-weight: @font-weight-semibold;
|
|
183
|
+
background: var(--bg-50);
|
|
184
|
+
}
|
|
185
|
+
}
|