basefn 1.0.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/README.md +104 -0
- package/package.json +82 -0
- package/rescript.json +32 -0
- package/src/Basefn.css +14 -0
- package/src/Basefn.res +105 -0
- package/src/Basefn.res.mjs +114 -0
- package/src/Basefn__Dom.res +9 -0
- package/src/Basefn__Dom.res.mjs +24 -0
- package/src/Basefn__Utils.res +15 -0
- package/src/Basefn__Utils.res.mjs +32 -0
- package/src/Demo.res +1417 -0
- package/src/Demo.res.mjs +2328 -0
- package/src/Eita.res.mjs +105 -0
- package/src/Eita__Accordion.res.mjs +77 -0
- package/src/Eita__Alert.res.mjs +81 -0
- package/src/Eita__AppLayout.res.mjs +100 -0
- package/src/Eita__Avatar.res.mjs +40 -0
- package/src/Eita__Badge.res.mjs +65 -0
- package/src/Eita__Breadcrumb.res.mjs +53 -0
- package/src/Eita__Button.res.mjs +47 -0
- package/src/Eita__Card.res.mjs +60 -0
- package/src/Eita__Checkbox.res.mjs +36 -0
- package/src/Eita__Dom.res.mjs +16 -0
- package/src/Eita__Drawer.res.mjs +112 -0
- package/src/Eita__Dropdown.res.mjs +96 -0
- package/src/Eita__Grid.res.mjs +24 -0
- package/src/Eita__Input.res.mjs +54 -0
- package/src/Eita__Kbd.res.mjs +42 -0
- package/src/Eita__Label.res.mjs +24 -0
- package/src/Eita__Modal.res.mjs +93 -0
- package/src/Eita__Progress.res.mjs +101 -0
- package/src/Eita__Radio.res.mjs +38 -0
- package/src/Eita__Select.res.mjs +40 -0
- package/src/Eita__Separator.res.mjs +70 -0
- package/src/Eita__Sidebar.res.mjs +103 -0
- package/src/Eita__Slider.res.mjs +89 -0
- package/src/Eita__Spinner.res.mjs +69 -0
- package/src/Eita__Stepper.res.mjs +114 -0
- package/src/Eita__Switch.res.mjs +84 -0
- package/src/Eita__Tabs.res.mjs +57 -0
- package/src/Eita__Textarea.res.mjs +39 -0
- package/src/Eita__Timeline.res.mjs +86 -0
- package/src/Eita__Toast.res.mjs +112 -0
- package/src/Eita__Tooltip.res.mjs +60 -0
- package/src/Eita__Topbar.res.mjs +96 -0
- package/src/Eita__Typography.res.mjs +183 -0
- package/src/Eita__Utils.res.mjs +32 -0
- package/src/Example.res +111 -0
- package/src/Example.res.mjs +176 -0
- package/src/components/Basefn__Accordion.css +70 -0
- package/src/components/Basefn__Accordion.res +79 -0
- package/src/components/Basefn__Accordion.res.mjs +77 -0
- package/src/components/Basefn__Alert.css +79 -0
- package/src/components/Basefn__Alert.res +68 -0
- package/src/components/Basefn__Alert.res.mjs +78 -0
- package/src/components/Basefn__AppLayout.css +100 -0
- package/src/components/Basefn__AppLayout.res +74 -0
- package/src/components/Basefn__AppLayout.res.mjs +100 -0
- package/src/components/Basefn__Avatar.css +25 -0
- package/src/components/Basefn__Avatar.res +23 -0
- package/src/components/Basefn__Avatar.res.mjs +40 -0
- package/src/components/Basefn__Badge.css +71 -0
- package/src/components/Basefn__Badge.res +43 -0
- package/src/components/Basefn__Badge.res.mjs +65 -0
- package/src/components/Basefn__Breadcrumb.css +36 -0
- package/src/components/Basefn__Breadcrumb.res +45 -0
- package/src/components/Basefn__Breadcrumb.res.mjs +53 -0
- package/src/components/Basefn__Button.css +83 -0
- package/src/components/Basefn__Button.res +32 -0
- package/src/components/Basefn__Button.res.mjs +54 -0
- package/src/components/Basefn__Card.css +50 -0
- package/src/components/Basefn__Card.res +45 -0
- package/src/components/Basefn__Card.res.mjs +60 -0
- package/src/components/Basefn__Checkbox.css +72 -0
- package/src/components/Basefn__Checkbox.res +25 -0
- package/src/components/Basefn__Checkbox.res.mjs +36 -0
- package/src/components/Basefn__Drawer.css +168 -0
- package/src/components/Basefn__Drawer.res +86 -0
- package/src/components/Basefn__Drawer.res.mjs +112 -0
- package/src/components/Basefn__Dropdown.css +76 -0
- package/src/components/Basefn__Dropdown.res +85 -0
- package/src/components/Basefn__Dropdown.res.mjs +96 -0
- package/src/components/Basefn__Grid.css +11 -0
- package/src/components/Basefn__Grid.res +296 -0
- package/src/components/Basefn__Grid.res.mjs +263 -0
- package/src/components/Basefn__Icon.css +12 -0
- package/src/components/Basefn__Icon.res +196 -0
- package/src/components/Basefn__Icon.res.mjs +183 -0
- package/src/components/Basefn__Input.css +44 -0
- package/src/components/Basefn__Input.res +48 -0
- package/src/components/Basefn__Input.res.mjs +63 -0
- package/src/components/Basefn__Kbd.css +65 -0
- package/src/components/Basefn__Kbd.res +27 -0
- package/src/components/Basefn__Kbd.res.mjs +42 -0
- package/src/components/Basefn__Label.css +22 -0
- package/src/components/Basefn__Label.res +18 -0
- package/src/components/Basefn__Label.res.mjs +24 -0
- package/src/components/Basefn__Modal.css +100 -0
- package/src/components/Basefn__Modal.res +74 -0
- package/src/components/Basefn__Modal.res.mjs +93 -0
- package/src/components/Basefn__Progress.css +69 -0
- package/src/components/Basefn__Progress.res +88 -0
- package/src/components/Basefn__Progress.res.mjs +101 -0
- package/src/components/Basefn__Radio.css +72 -0
- package/src/components/Basefn__Radio.res +35 -0
- package/src/components/Basefn__Radio.res.mjs +38 -0
- package/src/components/Basefn__Select.css +44 -0
- package/src/components/Basefn__Select.res +33 -0
- package/src/components/Basefn__Select.res.mjs +40 -0
- package/src/components/Basefn__Separator.css +85 -0
- package/src/components/Basefn__Separator.res +45 -0
- package/src/components/Basefn__Separator.res.mjs +70 -0
- package/src/components/Basefn__Sidebar.css +141 -0
- package/src/components/Basefn__Sidebar.res +95 -0
- package/src/components/Basefn__Sidebar.res.mjs +107 -0
- package/src/components/Basefn__Slider.css +97 -0
- package/src/components/Basefn__Slider.res +68 -0
- package/src/components/Basefn__Slider.res.mjs +89 -0
- package/src/components/Basefn__Spinner.css +63 -0
- package/src/components/Basefn__Spinner.res +44 -0
- package/src/components/Basefn__Spinner.res.mjs +69 -0
- package/src/components/Basefn__Stepper.css +141 -0
- package/src/components/Basefn__Stepper.res +86 -0
- package/src/components/Basefn__Stepper.res.mjs +114 -0
- package/src/components/Basefn__Switch.css +80 -0
- package/src/components/Basefn__Switch.res +62 -0
- package/src/components/Basefn__Switch.res.mjs +84 -0
- package/src/components/Basefn__Tabs.css +54 -0
- package/src/components/Basefn__Tabs.res +73 -0
- package/src/components/Basefn__Tabs.res.mjs +57 -0
- package/src/components/Basefn__Textarea.css +41 -0
- package/src/components/Basefn__Textarea.res +28 -0
- package/src/components/Basefn__Textarea.res.mjs +41 -0
- package/src/components/Basefn__ThemeToggle.css +5 -0
- package/src/components/Basefn__ThemeToggle.res +29 -0
- package/src/components/Basefn__ThemeToggle.res.mjs +49 -0
- package/src/components/Basefn__Timeline.css +144 -0
- package/src/components/Basefn__Timeline.res +70 -0
- package/src/components/Basefn__Timeline.res.mjs +86 -0
- package/src/components/Basefn__Toast.css +100 -0
- package/src/components/Basefn__Toast.res +92 -0
- package/src/components/Basefn__Toast.res.mjs +112 -0
- package/src/components/Basefn__Tooltip.css +84 -0
- package/src/components/Basefn__Tooltip.res +42 -0
- package/src/components/Basefn__Tooltip.res.mjs +60 -0
- package/src/components/Basefn__Topbar.css +130 -0
- package/src/components/Basefn__Topbar.res +92 -0
- package/src/components/Basefn__Topbar.res.mjs +91 -0
- package/src/components/Basefn__Typography.css +120 -0
- package/src/components/Basefn__Typography.res +96 -0
- package/src/components/Basefn__Typography.res.mjs +175 -0
- package/src/styles/Basefn__Theme.res +63 -0
- package/src/styles/Basefn__Theme.res.mjs +65 -0
- package/src/styles/variables.css +199 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# basefn-UI
|
|
2
|
+
|
|
3
|
+
A simple, neutrally styled UI component library for [Xote](https://github.com/brnrdog/xote) applications, primarily used to battle-test the Xote framework against a real-world user interface system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install basefn
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Make sure you have installed [xote](https://github.com/brnrdog/xote) and [rescript-signals](https://github.com/brnrdog/rescript-signals).
|
|
12
|
+
|
|
13
|
+
## Usage Patterns
|
|
14
|
+
|
|
15
|
+
Components accept both regular values and signals. Use the `static()` for static values, or `reactive()` for reactive signals:
|
|
16
|
+
|
|
17
|
+
```rescript
|
|
18
|
+
open basefnUI
|
|
19
|
+
open ReactiveProp
|
|
20
|
+
|
|
21
|
+
// Using regular values (static)
|
|
22
|
+
<Button
|
|
23
|
+
variant={Button.Primary}
|
|
24
|
+
label={static("Click me")}
|
|
25
|
+
onClick={_ => Console.log("You clicked!")}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
// Using signals (reactive)
|
|
29
|
+
let labelSignal = Signal.make("Click me")
|
|
30
|
+
<Button
|
|
31
|
+
variant={Button.Primary}
|
|
32
|
+
label={reactive(labelSignal)}
|
|
33
|
+
onClick={_ => Signal.set(labelSignal, "You clicked!")}
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Components
|
|
38
|
+
|
|
39
|
+
See the available components at [src/components](https://github.com/brnrdog/basefn-ui/tree/main/src/components). Contributions are welcome if features are missing.
|
|
40
|
+
|
|
41
|
+
## Theming
|
|
42
|
+
|
|
43
|
+
All components use CSS variables for styling, making them easy to customize. Override the variables in your CSS:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
:root {
|
|
47
|
+
--basefn-color-primary: #your-color;
|
|
48
|
+
--basefn-color-secondary: #your-color;
|
|
49
|
+
/* ... other variables */
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See `src/styles/variables.css` for all available CSS variables.
|
|
54
|
+
|
|
55
|
+
## Development
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Install dependencies
|
|
59
|
+
npm install
|
|
60
|
+
|
|
61
|
+
# Start development server with Vite (hot reload)
|
|
62
|
+
npm run dev
|
|
63
|
+
|
|
64
|
+
# Build ReScript code
|
|
65
|
+
npm run build
|
|
66
|
+
|
|
67
|
+
# Watch mode for ReScript
|
|
68
|
+
npm run watch
|
|
69
|
+
|
|
70
|
+
# Build for production
|
|
71
|
+
npm run build:vite
|
|
72
|
+
|
|
73
|
+
# Preview production build
|
|
74
|
+
npm run preview
|
|
75
|
+
|
|
76
|
+
# Clean ReScript build
|
|
77
|
+
npm run clean
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Running the Demo
|
|
81
|
+
|
|
82
|
+
1. Install dependencies: `npm install`
|
|
83
|
+
2. Build the ReScript code: `npm run build`
|
|
84
|
+
3. Start the dev server: `npm run dev`
|
|
85
|
+
4. Open your browser to `http://localhost:3000`
|
|
86
|
+
|
|
87
|
+
The demo application showcases all components with live form state updates.
|
|
88
|
+
|
|
89
|
+
## Project Structure
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
basefn-ui/
|
|
93
|
+
├── src/
|
|
94
|
+
│ ├── components/ # All UI components
|
|
95
|
+
│ ├── styles/ # CSS variables and theming
|
|
96
|
+
│ ├── Basefn__Dom.res # Simple dom bindings used in the lib
|
|
97
|
+
│ └── Basefn.res # Main export file
|
|
98
|
+
├── package.json
|
|
99
|
+
└── rescript.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "basefn",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/brnrdog/basefn.git"
|
|
7
|
+
},
|
|
8
|
+
"description": "A simple UI component library for Xote applications",
|
|
9
|
+
"main": "src/Basefn.res.mjs",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"src/**/*.res",
|
|
13
|
+
"src/**/*.resi",
|
|
14
|
+
"src/**/*.res.mjs",
|
|
15
|
+
"src/**/*.css",
|
|
16
|
+
"rescript.json"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rescript",
|
|
20
|
+
"clean": "rescript clean",
|
|
21
|
+
"watch": "rescript build -w",
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"build:vite": "vite build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"rescript",
|
|
28
|
+
"xote",
|
|
29
|
+
"ui",
|
|
30
|
+
"components"
|
|
31
|
+
],
|
|
32
|
+
"author": "Bernardo Gurgel <brnrdog@hey.com>",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@rescript/core": "^1.6.1",
|
|
36
|
+
"highlight.js": "^11.11.1",
|
|
37
|
+
"lucide": "^0.562.0",
|
|
38
|
+
"xote": "^4.8.0"
|
|
39
|
+
},
|
|
40
|
+
"release": {
|
|
41
|
+
"branches": [
|
|
42
|
+
"main"
|
|
43
|
+
],
|
|
44
|
+
"plugins": [
|
|
45
|
+
"@semantic-release/commit-analyzer",
|
|
46
|
+
"@semantic-release/release-notes-generator",
|
|
47
|
+
[
|
|
48
|
+
"@semantic-release/changelog",
|
|
49
|
+
{
|
|
50
|
+
"changelogFile": "docs/CHANGELOG.md"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"@semantic-release/git",
|
|
55
|
+
{
|
|
56
|
+
"assets": [
|
|
57
|
+
"docs/CHANGELOG.md"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"@semantic-release/github",
|
|
62
|
+
[
|
|
63
|
+
"@semantic-release/npm",
|
|
64
|
+
{
|
|
65
|
+
"npmPublish": true,
|
|
66
|
+
"provenance": true
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@commitlint/cli": "^20.1.0",
|
|
73
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
74
|
+
"@rescript/core": "^1.6.1",
|
|
75
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
76
|
+
"@semantic-release/git": "^10.0.1",
|
|
77
|
+
"@semantic-release/github": "^12.0.2",
|
|
78
|
+
"@semantic-release/npm": "^13.1.3",
|
|
79
|
+
"rescript": "^12.0.1",
|
|
80
|
+
"vite": "^5.0.0"
|
|
81
|
+
}
|
|
82
|
+
}
|
package/rescript.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "basefn",
|
|
3
|
+
"sources": [
|
|
4
|
+
{
|
|
5
|
+
"dir": "src",
|
|
6
|
+
"subdirs": true,
|
|
7
|
+
"public": ["Basefn"]
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"dir": "docs",
|
|
11
|
+
"subdirs": true,
|
|
12
|
+
"public": ["Basefn"]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"package-specs": {
|
|
16
|
+
"module": "esmodule",
|
|
17
|
+
"in-source": true
|
|
18
|
+
},
|
|
19
|
+
"suffix": ".res.mjs",
|
|
20
|
+
"dependencies": [
|
|
21
|
+
"@rescript/core",
|
|
22
|
+
"rescript-signals",
|
|
23
|
+
"xote"
|
|
24
|
+
],
|
|
25
|
+
"compiler-flags": [
|
|
26
|
+
"-open RescriptCore"
|
|
27
|
+
],
|
|
28
|
+
"jsx": {
|
|
29
|
+
"version": 4,
|
|
30
|
+
"module": "Xote__JSX"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/Basefn.css
ADDED
package/src/Basefn.res
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
%%raw(`import './basefn.css'`)
|
|
2
|
+
// Main basefn UI module - exposes all components and utilities
|
|
3
|
+
|
|
4
|
+
// Re-export component types
|
|
5
|
+
type selectOption = Basefn__Select.selectOption
|
|
6
|
+
type inputType = Basefn__Input.inputType
|
|
7
|
+
type buttonVariant = Basefn__Button.variant
|
|
8
|
+
type badgeVariant = Basefn__Badge.variant
|
|
9
|
+
type badgeSize = Basefn__Badge.size
|
|
10
|
+
type spinnerSize = Basefn__Spinner.size
|
|
11
|
+
type spinnerVariant = Basefn__Spinner.variant
|
|
12
|
+
type separatorOrientation = Basefn__Separator.orientation
|
|
13
|
+
type separatorVariant = Basefn__Separator.variant
|
|
14
|
+
type kbdSize = Basefn__Kbd.size
|
|
15
|
+
type typographyVariant = Basefn__Typography.variant
|
|
16
|
+
type typographyAlign = Basefn__Typography.align
|
|
17
|
+
type alertVariant = Basefn__Alert.variant
|
|
18
|
+
type progressSize = Basefn__Progress.size
|
|
19
|
+
type progressVariant = Basefn__Progress.variant
|
|
20
|
+
type tab = Basefn__Tabs.tab
|
|
21
|
+
type accordionItem = Basefn__Accordion.accordionItem
|
|
22
|
+
type breadcrumbItem = Basefn__Breadcrumb.breadcrumbItem
|
|
23
|
+
type modalSize = Basefn__Modal.size
|
|
24
|
+
type tooltipPosition = Basefn__Tooltip.position
|
|
25
|
+
type switchSize = Basefn__Switch.size
|
|
26
|
+
type dropdownMenuItem = Basefn__Dropdown.menuItem
|
|
27
|
+
type dropdownMenuContent = Basefn__Dropdown.menuContent
|
|
28
|
+
type toastVariant = Basefn__Toast.variant
|
|
29
|
+
type toastPosition = Basefn__Toast.position
|
|
30
|
+
type stepperOrientation = Basefn__Stepper.orientation
|
|
31
|
+
type stepStatus = Basefn__Stepper.stepStatus
|
|
32
|
+
type stepperStep = Basefn__Stepper.step
|
|
33
|
+
type drawerPosition = Basefn__Drawer.position
|
|
34
|
+
type drawerSize = Basefn__Drawer.size
|
|
35
|
+
type timelineOrientation = Basefn__Timeline.orientation
|
|
36
|
+
type timelineVariant = Basefn__Timeline.variant
|
|
37
|
+
type timelineItem = Basefn__Timeline.timelineItem
|
|
38
|
+
type sidebarSize = Basefn__Sidebar.size
|
|
39
|
+
type sidebarNavItem = Basefn__Sidebar.navItem
|
|
40
|
+
type sidebarNavSection = Basefn__Sidebar.navSection
|
|
41
|
+
type topbarSize = Basefn__Topbar.size
|
|
42
|
+
type topbarNavItem = Basefn__Topbar.navItem
|
|
43
|
+
type appLayoutContentWidth = Basefn__AppLayout.contentWidth
|
|
44
|
+
type iconName = Basefn__Icon.name
|
|
45
|
+
type iconSize = Basefn__Icon.size
|
|
46
|
+
type gridColumns = Basefn__Grid.columns
|
|
47
|
+
type gridRows = Basefn__Grid.rows
|
|
48
|
+
type gridAutoFlow = Basefn__Grid.autoFlow
|
|
49
|
+
type gridJustifyItems = Basefn__Grid.justifyItems
|
|
50
|
+
type gridAlignItems = Basefn__Grid.alignItems
|
|
51
|
+
type gridJustifyContent = Basefn__Grid.justifyContent
|
|
52
|
+
type gridAlignContent = Basefn__Grid.alignContent
|
|
53
|
+
type gridItemColumnSpan = Basefn__Grid.Item.columnSpan
|
|
54
|
+
type gridItemRowSpan = Basefn__Grid.Item.rowSpan
|
|
55
|
+
|
|
56
|
+
// Form Components
|
|
57
|
+
module Button = Basefn__Button
|
|
58
|
+
module Input = Basefn__Input
|
|
59
|
+
module Textarea = Basefn__Textarea
|
|
60
|
+
module Select = Basefn__Select
|
|
61
|
+
module Checkbox = Basefn__Checkbox
|
|
62
|
+
module Radio = Basefn__Radio
|
|
63
|
+
module Label = Basefn__Label
|
|
64
|
+
|
|
65
|
+
// Tier 1 Foundation Components
|
|
66
|
+
module Badge = Basefn__Badge
|
|
67
|
+
module Spinner = Basefn__Spinner
|
|
68
|
+
module Separator = Basefn__Separator
|
|
69
|
+
module Kbd = Basefn__Kbd
|
|
70
|
+
module Typography = Basefn__Typography
|
|
71
|
+
|
|
72
|
+
// Tier 2
|
|
73
|
+
module Card = Basefn__Card
|
|
74
|
+
module Avatar = Basefn__Avatar
|
|
75
|
+
module Grid = Basefn__Grid
|
|
76
|
+
module Alert = Basefn__Alert
|
|
77
|
+
module Progress = Basefn__Progress
|
|
78
|
+
module Tabs = Basefn__Tabs
|
|
79
|
+
module Accordion = Basefn__Accordion
|
|
80
|
+
module Breadcrumb = Basefn__Breadcrumb
|
|
81
|
+
|
|
82
|
+
// Tier 3
|
|
83
|
+
module Modal = Basefn__Modal
|
|
84
|
+
module Tooltip = Basefn__Tooltip
|
|
85
|
+
module Switch = Basefn__Switch
|
|
86
|
+
module Slider = Basefn__Slider
|
|
87
|
+
module Dropdown = Basefn__Dropdown
|
|
88
|
+
module Toast = Basefn__Toast
|
|
89
|
+
|
|
90
|
+
// Tier 4 - Navigation & Layout
|
|
91
|
+
module Stepper = Basefn__Stepper
|
|
92
|
+
module Drawer = Basefn__Drawer
|
|
93
|
+
module Timeline = Basefn__Timeline
|
|
94
|
+
|
|
95
|
+
// Application Layout
|
|
96
|
+
module Sidebar = Basefn__Sidebar
|
|
97
|
+
module Topbar = Basefn__Topbar
|
|
98
|
+
module AppLayout = Basefn__AppLayout
|
|
99
|
+
|
|
100
|
+
// Theme
|
|
101
|
+
module Theme = Basefn__Theme
|
|
102
|
+
module ThemeToggle = Basefn__ThemeToggle
|
|
103
|
+
|
|
104
|
+
// Icons
|
|
105
|
+
module Icon = Basefn__Icon
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import './basefn.css'
|
|
5
|
+
;
|
|
6
|
+
|
|
7
|
+
let Button;
|
|
8
|
+
|
|
9
|
+
let Input;
|
|
10
|
+
|
|
11
|
+
let Textarea;
|
|
12
|
+
|
|
13
|
+
let Select;
|
|
14
|
+
|
|
15
|
+
let Checkbox;
|
|
16
|
+
|
|
17
|
+
let Radio;
|
|
18
|
+
|
|
19
|
+
let Label;
|
|
20
|
+
|
|
21
|
+
let Badge;
|
|
22
|
+
|
|
23
|
+
let Spinner;
|
|
24
|
+
|
|
25
|
+
let Separator;
|
|
26
|
+
|
|
27
|
+
let Kbd;
|
|
28
|
+
|
|
29
|
+
let Typography;
|
|
30
|
+
|
|
31
|
+
let Card;
|
|
32
|
+
|
|
33
|
+
let Avatar;
|
|
34
|
+
|
|
35
|
+
let Grid;
|
|
36
|
+
|
|
37
|
+
let Alert;
|
|
38
|
+
|
|
39
|
+
let Progress;
|
|
40
|
+
|
|
41
|
+
let Tabs;
|
|
42
|
+
|
|
43
|
+
let Accordion;
|
|
44
|
+
|
|
45
|
+
let Breadcrumb;
|
|
46
|
+
|
|
47
|
+
let Modal;
|
|
48
|
+
|
|
49
|
+
let Tooltip;
|
|
50
|
+
|
|
51
|
+
let Switch;
|
|
52
|
+
|
|
53
|
+
let Slider;
|
|
54
|
+
|
|
55
|
+
let Dropdown;
|
|
56
|
+
|
|
57
|
+
let Toast;
|
|
58
|
+
|
|
59
|
+
let Stepper;
|
|
60
|
+
|
|
61
|
+
let Drawer;
|
|
62
|
+
|
|
63
|
+
let Timeline;
|
|
64
|
+
|
|
65
|
+
let Sidebar;
|
|
66
|
+
|
|
67
|
+
let Topbar;
|
|
68
|
+
|
|
69
|
+
let AppLayout;
|
|
70
|
+
|
|
71
|
+
let Theme;
|
|
72
|
+
|
|
73
|
+
let ThemeToggle;
|
|
74
|
+
|
|
75
|
+
let Icon;
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
Button,
|
|
79
|
+
Input,
|
|
80
|
+
Textarea,
|
|
81
|
+
Select,
|
|
82
|
+
Checkbox,
|
|
83
|
+
Radio,
|
|
84
|
+
Label,
|
|
85
|
+
Badge,
|
|
86
|
+
Spinner,
|
|
87
|
+
Separator,
|
|
88
|
+
Kbd,
|
|
89
|
+
Typography,
|
|
90
|
+
Card,
|
|
91
|
+
Avatar,
|
|
92
|
+
Grid,
|
|
93
|
+
Alert,
|
|
94
|
+
Progress,
|
|
95
|
+
Tabs,
|
|
96
|
+
Accordion,
|
|
97
|
+
Breadcrumb,
|
|
98
|
+
Modal,
|
|
99
|
+
Tooltip,
|
|
100
|
+
Switch,
|
|
101
|
+
Slider,
|
|
102
|
+
Dropdown,
|
|
103
|
+
Toast,
|
|
104
|
+
Stepper,
|
|
105
|
+
Drawer,
|
|
106
|
+
Timeline,
|
|
107
|
+
Sidebar,
|
|
108
|
+
Topbar,
|
|
109
|
+
AppLayout,
|
|
110
|
+
Theme,
|
|
111
|
+
ThemeToggle,
|
|
112
|
+
Icon,
|
|
113
|
+
}
|
|
114
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
let target = (e: Dom.event) => Obj.magic(e)["target"]
|
|
2
|
+
|
|
3
|
+
let preventDefault = (e: Dom.event) => %raw(`e.preventDefault()`)
|
|
4
|
+
|
|
5
|
+
let stopPropagation = (e: Dom.event) => %raw(`e.stopPropagation()`)
|
|
6
|
+
|
|
7
|
+
let addEventListener = %raw(`function(a, b) { document.addEventListener(a, b) }`)
|
|
8
|
+
|
|
9
|
+
@set external setInnerHTML: (Dom.element, string) => unit = "setInnerHTML"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function target(e) {
|
|
5
|
+
return e.target;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function preventDefault(e) {
|
|
9
|
+
return (e.preventDefault());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function stopPropagation(e) {
|
|
13
|
+
return (e.stopPropagation());
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let addEventListener = (function(a, b) { document.addEventListener(a, b) });
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
target,
|
|
20
|
+
preventDefault,
|
|
21
|
+
stopPropagation,
|
|
22
|
+
addEventListener,
|
|
23
|
+
}
|
|
24
|
+
/* No side effect */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Utility types and functions for handling both regular values and signals
|
|
2
|
+
|
|
3
|
+
type reactive<'a> =
|
|
4
|
+
| Value('a)
|
|
5
|
+
| SignalValue(Signals.Signal.t<'a>)
|
|
6
|
+
|
|
7
|
+
let getValue = (reactive: reactive<'a>): 'a => {
|
|
8
|
+
switch reactive {
|
|
9
|
+
| Value(v) => v
|
|
10
|
+
| SignalValue(s) => Signals.Signal.get(s)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let makeReactive = (value: 'a): reactive<'a> => Value(value)
|
|
15
|
+
let makeReactiveFromSignal = (signal: Signals.Signal.t<'a>): reactive<'a> => SignalValue(signal)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Signals from "rescript-signals/src/Signals.res.mjs";
|
|
4
|
+
|
|
5
|
+
function getValue(reactive) {
|
|
6
|
+
if (reactive.TAG === "Value") {
|
|
7
|
+
return reactive._0;
|
|
8
|
+
} else {
|
|
9
|
+
return Signals.Signal.get(reactive._0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function makeReactive(value) {
|
|
14
|
+
return {
|
|
15
|
+
TAG: "Value",
|
|
16
|
+
_0: value
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function makeReactiveFromSignal(signal) {
|
|
21
|
+
return {
|
|
22
|
+
TAG: "SignalValue",
|
|
23
|
+
_0: signal
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
getValue,
|
|
29
|
+
makeReactive,
|
|
30
|
+
makeReactiveFromSignal,
|
|
31
|
+
}
|
|
32
|
+
/* Signals Not a pure module */
|