ariadne_view_components 0.0.10-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +49 -0
- data/README.md +73 -0
- data/app/assets/config/manifest.js +2 -0
- data/app/assets/javascripts/ariadne-form-with.d.ts +20 -0
- data/app/assets/javascripts/ariadne-form.d.ts +22 -0
- data/app/assets/javascripts/ariadne.d.ts +1 -0
- data/app/assets/javascripts/ariadne_view_components.js +8 -0
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -0
- data/app/assets/javascripts/clipboard-copy-component.d.ts +4 -0
- data/app/assets/javascripts/comment-component.d.ts +13 -0
- data/app/assets/javascripts/rich-text-area-component.d.ts +4 -0
- data/app/assets/javascripts/slideover-component.d.ts +9 -0
- data/app/assets/javascripts/time-ago-component.d.ts +1 -0
- data/app/assets/javascripts/time_ago_component.d.ts +1 -0
- data/app/assets/javascripts/tooltip-component.d.ts +24 -0
- data/app/assets/stylesheets/ariadne_view_components.css +6 -0
- data/app/assets/stylesheets/prosemirror.css +323 -0
- data/app/assets/stylesheets/tooltip-component.css +37 -0
- data/app/components/ariadne/ariadne-form.ts +96 -0
- data/app/components/ariadne/ariadne.ts +20 -0
- data/app/components/ariadne/base_button.rb +61 -0
- data/app/components/ariadne/base_component.rb +37 -0
- data/app/components/ariadne/blankslate_component.html.erb +26 -0
- data/app/components/ariadne/blankslate_component.rb +146 -0
- data/app/components/ariadne/body_component.rb +30 -0
- data/app/components/ariadne/button_component.html.erb +4 -0
- data/app/components/ariadne/button_component.rb +157 -0
- data/app/components/ariadne/clipboard-copy-component.ts +19 -0
- data/app/components/ariadne/clipboard_copy_component.html.erb +9 -0
- data/app/components/ariadne/clipboard_copy_component.rb +90 -0
- data/app/components/ariadne/comment-component.ts +55 -0
- data/app/components/ariadne/comment_component.html.erb +22 -0
- data/app/components/ariadne/comment_component.rb +57 -0
- data/app/components/ariadne/component.rb +128 -0
- data/app/components/ariadne/container_component.html.erb +3 -0
- data/app/components/ariadne/container_component.rb +25 -0
- data/app/components/ariadne/content.rb +12 -0
- data/app/components/ariadne/counter_component.rb +100 -0
- data/app/components/ariadne/flash_component.html.erb +31 -0
- data/app/components/ariadne/flash_component.rb +125 -0
- data/app/components/ariadne/flex_component.rb +49 -0
- data/app/components/ariadne/footer_component.html.erb +7 -0
- data/app/components/ariadne/footer_component.rb +23 -0
- data/app/components/ariadne/grid_component.html.erb +26 -0
- data/app/components/ariadne/grid_component.rb +66 -0
- data/app/components/ariadne/header_component.html.erb +29 -0
- data/app/components/ariadne/header_component.rb +114 -0
- data/app/components/ariadne/heading_component.rb +49 -0
- data/app/components/ariadne/heroicon_component.html.erb +4 -0
- data/app/components/ariadne/heroicon_component.rb +129 -0
- data/app/components/ariadne/image_component.rb +53 -0
- data/app/components/ariadne/inline_flex_component.html.erb +5 -0
- data/app/components/ariadne/inline_flex_component.rb +65 -0
- data/app/components/ariadne/link_component.rb +65 -0
- data/app/components/ariadne/list_component.html.erb +15 -0
- data/app/components/ariadne/list_component.rb +68 -0
- data/app/components/ariadne/main_component.rb +32 -0
- data/app/components/ariadne/narrow_container_component.html.erb +3 -0
- data/app/components/ariadne/narrow_container_component.rb +30 -0
- data/app/components/ariadne/panel_bar_component.html.erb +20 -0
- data/app/components/ariadne/panel_bar_component.rb +79 -0
- data/app/components/ariadne/pill_component.html.erb +3 -0
- data/app/components/ariadne/pill_component.rb +30 -0
- data/app/components/ariadne/rich-text-area-component.ts +32 -0
- data/app/components/ariadne/rich_text_area_component.html.erb +6 -0
- data/app/components/ariadne/rich_text_area_component.rb +35 -0
- data/app/components/ariadne/slideover-component.ts +26 -0
- data/app/components/ariadne/slideover_component.html.erb +11 -0
- data/app/components/ariadne/slideover_component.rb +81 -0
- data/app/components/ariadne/tab_bar_component.html.erb +3 -0
- data/app/components/ariadne/tab_bar_component.rb +45 -0
- data/app/components/ariadne/tab_component.html.erb +7 -0
- data/app/components/ariadne/tab_component.rb +43 -0
- data/app/components/ariadne/text.rb +25 -0
- data/app/components/ariadne/time-ago-component.ts +1 -0
- data/app/components/ariadne/time_ago_component.rb +56 -0
- data/app/components/ariadne/timeline_component.html.erb +19 -0
- data/app/components/ariadne/timeline_component.rb +34 -0
- data/app/components/ariadne/tooltip-component.ts +57 -0
- data/app/components/ariadne/tooltip_component.html.erb +4 -0
- data/app/components/ariadne/tooltip_component.rb +108 -0
- data/app/lib/ariadne/action_view_extensions/form_helper.rb +26 -0
- data/app/lib/ariadne/audited/dsl.rb +32 -0
- data/app/lib/ariadne/class_name_helper.rb +22 -0
- data/app/lib/ariadne/fetch_or_fallback_helper.rb +102 -0
- data/app/lib/ariadne/form_builder.rb +71 -0
- data/app/lib/ariadne/icon_helper.rb +47 -0
- data/app/lib/ariadne/join_style_arguments_helper.rb +14 -0
- data/app/lib/ariadne/logger_helper.rb +23 -0
- data/app/lib/ariadne/status/dsl.rb +41 -0
- data/app/lib/ariadne/tab_nav_helper.rb +35 -0
- data/app/lib/ariadne/tabbed_component_helper.rb +39 -0
- data/app/lib/ariadne/test_selector_helper.rb +20 -0
- data/app/lib/ariadne/underline_nav_helper.rb +44 -0
- data/app/lib/ariadne/view_helper.rb +22 -0
- data/exe/tailwindcss +21 -0
- data/exe/x64-mingw32/tailwindcss +0 -0
- data/lib/ariadne/view_components/commands.rb +90 -0
- data/lib/ariadne/view_components/constants.rb +53 -0
- data/lib/ariadne/view_components/engine.rb +75 -0
- data/lib/ariadne/view_components/linters.rb +3 -0
- data/lib/ariadne/view_components/statuses.rb +14 -0
- data/lib/ariadne/view_components/upstream.rb +20 -0
- data/lib/ariadne/view_components/version.rb +7 -0
- data/lib/ariadne/view_components.rb +61 -0
- data/lib/rubocop/config/default.yml +8 -0
- data/lib/rubocop/cop/ariadne/base_cop.rb +26 -0
- data/lib/rubocop/cop/ariadne/no_tag_memoize.rb +44 -0
- data/lib/rubocop/cop/ariadne.rb +3 -0
- data/lib/tasks/ariadne_view_components.rake +48 -0
- data/lib/tasks/build.rake +30 -0
- data/lib/tasks/coverage.rake +19 -0
- data/lib/tasks/custom_utilities.yml +310 -0
- data/lib/tasks/docs.rake +524 -0
- data/lib/tasks/helpers/ast_processor.rb +44 -0
- data/lib/tasks/helpers/ast_traverser.rb +77 -0
- data/lib/tasks/static.rake +15 -0
- data/lib/yard/docs_helper.rb +83 -0
- data/lib/yard/renders_many_handler.rb +19 -0
- data/lib/yard/renders_one_handler.rb +19 -0
- data/static/arguments.yml +619 -0
- data/static/assets/view-components.svg +18 -0
- data/static/audited_at.json +38 -0
- data/static/classes.yml +291 -0
- data/static/constants.json +426 -0
- data/static/statuses.json +38 -0
- data/static/tailwindcss.yml +727 -0
- data/tailwind.config.js +65 -0
- metadata +264 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee2c792edaa841a4da3128a4918c34cc21e9a562f022cebe197d42a9b862f8f9
|
4
|
+
data.tar.gz: 23510dcc25450942503066fb86edcf9c5c3b5c594a1131239746c6de6e5604ff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d023efbf0f73b16e40e6a26f0e55bb86fb5f59c299e827194414dd6e1f9f6b3baa70f1f571fbc1eaef447ed58ac224c7c2de8c9702b4c74915fb628ad56af553
|
7
|
+
data.tar.gz: 5b549f4680a58e3be895f51adfe6bd27d66f70be16737bd17b20dfea277de049a233ddc3d24d1594245671edc587eaabf2b38885d8fc35264424f0f8b0fc718c
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Yetto
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
22
|
+
|
23
|
+
ariadne_view_components may redistribute executables from the https://github.com/tailwindlabs/tailwindcss project
|
24
|
+
|
25
|
+
The license for that software can be found at https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE
|
26
|
+
and is reproduced here for your convenience:
|
27
|
+
|
28
|
+
MIT License
|
29
|
+
|
30
|
+
Copyright (c) Adam Wathan <adam.wathan@gmail.com>
|
31
|
+
Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
|
32
|
+
|
33
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
34
|
+
of this software and associated documentation files (the "Software"), to deal
|
35
|
+
in the Software without restriction, including without limitation the rights
|
36
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
37
|
+
copies of the Software, and to permit persons to whom the Software is
|
38
|
+
furnished to do so, subject to the following conditions:
|
39
|
+
|
40
|
+
The above copyright notice and this permission notice shall be included in all
|
41
|
+
copies or substantial portions of the Software.
|
42
|
+
|
43
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
44
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
45
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
46
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
47
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
48
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
49
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# ViewComponents
|
2
|
+
|
3
|
+
This repository contains the Ruby view components for the Ariadne design system. It is composed of several projects:
|
4
|
+
|
5
|
+
* [Tailwind CSS](https://tailwindcss.com)
|
6
|
+
* [Heroicons](https://heroicons.com)
|
7
|
+
* [ViewComponents](https://viewcomponent.org)
|
8
|
+
* [StimulusJS](https://stimulus.hotwired.dev)
|
9
|
+
|
10
|
+
This project is basically a fork and rewrite of [Primer's ViewComponents](https://primer.style/view-components/), except instead of Primer, it uses an open source stack we've found useful. **Our eternal gratitude to GitHub's design team for open sourcing that repo.**
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Like [tailwindcss-rails](https://github.com/rails/tailwindcss-rails), this gem also wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v3 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform. Supported platforms are Linux x64, macOS arm64, macOS x64, and Windows x64. (Note that due to this setup, you must install the actual gems – you can't pin your gem to the GitHub repo.)
|
15
|
+
|
16
|
+
## Using the gem
|
17
|
+
|
18
|
+
todo, lol
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
<%= render(Ariadne::HeadingComponent.new(tag: :h1)) { "H1 Text" } %>
|
22
|
+
```
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
DEFAULT_TAG = :div
|
26
|
+
DEFAULT_CLASSES = "bg-yellow-400"
|
27
|
+
def initialize(tag: DEFAULT_TAG, classes: "", attributes: {})
|
28
|
+
@tag = check_incoming_tag(DEFAULT_TAG, tag)
|
29
|
+
@classes = class_names(DEFAULT_CLASSES, classes)
|
30
|
+
@attributes = attributes
|
31
|
+
@attributes[:id] = "myId"
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
document schemes, fetch_or_raise, all that
|
36
|
+
|
37
|
+
### Incorporating Rubocop and other linters
|
38
|
+
|
39
|
+
This gem comes with some standard linters to keep your code fresh and consistent. Refer to [the documentation](./docs/content/linting.md) for more information.
|
40
|
+
|
41
|
+
## Getting started with development
|
42
|
+
|
43
|
+
So, you just cloned the repo, huh? Great. In addition to Ruby 3.x, install [Overmind](https://github.com/DarthSim/overmind) and Node/NPM. Then, run the following script to set up your local environment:
|
44
|
+
|
45
|
+
```
|
46
|
+
script/setup
|
47
|
+
```
|
48
|
+
|
49
|
+
This will install all the necessary dependencies, plus get you ready for viewing the components and generating the documentation.
|
50
|
+
|
51
|
+
If you then run `script/server`, this will build and run both the documentation site and launch Lookbook.
|
52
|
+
|
53
|
+
### Adding new components
|
54
|
+
|
55
|
+
See [the documentation on adding new components](./docs/content/adding_components.md).
|
56
|
+
|
57
|
+
### Running tests
|
58
|
+
|
59
|
+
See [the documentation on testing](./docs/content/testing.md).
|
60
|
+
|
61
|
+
### Generating Documentation and Lookbook
|
62
|
+
|
63
|
+
Run `script/docs` to get a build of the documentation running at `localhost:5400`. The documentation comes from the YARD comments, and all of the markdowns files in `./docs`. You can define the TOC navigation in `docs/src/@primer/gatsby-theme-doctocat/nav.yml`.
|
64
|
+
|
65
|
+
You can generate and view a [Lookbook](https://github.com/allmarkedup/lookbook) site via the `script/lookbook` command.
|
66
|
+
|
67
|
+
For more information on writing documentation and presenting the components via Loobook, [here's more information](./docs/content/documentation.md)
|
68
|
+
|
69
|
+
### Publishing a Release
|
70
|
+
|
71
|
+
To publish a release, you must have an account on [rubygems](https://rubygems.org/) and [npmjs](https://www.npmjs.com/). Additionally, you must have been added as a maintainer to the project. Please verify that you have 2FA enabled on both accounts.
|
72
|
+
|
73
|
+
1. Once the changesets release PR has been approved and merged, run `script/publish`. This will build and publish the packages. You may be prompted to log into your rubygem and npm account.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Controller } from '@hotwired/stimulus';
|
2
|
+
import { TemplateResult } from 'lit-html';
|
3
|
+
declare type HTMLFormField = HTMLInputElement | HTMLButtonElement | HTMLSelectElement | HTMLTextAreaElement;
|
4
|
+
export default class AriadneFormWith extends Controller {
|
5
|
+
connect(): void;
|
6
|
+
disconnect(): void;
|
7
|
+
onBlur: (event: Event) => void;
|
8
|
+
onSubmit: (event: Event) => void;
|
9
|
+
validateForm(): boolean;
|
10
|
+
validateField(field: HTMLFormField): boolean;
|
11
|
+
shouldValidateField(field: HTMLFormField): boolean;
|
12
|
+
refreshErrorForInvalidField(field: HTMLFormField, isValid: boolean): void;
|
13
|
+
removeExistingErrorMessage(field: HTMLFormField): void;
|
14
|
+
showErrorForInvalidField(field: HTMLFormField): void;
|
15
|
+
buildFieldErrorHtml(field: HTMLFormField): string;
|
16
|
+
get formFields(): HTMLFormField[];
|
17
|
+
get firstInvalidField(): HTMLFormField | undefined;
|
18
|
+
getRenderString: (data: TemplateResult) => string;
|
19
|
+
}
|
20
|
+
export {};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Controller } from '@hotwired/stimulus';
|
2
|
+
import type { TemplateResult } from 'lit-html';
|
3
|
+
declare type HTMLFormField = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
4
|
+
export default class AriadneFormWith extends Controller {
|
5
|
+
static targets: string[];
|
6
|
+
readonly formFieldTargets: [HTMLFormField];
|
7
|
+
connect(): void;
|
8
|
+
disconnect(): void;
|
9
|
+
onBlur: (event: Event) => void;
|
10
|
+
onSubmit: (event: Event) => void;
|
11
|
+
validateForm(): boolean;
|
12
|
+
validateField(field: HTMLFormField): boolean;
|
13
|
+
shouldValidateField(field: HTMLFormField): boolean;
|
14
|
+
refreshErrorForInvalidField(field: HTMLFormField, isValid: boolean): void;
|
15
|
+
removeExistingErrorMessage(field: HTMLFormField): void;
|
16
|
+
showErrorForInvalidField(field: HTMLFormField): void;
|
17
|
+
buildFieldErrorHtml(field: HTMLFormField): string;
|
18
|
+
get formFields(): HTMLFormField[];
|
19
|
+
get firstInvalidField(): HTMLFormField | undefined;
|
20
|
+
getRenderString: (data: TemplateResult) => string;
|
21
|
+
}
|
22
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
import './time-ago-component';
|