shadcn-ui 0.0.1
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.
- checksums.yaml +7 -0
- data/.editorconfig +10 -0
- data/.prettierignore +43 -0
- data/.prettierrc.json +28 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.vscode/settings.json +11 -0
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +113 -0
- data/LICENSE.md +18 -0
- data/Procfile.dev +2 -0
- data/README.md +90 -0
- data/Rakefile +12 -0
- data/app/assets/builds/.keep +0 -0
- data/app/assets/config/manifest.js +5 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/stylesheets/application.scss +42 -0
- data/app/assets/stylesheets/application.tailwind.css +92 -0
- data/app/assets/stylesheets/lambda.light.scss +136 -0
- data/app/channels/application_cable/channel.rb +4 -0
- data/app/channels/application_cable/connection.rb +4 -0
- data/app/controllers/application_controller.rb +8 -0
- data/app/controllers/components_controller.rb +7 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/components/accordion_helper.rb +5 -0
- data/app/helpers/components/alert_dialog_helper.rb +6 -0
- data/app/helpers/components/alert_helper.rb +11 -0
- data/app/helpers/components/badge_helper.rb +20 -0
- data/app/helpers/components/button_helper.rb +20 -0
- data/app/helpers/components/card_helper.rb +5 -0
- data/app/helpers/components/checkbox_helper.rb +5 -0
- data/app/helpers/components/collapsible_helper.rb +6 -0
- data/app/helpers/components/dialog_helper.rb +14 -0
- data/app/helpers/components/dropdown_menu_helper.rb +23 -0
- data/app/helpers/components/hover_card_helper.rb +15 -0
- data/app/helpers/components/popover_helper.rb +15 -0
- data/app/helpers/components/seperator_helper.rb +6 -0
- data/app/helpers/components/textarea_helper.rb +13 -0
- data/app/helpers/components/toast_helper.rb +5 -0
- data/app/helpers/components/toggle_helper.rb +6 -0
- data/app/helpers/components/tooltip_helper.rb +15 -0
- data/app/helpers/components_helper.rb +7 -0
- data/app/helpers/examples_helper.rb +41 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/hello_controller.js +7 -0
- data/app/javascript/controllers/highlight_controller.js +9 -0
- data/app/javascript/controllers/index.js +11 -0
- data/app/javascript/controllers/tabs_controller.js +72 -0
- data/app/javascript/controllers/ui/accordion_controller.js +128 -0
- data/app/javascript/controllers/ui/checkbox_controller.js +17 -0
- data/app/javascript/controllers/ui/collapsible_controller.js +28 -0
- data/app/javascript/controllers/ui/dialog_controller.js +92 -0
- data/app/javascript/controllers/ui/dropdown_controller.js +25 -0
- data/app/javascript/controllers/ui/hover-card_controller.js +39 -0
- data/app/javascript/controllers/ui/popover_controller.js +27 -0
- data/app/javascript/controllers/ui/toast_controller.js +43 -0
- data/app/javascript/controllers/ui/toggle_controller.js +15 -0
- data/app/javascript/controllers/ui/tooltip_controller.js +3 -0
- data/app/javascript/controllers/ui/transition_controller.js +8 -0
- data/app/jobs/application_job.rb +7 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/concerns/.keep +0 -0
- data/app/views/application/index.html.erb +0 -0
- data/app/views/components/ui/_accordion.html.erb +40 -0
- data/app/views/components/ui/_alert.html.erb +55 -0
- data/app/views/components/ui/_alert_dialog.html.erb +20 -0
- data/app/views/components/ui/_badge.html.erb +1 -0
- data/app/views/components/ui/_button.html.erb +11 -0
- data/app/views/components/ui/_card.html.erb +13 -0
- data/app/views/components/ui/_checkbox.html.erb +37 -0
- data/app/views/components/ui/_collapsible.html.erb +38 -0
- data/app/views/components/ui/_dialog.html.erb +69 -0
- data/app/views/components/ui/_dropdown_menu.html.erb +9 -0
- data/app/views/components/ui/_hover_card.html.erb +18 -0
- data/app/views/components/ui/_popover.html.erb +19 -0
- data/app/views/components/ui/_separator.html.erb +4 -0
- data/app/views/components/ui/_textarea.html.erb +9 -0
- data/app/views/components/ui/_toast.html.erb +34 -0
- data/app/views/components/ui/_toggle.html.erb +3 -0
- data/app/views/components/ui/_tooltip.html.erb +18 -0
- data/app/views/components/ui/shared/_dialog_background.html.erb +7 -0
- data/app/views/components/ui/shared/_menu_item.html.erb +6 -0
- data/app/views/examples/authentication/index.html.erb +148 -0
- data/app/views/examples/components/accordion.html.erb +17 -0
- data/app/views/examples/components/alert-dialog.html.erb +24 -0
- data/app/views/examples/components/alert.html.erb +22 -0
- data/app/views/examples/components/badge.html.erb +30 -0
- data/app/views/examples/components/button.html.erb +33 -0
- data/app/views/examples/components/card.html.erb +156 -0
- data/app/views/examples/components/checkbox.html.erb +8 -0
- data/app/views/examples/components/collapsible.html.erb +24 -0
- data/app/views/examples/components/dialog/_usage.html.erb +28 -0
- data/app/views/examples/components/dialog/code/form.erb +48 -0
- data/app/views/examples/components/dialog/code/notifications.erb +83 -0
- data/app/views/examples/components/dialog/code/preview.erb +14 -0
- data/app/views/examples/components/dialog/code/usage.erb +8 -0
- data/app/views/examples/components/dialog.html.erb +148 -0
- data/app/views/examples/components/dropdown-menu.html.erb +26 -0
- data/app/views/examples/components/hover-card.html.erb +24 -0
- data/app/views/examples/components/popover.html.erb +34 -0
- data/app/views/examples/components/separator.html.erb +33 -0
- data/app/views/examples/components/textarea.html.erb +12 -0
- data/app/views/examples/components/toast.html.erb +15 -0
- data/app/views/examples/components/toggle.html.erb +12 -0
- data/app/views/examples/components/tooltip.html.erb +23 -0
- data/app/views/layouts/_sidebar.html.erb +270 -0
- data/app/views/layouts/application.html.erb +33 -0
- data/app/views/layouts/component.html.erb +35 -0
- data/app/views/layouts/documentation/_breadcrumb.html.erb +17 -0
- data/app/views/layouts/documentation/_component_header.html.erb +11 -0
- data/app/views/layouts/documentation/_examples.html.erb +80 -0
- data/app/views/layouts/documentation/_preview.html.erb +90 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/shared/_header.html.erb +164 -0
- data/config/application.rb +37 -0
- data/config/boot.rb +4 -0
- data/config/cable.yml +11 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +70 -0
- data/config/environments/production.rb +93 -0
- data/config/environments/test.rb +60 -0
- data/config/importmap.rb +13 -0
- data/config/initializers/assets.rb +12 -0
- data/config/initializers/content_security_policy.rb +25 -0
- data/config/initializers/filter_parameter_logging.rb +8 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/permissions_policy.rb +11 -0
- data/config/locales/en.yml +33 -0
- data/config/puma.rb +43 -0
- data/config/render.yml +9 -0
- data/config/routes.rb +7 -0
- data/config/storage.yml +34 -0
- data/config/tailwind.config.js +86 -0
- data/config.ru +6 -0
- data/db/seeds.rb +7 -0
- data/lib/assets/.keep +0 -0
- data/lib/generators/shadcn_ui_generator.rb +32 -0
- data/lib/shadcn-ui/shadcn-ui.rb +8 -0
- data/lib/shadcn-ui/version.rb +3 -0
- data/lib/tasks/.keep +0 -0
- data/log/.keep +0 -0
- data/package-lock.json +1014 -0
- data/package.json +8 -0
- data/public/404.html +67 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/android-chrome-192x192.png +0 -0
- data/public/android-chrome-512x512.png +0 -0
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon-16x16.png +0 -0
- data/public/favicon-32x32.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/og.jpg +0 -0
- data/public/robots.txt +1 -0
- data/sig/shadcn-ui.rbs +4 -0
- data/storage/.keep +0 -0
- data/tmp/.keep +0 -0
- data/tmp/pids/.keep +0 -0
- data/tmp/storage/.keep +0 -0
- data/vendor/.keep +0 -0
- data/vendor/javascript/.keep +0 -0
- metadata +214 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2c5bb322090bfc7c251b5bcfa6daaaee17f56194d345fb0f653e66b0c367194c
|
4
|
+
data.tar.gz: e9b663d94ca1084d7a9351c355bc8093e78e1eb4d7af55b96f2c253824bb67ca
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1f85cd138dd5be8981c6578b63d0c595606ed2953171efcda89202a9136bd5eb63c32cb39ad3498fd2eb35555c43779079ddcd298f4698993868a5d77dae7bbd
|
7
|
+
data.tar.gz: ecc9016da1365510ed5b854999e701c294d680b87adfd2540055c7c8f767b65add7245dd4571a29e0707df1032f8232ef395679c77fe94ee5851e364c2f5181f
|
data/.editorconfig
ADDED
data/.prettierignore
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-*
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*
|
16
|
+
/tmp/*
|
17
|
+
!/log/.keep
|
18
|
+
!/tmp/.keep
|
19
|
+
|
20
|
+
# Ignore pidfiles, but keep the directory.
|
21
|
+
/tmp/pids/*
|
22
|
+
!/tmp/pids/
|
23
|
+
!/tmp/pids/.keep
|
24
|
+
|
25
|
+
# Ignore uploaded files in development.
|
26
|
+
/storage/*
|
27
|
+
!/storage/.keep
|
28
|
+
/tmp/storage/*
|
29
|
+
!/tmp/storage/
|
30
|
+
!/tmp/storage/.keep
|
31
|
+
|
32
|
+
/public/assets
|
33
|
+
|
34
|
+
# Ignore master key for decrypting credentials and more.
|
35
|
+
/config/master.key
|
36
|
+
|
37
|
+
/app/assets/builds/*
|
38
|
+
!/app/assets/builds/.keep
|
39
|
+
|
40
|
+
exa-taildash
|
41
|
+
node_modules
|
42
|
+
yarn-error.log
|
43
|
+
node_modules
|
data/.prettierrc.json
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"tabWidth": 2,
|
3
|
+
"useTabs": false,
|
4
|
+
"bracketSameLine": false,
|
5
|
+
"printWidth": 100,
|
6
|
+
"singleAttributePerLine": true,
|
7
|
+
"proseWrap": "always",
|
8
|
+
"overrides": [
|
9
|
+
{
|
10
|
+
"files": "*.erb",
|
11
|
+
"options": {
|
12
|
+
"parser": "html"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"files": "erb",
|
17
|
+
"options": {
|
18
|
+
"parser": "html"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"files": "*.html.erb",
|
23
|
+
"options": {
|
24
|
+
"parser": "html"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-3.2.2
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a
|
6
|
+
harassment-free experience for everyone, regardless of age, body size, visible or invisible
|
7
|
+
disability, ethnicity, sex characteristics, gender identity and expression, level of experience,
|
8
|
+
education, socio-economic status, nationality, personal appearance, race, religion, or sexual
|
9
|
+
identity and orientation.
|
10
|
+
|
11
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and
|
12
|
+
healthy community.
|
13
|
+
|
14
|
+
## Our Standards
|
15
|
+
|
16
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
17
|
+
|
18
|
+
- Demonstrating empathy and kindness toward other people
|
19
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
20
|
+
- Giving and gracefully accepting constructive feedback
|
21
|
+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the
|
22
|
+
experience
|
23
|
+
- Focusing on what is best not just for us as individuals, but for the overall community
|
24
|
+
|
25
|
+
Examples of unacceptable behavior include:
|
26
|
+
|
27
|
+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
28
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
29
|
+
- Public or private harassment
|
30
|
+
- Publishing others' private information, such as a physical or email address, without their
|
31
|
+
explicit permission
|
32
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
33
|
+
|
34
|
+
## Enforcement Responsibilities
|
35
|
+
|
36
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior
|
37
|
+
and will take appropriate and fair corrective action in response to any behavior that they deem
|
38
|
+
inappropriate, threatening, offensive, or harmful.
|
39
|
+
|
40
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits,
|
41
|
+
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and
|
42
|
+
will communicate reasons for moderation decisions when appropriate.
|
43
|
+
|
44
|
+
## Scope
|
45
|
+
|
46
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is
|
47
|
+
officially representing the community in public spaces. Examples of representing our community
|
48
|
+
include using an official e-mail address, posting via an official social media account, or acting as
|
49
|
+
an appointed representative at an online or offline event.
|
50
|
+
|
51
|
+
## Enforcement
|
52
|
+
|
53
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community
|
54
|
+
leaders responsible for enforcement at 4515+aviflombaum@users.noreply.github.com. All complaints
|
55
|
+
will be reviewed and investigated promptly and fairly.
|
56
|
+
|
57
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any
|
58
|
+
incident.
|
59
|
+
|
60
|
+
## Enforcement Guidelines
|
61
|
+
|
62
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for
|
63
|
+
any action they deem in violation of this Code of Conduct:
|
64
|
+
|
65
|
+
### 1. Correction
|
66
|
+
|
67
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or
|
68
|
+
unwelcome in the community.
|
69
|
+
|
70
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the
|
71
|
+
nature of the violation and an explanation of why the behavior was inappropriate. A public apology
|
72
|
+
may be requested.
|
73
|
+
|
74
|
+
### 2. Warning
|
75
|
+
|
76
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
77
|
+
|
78
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people
|
79
|
+
involved, including unsolicited interaction with those enforcing the Code of Conduct, for a
|
80
|
+
specified period of time. This includes avoiding interactions in community spaces as well as
|
81
|
+
external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
82
|
+
|
83
|
+
### 3. Temporary Ban
|
84
|
+
|
85
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate
|
86
|
+
behavior.
|
87
|
+
|
88
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the
|
89
|
+
community for a specified period of time. No public or private interaction with the people involved,
|
90
|
+
including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this
|
91
|
+
period. Violating these terms may lead to a permanent ban.
|
92
|
+
|
93
|
+
### 4. Permanent Ban
|
94
|
+
|
95
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including
|
96
|
+
sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement
|
97
|
+
of classes of individuals.
|
98
|
+
|
99
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
100
|
+
|
101
|
+
## Attribution
|
102
|
+
|
103
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at
|
104
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
105
|
+
|
106
|
+
Community Impact Guidelines were inspired by
|
107
|
+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
108
|
+
|
109
|
+
[homepage]: https://www.contributor-covenant.org
|
110
|
+
|
111
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
112
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
113
|
+
https://www.contributor-covenant.org/translations.
|
data/LICENSE.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 shadcn
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
6
|
+
associated documentation files (the "Software"), to deal in the Software without restriction,
|
7
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
8
|
+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
12
|
+
portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
15
|
+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
16
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
|
17
|
+
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Procfile.dev
ADDED
data/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# shadcn/ui on Rails
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/shadcn-ui)
|
4
|
+
|
5
|
+
Accessible and customizable components that you can copy and paste into your apps. Free. Open
|
6
|
+
Source. **Use this to build your own component library**.
|
7
|
+
|
8
|
+

|
9
|
+
|
10
|
+
## Documentation
|
11
|
+
|
12
|
+
Visit https://avi.nyc/shadcn-on-rails to view the documentation.
|
13
|
+
|
14
|
+
## Contributing
|
15
|
+
|
16
|
+
I am desperately seeking contributors to this project as it is in the very early stages.
|
17
|
+
|
18
|
+
### Contributing with Issues
|
19
|
+
|
20
|
+
I am looking for people to start documenting issues in the project. The issues I'm interested in
|
21
|
+
are:
|
22
|
+
|
23
|
+
1. What components are missing? Just start listing out the components that have yet to be
|
24
|
+
implemented, better yet, open a PR with a branch for that issue and we can all start adding to
|
25
|
+
it.
|
26
|
+
2. What components are not accessible? I am not an accessibility expert, so I need help with this.
|
27
|
+
If you see something that is not accessible, please open an issue and let me know. This might
|
28
|
+
mean the aria labels are hardcoded and not customizable or that the labels are simply missing.
|
29
|
+
3. What components are not customizable? I am trying to make all components as customizable as
|
30
|
+
possible. If you see something that is not customizable, please open an issue and let me know.
|
31
|
+
All the attributes of a component, like aria labels or classes or id or name, etc, should be
|
32
|
+
customizeable by passing attributes into their helper functions that are passed down to the
|
33
|
+
component's partial to be rendered.
|
34
|
+
4. Suggestions for the API of the components. I am trying to make the API as simple as possible. If
|
35
|
+
you have any suggestions for how to make the API simpler, please open an issue and let me know. I
|
36
|
+
am open to any and all suggestions.
|
37
|
+
|
38
|
+
These are 3 main areas that would make the project easier for people to contribute to. They all make
|
39
|
+
for great opportunities for someone new to open source to both file the issue and even begin to
|
40
|
+
slowly implement them.
|
41
|
+
|
42
|
+
### Setup
|
43
|
+
|
44
|
+
1. Fork and clone the repo.
|
45
|
+
2. Run `bundle install` to install dependencies, there aren't many as this is currently a standard
|
46
|
+
Rails applications.
|
47
|
+
3. `/bin/dev` to start the application.
|
48
|
+
|
49
|
+
### App Structure
|
50
|
+
|
51
|
+
For now this is a standard Rails 7 application using propshaft and **importmaps**. This will soon be
|
52
|
+
extracted into a gem that provides the components to be installed (copied) into the including
|
53
|
+
application.
|
54
|
+
|
55
|
+
### Components
|
56
|
+
|
57
|
+
The goal of this project is to provide a set of components that can be copied into your application.
|
58
|
+
The components are built using [TailwindCSS](https://tailwindcss.com/) and
|
59
|
+
[Stimulus](https://stimulus.hotwire.dev/). Each component follows the same structure:
|
60
|
+
|
61
|
+
1. There is a component partial located in `app/views/components/ui` that is rendered by the
|
62
|
+
component helper. Ex `app/views/components/ui/_button.html.erb` provides the markup for the
|
63
|
+
button component.
|
64
|
+
2. There is a component helper named after the component that is responsible for rendering the
|
65
|
+
component and taking in arguments to customize the component located in `app/helpers/components`.
|
66
|
+
Ex `app/helpers/components/button.rb` provides the `render_button` helper that accepts arguments
|
67
|
+
such as `variant` which describes the kind of button and passes the classes for that `variant` to
|
68
|
+
the partial.
|
69
|
+
3. When needed there is a stimulus controller for the component that provides the javascript
|
70
|
+
required to make the component interactive. Ex. `app/javascript/controllers/toast_controller.js`
|
71
|
+
provides the javascript for the toast component to display it and then hide it after a certain
|
72
|
+
amount of time.
|
73
|
+
|
74
|
+
This demo application also included examples of how to use the components in
|
75
|
+
`app/views/examples/components`. This is used to create the documentation site that this application
|
76
|
+
provides with examples of teh components rendered.
|
77
|
+
|
78
|
+
For now, this convention should be followed when developing new components.
|
79
|
+
|
80
|
+
## [shadcn-ui](https://ui.shadcn.com)
|
81
|
+
|
82
|
+
These components are based on the components provided by [shadcn/ui](https://ui.shadcn.com). Because
|
83
|
+
`shadcn-ui` is so heavily reliant on Radix and React, these components are most likely not going to
|
84
|
+
be 1:1 copies of the components provided by `shadcn-ui`. However, the goal is to provide the same
|
85
|
+
components with the same API and the same accessibility features. If you are looking for a React
|
86
|
+
component library, I highly recommend checking out [shadcn/ui](https://ui.shadcn.com).
|
87
|
+
|
88
|
+
## License
|
89
|
+
|
90
|
+
Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
task default: :spec
|
9
|
+
|
10
|
+
require_relative "config/application"
|
11
|
+
|
12
|
+
Rails.application.load_tasks
|
File without changes
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*=
|
14
|
+
*= require_self
|
15
|
+
*/
|
16
|
+
.st-accordion {
|
17
|
+
.st-accordion__icon:before {
|
18
|
+
content: "▼";
|
19
|
+
display: inline-block;
|
20
|
+
margin-right: 5px;
|
21
|
+
font-size: 80%;
|
22
|
+
text-decoration: none;
|
23
|
+
transform: rotate(-90deg);
|
24
|
+
}
|
25
|
+
.st-accordion__icon--opened:before {
|
26
|
+
transform: rotate(0deg);
|
27
|
+
}
|
28
|
+
|
29
|
+
.st-accordion__content:not(.st-accordion__content--visible) {
|
30
|
+
height: 0;
|
31
|
+
opacity: 0;
|
32
|
+
visibility: hidden;
|
33
|
+
overflow: hidden;
|
34
|
+
transition: all 0.2s;
|
35
|
+
}
|
36
|
+
.st-accordion__content.st-accordion__content--visible {
|
37
|
+
opacity: 1;
|
38
|
+
visibility: visible;
|
39
|
+
overflow: hidden;
|
40
|
+
transition: all 0.2s;
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
@tailwind base;
|
2
|
+
@tailwind components;
|
3
|
+
@tailwind utilities;
|
4
|
+
|
5
|
+
@layer base {
|
6
|
+
:root {
|
7
|
+
--font-sans: "Inter var";
|
8
|
+
--background: 0 0% 100%;
|
9
|
+
--foreground: 222.2 47.4% 11.2%;
|
10
|
+
|
11
|
+
--muted: 210 40% 96.1%;
|
12
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
13
|
+
|
14
|
+
--popover: 0 0% 100%;
|
15
|
+
--popover-foreground: 222.2 47.4% 11.2%;
|
16
|
+
|
17
|
+
--border: 214.3 31.8% 91.4%;
|
18
|
+
--input: 214.3 31.8% 91.4%;
|
19
|
+
|
20
|
+
--card: 0 0% 100%;
|
21
|
+
--card-foreground: 222.2 47.4% 11.2%;
|
22
|
+
|
23
|
+
--primary: 222.2 47.4% 11.2%;
|
24
|
+
--primary-foreground: 210 40% 98%;
|
25
|
+
|
26
|
+
--secondary: 210 40% 96.1%;
|
27
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
28
|
+
|
29
|
+
--accent: 210 40% 96.1%;
|
30
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
31
|
+
|
32
|
+
--destructive: 0 100% 50%;
|
33
|
+
--destructive-foreground: 210 40% 98%;
|
34
|
+
|
35
|
+
--ring: 215 20.2% 65.1%;
|
36
|
+
|
37
|
+
--radius: 0.5rem;
|
38
|
+
}
|
39
|
+
|
40
|
+
.dark {
|
41
|
+
--background: 224 71% 4%;
|
42
|
+
--foreground: 213 31% 91%;
|
43
|
+
|
44
|
+
--muted: 223 47% 11%;
|
45
|
+
--muted-foreground: 215.4 16.3% 56.9%;
|
46
|
+
|
47
|
+
--accent: 216 34% 17%;
|
48
|
+
--accent-foreground: 210 40% 98%;
|
49
|
+
|
50
|
+
--popover: 224 71% 4%;
|
51
|
+
--popover-foreground: 215 20.2% 65.1%;
|
52
|
+
|
53
|
+
--border: 216 34% 17%;
|
54
|
+
--input: 216 34% 17%;
|
55
|
+
|
56
|
+
--card: 224 71% 4%;
|
57
|
+
--card-foreground: 213 31% 91%;
|
58
|
+
|
59
|
+
--primary: 210 40% 98%;
|
60
|
+
--primary-foreground: 222.2 47.4% 1.2%;
|
61
|
+
|
62
|
+
--secondary: 222.2 47.4% 11.2%;
|
63
|
+
--secondary-foreground: 210 40% 98%;
|
64
|
+
|
65
|
+
--destructive: 0 63% 31%;
|
66
|
+
--destructive-foreground: 210 40% 98%;
|
67
|
+
|
68
|
+
--ring: 216 34% 17%;
|
69
|
+
|
70
|
+
--radius: 0.5rem;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
@layer base {
|
75
|
+
* {
|
76
|
+
@apply border-border;
|
77
|
+
}
|
78
|
+
body {
|
79
|
+
@apply bg-background text-foreground;
|
80
|
+
font-feature-settings:
|
81
|
+
"rlig" 1,
|
82
|
+
"calt" 1;
|
83
|
+
}
|
84
|
+
|
85
|
+
.code-sample {
|
86
|
+
@apply max-h-[650px] overflow-x-auto rounded-lg border bg-zinc-950 dark:bg-zinc-900;
|
87
|
+
}
|
88
|
+
|
89
|
+
.code-sample span {
|
90
|
+
@apply bg-zinc-950;
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
/* Lambda Studio — Whiteout */
|
2
|
+
.hljs .language-xml {
|
3
|
+
color: rgba(255, 255, 255, 0.533);
|
4
|
+
}
|
5
|
+
.hljs {
|
6
|
+
background: #000;
|
7
|
+
color: #fff;
|
8
|
+
}
|
9
|
+
|
10
|
+
.hljs-link {
|
11
|
+
color: #ca8a0488;
|
12
|
+
}
|
13
|
+
|
14
|
+
.hljs-attribute,
|
15
|
+
.hljs-built_in,
|
16
|
+
.hljs-keyword,
|
17
|
+
.hljs-meta,
|
18
|
+
.hljs-meta-keyword,
|
19
|
+
.hljs-name,
|
20
|
+
.hljs-selector-tag {
|
21
|
+
color: rgba(255, 255, 255, 0.533);
|
22
|
+
}
|
23
|
+
|
24
|
+
.hljs-string,
|
25
|
+
.hljs-symbol {
|
26
|
+
color: rgba(255, 255, 255, 0.533);
|
27
|
+
}
|
28
|
+
|
29
|
+
.hljs-bullet,
|
30
|
+
.hljs-code,
|
31
|
+
.hljs-formula,
|
32
|
+
.hljs-number,
|
33
|
+
.hljs-params,
|
34
|
+
.hljs-regexp,
|
35
|
+
.hljs-tag,
|
36
|
+
.hljs-variable {
|
37
|
+
color: rgba(255, 255, 255, 0.533);
|
38
|
+
}
|
39
|
+
|
40
|
+
.hljs-class .hljs-title {
|
41
|
+
color: rgba(255, 255, 255, 0.533);
|
42
|
+
}
|
43
|
+
|
44
|
+
.hljs-doctag,
|
45
|
+
.hljs-meta-string,
|
46
|
+
.hljs-selector-id,
|
47
|
+
.hljs-selector-class,
|
48
|
+
.hljs-type,
|
49
|
+
.hljs-variable.language {
|
50
|
+
color: #fff;
|
51
|
+
font-weight: bold;
|
52
|
+
}
|
53
|
+
|
54
|
+
.hljs-comment,
|
55
|
+
.hljs-deletion,
|
56
|
+
.hljs-doctype,
|
57
|
+
.hljs-literal,
|
58
|
+
.hljs-punctuation,
|
59
|
+
.hljs-section,
|
60
|
+
.hljs-selector-pseudo {
|
61
|
+
color: rgba(255, 255, 255, 0.533);
|
62
|
+
}
|
63
|
+
|
64
|
+
.hljs-addition,
|
65
|
+
.hljs-annotation,
|
66
|
+
.hljs-attribute,
|
67
|
+
.hljs-cdata,
|
68
|
+
.hljs-decorator,
|
69
|
+
.hljs-emphasis,
|
70
|
+
.hljs-name,
|
71
|
+
.hljs-strong,
|
72
|
+
.hljs-type,
|
73
|
+
.hljs-quote,
|
74
|
+
.hljs-template-tag,
|
75
|
+
.hljs-template-variable,
|
76
|
+
.hljs-link {
|
77
|
+
color: #fff;
|
78
|
+
}
|
79
|
+
|
80
|
+
.hljs-meta-string,
|
81
|
+
.hljs-selector-id,
|
82
|
+
.hljs-selector-class,
|
83
|
+
.hljs-selector-attr,
|
84
|
+
.hljs-selector-pseudo {
|
85
|
+
color: #fff;
|
86
|
+
font-weight: bold;
|
87
|
+
}
|
88
|
+
|
89
|
+
.hljs-built_in,
|
90
|
+
.hljs-built_in-name,
|
91
|
+
.hljs-builtin-name,
|
92
|
+
.hljs-keyword {
|
93
|
+
color: rgba(255, 255, 255, 0.533);
|
94
|
+
}
|
95
|
+
|
96
|
+
.hljs-section,
|
97
|
+
.hljs-selector-tag,
|
98
|
+
.hljs-title {
|
99
|
+
color: #fff;
|
100
|
+
font-weight: bold;
|
101
|
+
}
|
102
|
+
|
103
|
+
.hljs-subst,
|
104
|
+
.hljs-variable,
|
105
|
+
.hljs-template-variable,
|
106
|
+
.hljs-attr,
|
107
|
+
.hljs-symbol,
|
108
|
+
.hljs-bullet {
|
109
|
+
color: #fff;
|
110
|
+
}
|
111
|
+
|
112
|
+
.hljs-function .hljs-keyword,
|
113
|
+
.hljs-function .hljs-title {
|
114
|
+
color: #fff;
|
115
|
+
font-weight: bold;
|
116
|
+
}
|
117
|
+
|
118
|
+
.hljs-doctag,
|
119
|
+
.hljs-meta .hljs-meta-keyword,
|
120
|
+
.hljs-template-tag,
|
121
|
+
.hljs-template-variable,
|
122
|
+
.hljs-link {
|
123
|
+
color: #fff;
|
124
|
+
}
|
125
|
+
|
126
|
+
.hljs-comment,
|
127
|
+
.hljs-quote,
|
128
|
+
.hljs-selector-pseudo,
|
129
|
+
.hljs-selector-comment,
|
130
|
+
.hljs-meta .hljs-meta-string {
|
131
|
+
color: rgba(255, 255, 255, 0.533);
|
132
|
+
}
|
133
|
+
|
134
|
+
.language-ruby .hljs-keyword {
|
135
|
+
color: #fff;
|
136
|
+
}
|
File without changes
|