@uqds/form 0.0.7-alpha.0 → 0.0.8-alpha.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 +26 -26
- package/dist/css/main.css +1 -1
- package/package.json +4 -4
- package/src/images/form-checkbox-check.svg +3 -3
- package/src/images/form-chevron-down.svg +3 -3
- package/src/scss/_component.scss +505 -505
- package/src/scss/_global.scss +28 -28
- package/src/scss/_icons.scss +33 -33
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# @uqds/form
|
|
2
|
-
|
|
3
|
-
> Styles for HTML form elements and form validation.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
### Installation
|
|
8
|
-
|
|
9
|
-
With Yarn:
|
|
10
|
-
```shell
|
|
11
|
-
yarn add @uqds/form
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
With NPM:
|
|
15
|
-
```shell
|
|
16
|
-
npm i @uqds/form
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Dependencies
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
@uqds/form
|
|
25
|
-
└─ @uqds/core
|
|
26
|
-
```
|
|
1
|
+
# @uqds/form
|
|
2
|
+
|
|
3
|
+
> Styles for HTML form elements and form validation.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
With Yarn:
|
|
10
|
+
```shell
|
|
11
|
+
yarn add @uqds/form
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
With NPM:
|
|
15
|
+
```shell
|
|
16
|
+
npm i @uqds/form
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Dependencies
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
@uqds/form
|
|
25
|
+
└─ @uqds/core
|
|
26
|
+
```
|
package/dist/css/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
form,fieldset,legend,label,input,select,textarea,.uq-error-summary,.uq-error-message,.uq-success-message,.uq-inline-help{box-sizing:border-box;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}fieldset::before,fieldset::after,fieldset *,fieldset *::before,fieldset *::after,legend::before,legend::after,legend *,legend *::before,legend *::after,label::before,label::after,label *,label *::before,label *::after,input::before,input::after,input *,input *::before,input *::after,select::before,select::after,select *,select *::before,select *::after,textarea::before,textarea::after,textarea *,textarea *::before,textarea *::after{box-sizing:border-box}fieldset{border:0;padding:0;margin:0}label,legend{color:#2b2a29;display:block;font-size:.875rem;font-weight:500}legend{margin-bottom:1rem;line-height:1.4;padding:0}legend.uq-legend--error{color:#951126}legend .uq-legend__required{color:#951126}label{cursor:pointer;line-height:1}label.uq-label--inline{align-items:center;display:inline-flex;font-size:1rem;line-height:1.5;margin-bottom:1.5rem}label.uq-label--inline input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline select,label.uq-label--inline textarea,label.uq-label--inline+input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline+select,label.uq-label--inline+textarea{max-width:none;min-width:200px;margin-left:1rem;margin-right:1.5rem;width:auto}label.uq-label--inline input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline select,label.uq-label--inline textarea{margin-top:0;margin-bottom:0}label.uq-label--disabled,label.uq-label--readonly{color:#aca7a3}label.uq-label--disabled{cursor:not-allowed}label.uq-label--error{color:#951126}label.uq-label--success{color:#238029}label input:not([type=checkbox]):not([type=radio]),label select,label textarea,label+input:not([type=checkbox]):not([type=radio]),label+select,label+textarea{margin-top:.5rem}label input[type=radio]+*:not(input):not(select):not(textarea),label input[type=checkbox]+*:not(input):not(select):not(textarea){display:inline-block;font-size:1rem;font-weight:400;line-height:20px;margin-bottom:1rem;margin-left:.5rem;margin-right:1rem;padding-top:.25rem;padding-left:1.5rem;vertical-align:top}label input[type=radio][disabled]+*:not(input):not(select):not(textarea),label input[type=checkbox][disabled]+*:not(input):not(select):not(textarea){color:#aca7a3}label .uq-label__required{color:#951126}input[disabled],select[disabled],textarea[disabled]{cursor:not-allowed}input:not([type=checkbox]):not([type=radio]):not([type=submit]),select,textarea{background-color:#fff;max-width:100%;min-width:100%;padding:.75rem 1rem;border:1px solid #e7e3e0;border-radius:2px;font-size:1rem;color:#2b2a29;line-height:1;margin-bottom:1.5rem}input:not([type=checkbox]):not([type=radio]):not([type=submit]):focus,select:focus,textarea:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6 inset;outline:none}input:not([type=checkbox]):not([type=radio]):not([type=submit])[disabled],select[disabled],textarea[disabled]{color:#817d7a}input:not([type=checkbox]):not([type=radio]):not([type=submit])[readonly]:focus,select[readonly]:focus,textarea[readonly]:focus{border-color:#e7e3e0;box-shadow:0 0 0 1px #e7e3e0 inset}input:not([type=checkbox]):not([type=radio]):not([type=submit])::placeholder,select::placeholder,textarea::placeholder{color:#817d7a}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error,input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success,select.uq-input--error,select.uq-input--success,textarea.uq-input--error,textarea.uq-input--success{border-radius:2px}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error:focus,input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success:focus,select.uq-input--error:focus,select.uq-input--success:focus,textarea.uq-input--error:focus,textarea.uq-input--success:focus{border-color:#1e72c6;box-shadow:0 2px 0 0 #1e72c6,0 0 0 1px #1e72c6 inset}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error,select.uq-input--error,textarea.uq-input--error{border-color:#951126;box-shadow:0 2px 0 0 #951126}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success,select.uq-input--success,textarea.uq-input--success{border-color:#238029;box-shadow:0 2px 0 0 #238029}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--large,select.uq-input--large,textarea.uq-input--large{padding:1.15625rem 1.5rem;border-radius:.25rem}input:not([type=checkbox]):not([type=radio]):not([type=submit])+.uq-error-message,input:not([type=checkbox]):not([type=radio]):not([type=submit])+.uq-success-message,select+.uq-error-message,select+.uq-success-message,textarea+.uq-error-message,textarea+.uq-success-message{margin-top:-1.5rem;border-radius:0 0 2px 2px}select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%2351247A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .25rem center;padding-right:2.5rem;cursor:pointer;line-height:1.2;width:100%}select:focus{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%231E72C6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}select[multiple]{height:auto;background-image:none}select[multiple]:focus{background-image:none}select[disabled]{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%23e7e3e0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}textarea{height:10rem}input[type=radio],input[type=checkbox]{appearance:none;-webkit-appearance:none;display:inline-block;border:1px solid #e7e3e0;cursor:pointer;height:20px;width:20px;vertical-align:top;position:absolute}input[type=radio]:focus,input[type=checkbox]:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6;outline:none}input[type=radio]+label,input[type=checkbox]+label{display:inline-block;font-size:1rem;font-weight:400;line-height:1.4;margin-bottom:1rem;margin-left:.5rem;margin-right:1rem;padding-top:.125rem;padding-left:1.5rem;vertical-align:top}input[type=radio]:checked,input[type=checkbox]:checked{border-color:#1e72c6}input[type=radio]:checked:focus,input[type=checkbox]:checked:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio].uq-input--error,input[type=checkbox].uq-input--error{border-color:#951126}input[type=radio].uq-input--error:focus,input[type=checkbox].uq-input--error:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio].uq-input--error:checked,input[type=checkbox].uq-input--error:checked{border-color:#951126}input[type=radio].uq-input--error:checked:focus,input[type=checkbox].uq-input--error:checked:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio][disabled],input[type=checkbox][disabled]{cursor:not-allowed;border-color:#e7e3e0;background-color:#f7f6f5}input[type=radio][disabled]+label,input[type=checkbox][disabled]+label{color:#aca7a3}input[type=radio][disabled]:checked,input[type=checkbox][disabled]:checked{background-color:#dfdad6}input[type=checkbox]{border-radius:4px}input[type=checkbox]::after{content:"";display:block;position:absolute;background-repeat:no-repeat;background-position:center center;top:1px;left:1px;height:16px;width:16px}input[type=checkbox]:checked{background-color:#1e72c6}input[type=checkbox]:checked::after{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5 13.3 8.9 18 19 6' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");padding:0px}input[type=checkbox].uq-input--error:checked{background-color:#951126}input[type=radio]{border-radius:50%}input[type=radio]:checked{border-width:2px}input[type=radio]:checked::after{border-radius:50%;background-color:#1e72c6;content:"";display:block;position:absolute;top:3px;left:3px;height:10px;width:10px}input[type=radio][disabled]:checked{background-color:#f7f6f5}input[type=radio][disabled]:checked::after{background-color:#dfdad6}input[type=radio].uq-input--error:checked{border-color:#951126}input[type=radio].uq-input--error:checked::after{background-color:#951126}[type=submit]{appearance:none}.uq-error-summary{background-color:#fff;border:1px solid #951126;border-left-width:.25rem;padding:1rem;margin-bottom:1.5rem}.uq-error-summary__title{color:#2b2a29;font-size:1.125rem;font-weight:500;line-height:1.4;margin:0 0 1rem 0}.uq-error-summary_body{color:#2b2a29;font-size:1rem}.uq-error-summary__list{color:#2b2a29;font-size:1rem;margin:0}.uq-error-summary__list__item{margin-bottom:.25rem;line-height:1.5}.uq-error-summary__list a{color:#951126;text-decoration:underline;font-weight:400}.uq-error-summary__list a:hover,.uq-error-summary__list a:focus{color:#7e0f21}.uq-error-message,.uq-success-message{color:#fff;display:block;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5;margin-bottom:1.5rem;padding:calc(0.5rem - 1px) 1rem .5rem 3rem;position:relative}.uq-error-message::before,.uq-success-message::before{content:"";display:block;background-position:center;background-repeat:no-repeat;background-size:contain;height:1.25rem;left:1rem;margin-right:.5rem;margin-top:calc(-0.625rem - 1px);position:absolute;top:50%;width:1.25rem}.uq-error-message{background-color:#951126}.uq-error-message::before{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cg stroke='%23fff' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M8 11.77c-.113 0-.2.085-.2.203 0 .113.087.199.2.199.113 0 .2-.086.2-.2a.196.196 0 0 0-.2-.202zm0 0'%3e%3c/path%3e%3cpath d='M8 10.086V5.914m.914-3.629c-.258-.515-.855-.715-1.344-.457a.9.9 0 0 0-.457.457L1.801 13.06a.853.853 0 0 0 .398 1.14.77.77 0 0 0 .371.086h10.86a.858.858 0 0 0 .77-1.226zm0 0' fill='none'%3e%3c/path%3e%3c/g%3e%3c/svg%3e")}.uq-success-message{background-color:#238029}.uq-success-message::before{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 56 56' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m16.267 30.394 4.79 6.8a2.051 2.051 0 0 0 3.339.099l15.337-19.405' stroke='%23fff' stroke-width='2.66' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3cpath d='M6 28a22 22 0 1 0 44 0 22 22 0 0 0-44 0v0Z' stroke='%23fff' stroke-width='2.66' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}.uq-inline-help{display:block;font-size:.75rem;margin:0 0 1rem}
|
|
1
|
+
form,fieldset,legend,label,input,select,textarea,.uq-error-summary,.uq-error-message,.uq-success-message,.uq-inline-help{box-sizing:border-box;font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}fieldset::before,fieldset::after,fieldset *,fieldset *::before,fieldset *::after,legend::before,legend::after,legend *,legend *::before,legend *::after,label::before,label::after,label *,label *::before,label *::after,input::before,input::after,input *,input *::before,input *::after,select::before,select::after,select *,select *::before,select *::after,textarea::before,textarea::after,textarea *,textarea *::before,textarea *::after{box-sizing:border-box}fieldset{border:0;padding:0;margin:0}label,legend{color:#2b2a29;display:block;font-size:.875rem;font-weight:500}legend{margin-bottom:1rem;line-height:1.4;padding:0}legend.uq-legend--error{color:#951126}legend .uq-legend__required{color:#951126}label{cursor:pointer;line-height:1}label.uq-label--inline{align-items:center;display:inline-flex;font-size:1rem;line-height:1.5;margin-bottom:1.5rem}label.uq-label--inline input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline select,label.uq-label--inline textarea,label.uq-label--inline+input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline+select,label.uq-label--inline+textarea{max-width:none;min-width:200px;margin-left:1rem;margin-right:1.5rem;width:auto}label.uq-label--inline input:not([type=checkbox]):not([type=radio]):not([type=submit]),label.uq-label--inline select,label.uq-label--inline textarea{margin-top:0;margin-bottom:0}label.uq-label--disabled,label.uq-label--readonly{color:#aca7a3}label.uq-label--disabled{cursor:not-allowed}label.uq-label--error{color:#951126}label.uq-label--success{color:#238029}label input:not([type=checkbox]):not([type=radio]),label select,label textarea,label+input:not([type=checkbox]):not([type=radio]),label+select,label+textarea{margin-top:.5rem}label input[type=radio]+*:not(input):not(select):not(textarea),label input[type=checkbox]+*:not(input):not(select):not(textarea){display:inline-block;font-size:1rem;font-weight:400;line-height:20px;margin-bottom:1rem;margin-left:.5rem;margin-right:1rem;padding-top:.25rem;padding-left:1.5rem;vertical-align:top}label input[type=radio][disabled]+*:not(input):not(select):not(textarea),label input[type=checkbox][disabled]+*:not(input):not(select):not(textarea){color:#aca7a3}label .uq-label__required{color:#951126}input[disabled],select[disabled],textarea[disabled]{cursor:not-allowed}input:not([type=checkbox]):not([type=radio]):not([type=submit]),select,textarea{background-color:#fff;max-width:100%;min-width:100%;padding:.75rem 1rem;border:1px solid #e7e3e0;border-radius:2px;font-size:1rem;color:#2b2a29;line-height:1;margin-bottom:1.5rem}input:not([type=checkbox]):not([type=radio]):not([type=submit]):focus,select:focus,textarea:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6 inset;outline:none}input:not([type=checkbox]):not([type=radio]):not([type=submit])[disabled],select[disabled],textarea[disabled]{color:#817d7a}input:not([type=checkbox]):not([type=radio]):not([type=submit])[readonly]:focus,select[readonly]:focus,textarea[readonly]:focus{border-color:#e7e3e0;box-shadow:0 0 0 1px #e7e3e0 inset}input:not([type=checkbox]):not([type=radio]):not([type=submit])::placeholder,select::placeholder,textarea::placeholder{color:#817d7a}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error,input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success,select.uq-input--error,select.uq-input--success,textarea.uq-input--error,textarea.uq-input--success{border-radius:2px}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error:focus,input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success:focus,select.uq-input--error:focus,select.uq-input--success:focus,textarea.uq-input--error:focus,textarea.uq-input--success:focus{border-color:#1e72c6;box-shadow:0 2px 0 0 #1e72c6,0 0 0 1px #1e72c6 inset}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--error,select.uq-input--error,textarea.uq-input--error{border-color:#951126;box-shadow:0 2px 0 0 #951126}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--success,select.uq-input--success,textarea.uq-input--success{border-color:#238029;box-shadow:0 2px 0 0 #238029}input:not([type=checkbox]):not([type=radio]):not([type=submit]).uq-input--large,select.uq-input--large,textarea.uq-input--large{padding:1.15625rem 1.5rem;border-radius:.25rem}input:not([type=checkbox]):not([type=radio]):not([type=submit])+.uq-error-message,input:not([type=checkbox]):not([type=radio]):not([type=submit])+.uq-success-message,select+.uq-error-message,select+.uq-success-message,textarea+.uq-error-message,textarea+.uq-success-message{margin-top:-1.5rem;border-radius:0 0 2px 2px}select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%2351247A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .25rem center;padding-right:2.5rem;cursor:pointer;line-height:1.2;width:100%}select:focus{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%231E72C6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}select[multiple]{height:auto;background-image:none}select[multiple]:focus{background-image:none}select[disabled]{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m7 10 5 5 5-5' stroke='%23e7e3e0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}textarea{height:10rem}input[type=radio],input[type=checkbox]{appearance:none;-webkit-appearance:none;display:inline-block;border:1px solid #e7e3e0;cursor:pointer;height:20px;width:20px;vertical-align:top;position:absolute}input[type=radio]:focus,input[type=checkbox]:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6;outline:none}input[type=radio]+label,input[type=checkbox]+label{display:inline-block;font-size:1rem;font-weight:400;line-height:1.4;margin-bottom:1rem;margin-left:.5rem;margin-right:1rem;padding-top:.125rem;padding-left:1.5rem;vertical-align:top}input[type=radio]:checked,input[type=checkbox]:checked{border-color:#1e72c6}input[type=radio]:checked:focus,input[type=checkbox]:checked:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio].uq-input--error,input[type=checkbox].uq-input--error{border-color:#951126}input[type=radio].uq-input--error:focus,input[type=checkbox].uq-input--error:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio].uq-input--error:checked,input[type=checkbox].uq-input--error:checked{border-color:#951126}input[type=radio].uq-input--error:checked:focus,input[type=checkbox].uq-input--error:checked:focus{border-color:#1e72c6;box-shadow:0 0 0 1px #1e72c6}input[type=radio][disabled],input[type=checkbox][disabled]{cursor:not-allowed;border-color:#e7e3e0;background-color:#f7f6f5}input[type=radio][disabled]+label,input[type=checkbox][disabled]+label{color:#aca7a3}input[type=radio][disabled]:checked,input[type=checkbox][disabled]:checked{background-color:#dfdad6}input[type=checkbox]{border-radius:4px}input[type=checkbox]::after{content:"";display:block;position:absolute;background-repeat:no-repeat;background-position:center center;top:1px;left:1px;height:16px;width:16px}input[type=checkbox]:checked{background-color:#1e72c6}input[type=checkbox]:checked::after{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5 13.3 8.9 18 19 6' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");padding:0px}input[type=checkbox].uq-input--error:checked{background-color:#951126}input[type=radio]{border-radius:50%}input[type=radio]:checked{border-width:2px}input[type=radio]:checked::after{border-radius:50%;background-color:#1e72c6;content:"";display:block;position:absolute;top:3px;left:3px;height:10px;width:10px}input[type=radio][disabled]:checked{background-color:#f7f6f5}input[type=radio][disabled]:checked::after{background-color:#dfdad6}input[type=radio].uq-input--error:checked{border-color:#951126}input[type=radio].uq-input--error:checked::after{background-color:#951126}[type=submit]{appearance:none}.uq-error-summary{background-color:#fff;border:1px solid #951126;border-left-width:.25rem;padding:1rem;margin-bottom:1.5rem}.uq-error-summary__title{color:#2b2a29;font-size:1.125rem;font-weight:500;line-height:1.4;margin:0 0 1rem 0}.uq-error-summary_body{color:#2b2a29;font-size:1rem}.uq-error-summary__list{color:#2b2a29;font-size:1rem;margin:0}.uq-error-summary__list__item{margin-bottom:.25rem;line-height:1.5}.uq-error-summary__list a{color:#951126;text-decoration:underline;font-weight:400}.uq-error-summary__list a:hover,.uq-error-summary__list a:focus{color:#7e0f21}.uq-error-message,.uq-success-message{color:#fff;display:block;font-size:1rem;font-style:normal;font-weight:400;line-height:1.5;margin-bottom:1.5rem;padding:calc(0.5rem - 1px) 1rem .5rem 3rem;position:relative}.uq-error-message::before,.uq-success-message::before{content:"";display:block;background-position:center;background-repeat:no-repeat;background-size:contain;height:1.25rem;left:1rem;margin-right:.5rem;margin-top:calc(-0.625rem - 1px);position:absolute;top:50%;width:1.25rem}.uq-error-message{background-color:#951126}.uq-error-message::before{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M20.127 18.545a1.18 1.18 0 0 1-1.055 1.706H4.929a1.18 1.18 0 0 1-1.055-1.706l7.072-14.143a1.179 1.179 0 0 1 2.109 0l7.072 14.143Z' stroke='%23fff' stroke-width='1.5'%3e%3c/path%3e%3cpath d='M12 9v4' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'%3e%3c/path%3e%3ccircle cx='11.9' cy='16.601' r='1.1' fill='%23fff'%3e%3c/circle%3e%3c/svg%3e")}.uq-success-message{background-color:#238029}.uq-success-message::before{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='12' cy='12' r='9.25' stroke='%23fff' stroke-width='1.5'%3e%3c/circle%3e%3cpath d='M7 12.867 9.6 16l6.733-8' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e")}.uq-inline-help{display:block;font-size:.75rem;margin:0 0 1rem}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uqds/form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-alpha.0",
|
|
4
4
|
"description": "Form element style rules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"uqds",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"url": "https://github.com/uq-its-ss/design-system/issues"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@uqds/core": "^0.0.
|
|
46
|
-
"@uqds/icon": "^0.0.
|
|
45
|
+
"@uqds/core": "^0.0.8-alpha.0",
|
|
46
|
+
"@uqds/icon": "^0.0.8-alpha.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@svgdotjs/svg.js": "^3.0.16",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"svgdom": "^0.1.8",
|
|
55
55
|
"svgo": "^1.3.2"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "ec1e27ff2c58ae9bdcd0eef7516ad5d57a00bafb"
|
|
58
58
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
|
2
|
-
<path d="M5.6 9.6L2.4 6.4 0 8.8l5.6 5.6L16 4l-2.4-2.4z" />
|
|
3
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
|
2
|
+
<path d="M5.6 9.6L2.4 6.4 0 8.8l5.6 5.6L16 4l-2.4-2.4z" />
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
|
2
|
-
<path d="M14.285 5.145l-6 6.167a.41.41 0 01-.598 0L1.715 5.145" fill="none" stroke="#000" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
|
2
|
+
<path d="M14.285 5.145l-6 6.167a.41.41 0 01-.598 0L1.715 5.145" fill="none" stroke="#000" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/src/scss/_component.scss
CHANGED
|
@@ -1,505 +1,505 @@
|
|
|
1
|
-
@use '@uqds/core/src/scss/global' as core;
|
|
2
|
-
@use '@uqds/icon/src/scss/global' as icon;
|
|
3
|
-
@use 'global' as *;
|
|
4
|
-
@use 'icons' as *;
|
|
5
|
-
|
|
6
|
-
$use-encapsulation: false !default;
|
|
7
|
-
|
|
8
|
-
@mixin form-styles {
|
|
9
|
-
form,
|
|
10
|
-
fieldset,
|
|
11
|
-
legend,
|
|
12
|
-
label,
|
|
13
|
-
input,
|
|
14
|
-
select,
|
|
15
|
-
textarea,
|
|
16
|
-
.uq-error-summary,
|
|
17
|
-
.uq-error-message,
|
|
18
|
-
.uq-success-message,
|
|
19
|
-
.uq-inline-help {
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
font-family: core.$font-body;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
fieldset,
|
|
25
|
-
legend,
|
|
26
|
-
label,
|
|
27
|
-
input,
|
|
28
|
-
select,
|
|
29
|
-
textarea {
|
|
30
|
-
&::before, &::after,
|
|
31
|
-
*, *::before, *::after {
|
|
32
|
-
box-sizing: border-box;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
fieldset {
|
|
37
|
-
border: 0;
|
|
38
|
-
padding: 0;
|
|
39
|
-
margin: 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
label,
|
|
43
|
-
legend {
|
|
44
|
-
color: $form-text-color;
|
|
45
|
-
display: block;
|
|
46
|
-
font-size: $form-label-size;
|
|
47
|
-
font-weight: core.$font-weight-bold;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
legend {
|
|
51
|
-
margin-bottom: $form-spacing;
|
|
52
|
-
line-height: core.$line-height-h;
|
|
53
|
-
padding: 0;
|
|
54
|
-
|
|
55
|
-
&.uq-legend--error {
|
|
56
|
-
color: $form-color-error;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.uq-legend__required {
|
|
60
|
-
color: $form-color-error;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
label {
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
line-height: core.$line-height-ui;
|
|
67
|
-
|
|
68
|
-
&.uq-label {
|
|
69
|
-
&--inline {
|
|
70
|
-
align-items: center;
|
|
71
|
-
display: inline-flex;
|
|
72
|
-
font-size: core.$font-size;
|
|
73
|
-
line-height: core.$line-height;
|
|
74
|
-
margin-bottom: core.$space-m;
|
|
75
|
-
|
|
76
|
-
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
77
|
-
select,
|
|
78
|
-
textarea,
|
|
79
|
-
+ input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
80
|
-
+ select,
|
|
81
|
-
+ textarea {
|
|
82
|
-
max-width: none;
|
|
83
|
-
min-width: 200px;
|
|
84
|
-
margin-left: core.$space;
|
|
85
|
-
margin-right: core.$space-m;
|
|
86
|
-
width: auto;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
90
|
-
select,
|
|
91
|
-
textarea {
|
|
92
|
-
margin-top: 0;
|
|
93
|
-
margin-bottom: core.$space-none;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&--disabled,
|
|
98
|
-
&--readonly {
|
|
99
|
-
color: $form-text-disabled-color;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&--disabled {
|
|
103
|
-
cursor: not-allowed;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&--error {
|
|
107
|
-
color: $form-color-error;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&--success {
|
|
111
|
-
color: $form-color-success;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
input:not([type="checkbox"]):not([type="radio"]),
|
|
116
|
-
select,
|
|
117
|
-
textarea,
|
|
118
|
-
+ input:not([type="checkbox"]):not([type="radio"]),
|
|
119
|
-
+ select,
|
|
120
|
-
+ textarea {
|
|
121
|
-
margin-top: core.$space-s;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
input[type="radio"],
|
|
125
|
-
input[type="checkbox"] {
|
|
126
|
-
+ *:not(input):not(select):not(textarea) {
|
|
127
|
-
display: inline-block;
|
|
128
|
-
font-size: core.$font-size;
|
|
129
|
-
font-weight: core.$font-weight-normal;
|
|
130
|
-
line-height: $form-checkbox-size;
|
|
131
|
-
margin-bottom: core.$space;
|
|
132
|
-
margin-left: core.$space-s;
|
|
133
|
-
margin-right: $form-spacing;
|
|
134
|
-
padding-top: core.$space-xs;
|
|
135
|
-
padding-left: core.$space-m;
|
|
136
|
-
vertical-align: top;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&[disabled] {
|
|
140
|
-
+ *:not(input):not(select):not(textarea) {
|
|
141
|
-
color: $form-text-disabled-color;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.uq-label__required {
|
|
147
|
-
color: $form-color-error;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
input,
|
|
152
|
-
select,
|
|
153
|
-
textarea {
|
|
154
|
-
&[disabled] {
|
|
155
|
-
cursor: not-allowed;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
160
|
-
select,
|
|
161
|
-
textarea {
|
|
162
|
-
background-color: core.$uq-white;
|
|
163
|
-
max-width: 100%;
|
|
164
|
-
min-width: 100%;
|
|
165
|
-
padding: ($form-spacing - core.$space-xs) $form-spacing;
|
|
166
|
-
border: $form-border-width solid $form-border-color;
|
|
167
|
-
border-radius: $form-border-radius;
|
|
168
|
-
font-size: $form-text-size;
|
|
169
|
-
color: $form-text-color;
|
|
170
|
-
line-height: core.$line-height-ui;
|
|
171
|
-
margin-bottom: core.$space-m;
|
|
172
|
-
|
|
173
|
-
&:focus {
|
|
174
|
-
border-color: $form-border-color-focus;
|
|
175
|
-
box-shadow: 0 0 0 1px $form-border-color-focus inset;
|
|
176
|
-
outline: none;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
&[disabled] {
|
|
180
|
-
color: $form-placeholder-color;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
&[readonly] {
|
|
184
|
-
&:focus {
|
|
185
|
-
border-color: $form-border-color;
|
|
186
|
-
box-shadow: 0 0 0 1px $form-border-color inset;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&::placeholder {
|
|
191
|
-
color: $form-placeholder-color;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
&.uq-input--error,
|
|
195
|
-
&.uq-input--success {
|
|
196
|
-
border-radius: $form-border-radius;
|
|
197
|
-
|
|
198
|
-
&:focus {
|
|
199
|
-
border-color: $form-border-color-focus;
|
|
200
|
-
box-shadow: 0 2px 0 0 $form-border-color-focus,
|
|
201
|
-
0 0 0 1px $form-border-color-focus inset;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
&.uq-input--error {
|
|
206
|
-
border-color: $form-color-error;
|
|
207
|
-
box-shadow: 0 2px 0 0 $form-color-error;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
&.uq-input--success {
|
|
211
|
-
border-color: $form-color-success;
|
|
212
|
-
box-shadow: 0 2px 0 0 $form-color-success;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&.uq-input--large {
|
|
216
|
-
padding: 1.15625rem core.$space-m;
|
|
217
|
-
border-radius: core.$space-xs;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
+ .uq-error-message,
|
|
221
|
-
+ .uq-success-message {
|
|
222
|
-
margin-top: -(core.$space-m);
|
|
223
|
-
border-radius: 0 0 $form-border-radius $form-border-radius;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
select {
|
|
228
|
-
appearance: none;
|
|
229
|
-
-webkit-appearance: none;
|
|
230
|
-
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon));
|
|
231
|
-
background-repeat: no-repeat;
|
|
232
|
-
background-position: right core.$space-xs center;
|
|
233
|
-
padding-right: 2.5rem;
|
|
234
|
-
cursor: pointer;
|
|
235
|
-
line-height: 1.2;
|
|
236
|
-
width: 100%;
|
|
237
|
-
|
|
238
|
-
&:focus {
|
|
239
|
-
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-focus-color));
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
&[multiple] {
|
|
243
|
-
height: auto;
|
|
244
|
-
background-image: none;
|
|
245
|
-
|
|
246
|
-
&:focus {
|
|
247
|
-
background-image: none;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
&[disabled] {
|
|
252
|
-
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon-disabled));
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
textarea {
|
|
257
|
-
height: 4 * $form-element-height;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
input[type="radio"],
|
|
261
|
-
input[type="checkbox"] {
|
|
262
|
-
appearance: none;
|
|
263
|
-
-webkit-appearance: none;
|
|
264
|
-
display: inline-block;
|
|
265
|
-
border: $form-checkbox-border-width solid $form-border-color;
|
|
266
|
-
cursor: pointer;
|
|
267
|
-
height: $form-checkbox-size;
|
|
268
|
-
width: $form-checkbox-size;
|
|
269
|
-
vertical-align: top;
|
|
270
|
-
position: absolute;
|
|
271
|
-
|
|
272
|
-
&:focus {
|
|
273
|
-
border-color: $form-focus-color;
|
|
274
|
-
box-shadow: 0 0 0 1px $form-focus-color;
|
|
275
|
-
outline: none;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
+ label {
|
|
279
|
-
display: inline-block;
|
|
280
|
-
font-size: core.$font-size;
|
|
281
|
-
font-weight: core.$font-weight-normal;
|
|
282
|
-
line-height: core.$line-height-h;
|
|
283
|
-
margin-bottom: core.$space;
|
|
284
|
-
margin-left: core.$space-s;
|
|
285
|
-
margin-right: $form-spacing;
|
|
286
|
-
padding-top: core.$space-compressed-xs;
|
|
287
|
-
padding-left: core.$space-m;
|
|
288
|
-
vertical-align: top;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
&:checked {
|
|
292
|
-
border-color: core.$link;
|
|
293
|
-
|
|
294
|
-
&:focus {
|
|
295
|
-
border-color: $form-focus-color;
|
|
296
|
-
box-shadow: 0 0 0 1px $form-focus-color;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
&.uq-input--error {
|
|
301
|
-
border-color: $form-color-error;
|
|
302
|
-
|
|
303
|
-
&:focus {
|
|
304
|
-
border-color: $form-focus-color;
|
|
305
|
-
box-shadow: 0 0 0 1px $form-focus-color;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
&:checked {
|
|
309
|
-
border-color: $form-color-error;
|
|
310
|
-
|
|
311
|
-
&:focus {
|
|
312
|
-
border-color: $form-focus-color;
|
|
313
|
-
box-shadow: 0 0 0 1px $form-focus-color;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
&[disabled] {
|
|
319
|
-
cursor: not-allowed;
|
|
320
|
-
border-color: $form-border-color;
|
|
321
|
-
background-color: core.$uq-neutral-light80;
|
|
322
|
-
|
|
323
|
-
+ label {
|
|
324
|
-
color: $form-text-disabled-color;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
&:checked {
|
|
328
|
-
background-color: core.$uq-neutral-light20;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
input[type="checkbox"] {
|
|
334
|
-
border-radius: $form-checkbox-border-radius;
|
|
335
|
-
|
|
336
|
-
&::after {
|
|
337
|
-
content: "";
|
|
338
|
-
display: block;
|
|
339
|
-
position: absolute;
|
|
340
|
-
background-repeat: no-repeat;
|
|
341
|
-
background-position: center center;
|
|
342
|
-
top: 1px;
|
|
343
|
-
left: 1px;
|
|
344
|
-
height: $form-checkbox-check-size;
|
|
345
|
-
width: $form-checkbox-check-size;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
&:checked {
|
|
349
|
-
background-color: core.$link;
|
|
350
|
-
|
|
351
|
-
&::after {
|
|
352
|
-
background-image: url(icon.get-icon('standard--check', $form-checkbox-check-color));
|
|
353
|
-
padding: 0px;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
&.uq-input--error {
|
|
358
|
-
&:checked {
|
|
359
|
-
background-color: $form-color-error;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
input[type="radio"] {
|
|
365
|
-
border-radius: 50%;
|
|
366
|
-
|
|
367
|
-
&:checked {
|
|
368
|
-
border-width: 2px;
|
|
369
|
-
|
|
370
|
-
&::after {
|
|
371
|
-
border-radius: 50%;
|
|
372
|
-
background-color: core.$link;
|
|
373
|
-
content: "";
|
|
374
|
-
display: block;
|
|
375
|
-
position: absolute;
|
|
376
|
-
top: 3px;
|
|
377
|
-
left: 3px;
|
|
378
|
-
height: $form-checkbox-size - 10px;
|
|
379
|
-
width: $form-checkbox-size - 10px;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
&[disabled] {
|
|
384
|
-
&:checked {
|
|
385
|
-
background-color: core.$uq-neutral-light80;
|
|
386
|
-
&::after {
|
|
387
|
-
background-color: core.$uq-neutral-light20;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
&.uq-input--error {
|
|
393
|
-
&:checked {
|
|
394
|
-
border-color: $form-color-error;
|
|
395
|
-
|
|
396
|
-
&::after {
|
|
397
|
-
background-color: $form-color-error;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
[type="submit"] {
|
|
404
|
-
appearance: none;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
.uq-error-summary {
|
|
408
|
-
background-color: lighten(core.$alert-light, 10%);
|
|
409
|
-
border: 1px solid core.$alert;
|
|
410
|
-
border-left-width: core.$space-xs;
|
|
411
|
-
padding: core.$space;
|
|
412
|
-
margin-bottom: core.$space-m;
|
|
413
|
-
|
|
414
|
-
&__title {
|
|
415
|
-
color: core.$text;
|
|
416
|
-
font-size: core.$font-size-m;
|
|
417
|
-
font-weight: core.$font-weight-bold;
|
|
418
|
-
line-height: core.$line-height-h;
|
|
419
|
-
margin: core.$space-none core.$space-none core.$space core.$space-none;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
&_body {
|
|
423
|
-
color: core.$text;
|
|
424
|
-
font-size: core.$space;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
&__list {
|
|
428
|
-
color: core.$text;
|
|
429
|
-
font-size: core.$space;
|
|
430
|
-
margin: core.$space-none;
|
|
431
|
-
|
|
432
|
-
&__item {
|
|
433
|
-
margin-bottom: core.$space-xs;
|
|
434
|
-
line-height: core.$line-height;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
a {
|
|
438
|
-
color: core.$alert;
|
|
439
|
-
text-decoration: underline;
|
|
440
|
-
font-weight: core.$font-weight-normal;
|
|
441
|
-
&:hover, &:focus {
|
|
442
|
-
color: darken(core.$alert, 5%);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.uq-error-message,
|
|
449
|
-
.uq-success-message {
|
|
450
|
-
color: core.$uq-white;
|
|
451
|
-
display: block;
|
|
452
|
-
font-size: core.$font-size;
|
|
453
|
-
font-style: normal;
|
|
454
|
-
font-weight: core.$font-weight-normal;
|
|
455
|
-
line-height: core.$line-height;
|
|
456
|
-
margin-bottom: core.$space-m;
|
|
457
|
-
padding: calc(#{core.$space-s} - 1px) core.$space core.$space-s core.$space-xxl;
|
|
458
|
-
position: relative;
|
|
459
|
-
|
|
460
|
-
&::before {
|
|
461
|
-
content: '';
|
|
462
|
-
display: block;
|
|
463
|
-
background-position: center;
|
|
464
|
-
background-repeat: no-repeat;
|
|
465
|
-
background-size: contain;
|
|
466
|
-
height: core.$space-compressed-xl;
|
|
467
|
-
left: core.$space;
|
|
468
|
-
margin-right: core.$space-s;
|
|
469
|
-
margin-top: calc(#{-(core.$space-compressed-xl) * 0.5} - 1px);
|
|
470
|
-
position: absolute;
|
|
471
|
-
top: 50%;
|
|
472
|
-
width: core.$space-compressed-xl;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.uq-error-message {
|
|
477
|
-
background-color: $form-color-error;
|
|
478
|
-
|
|
479
|
-
&::before {
|
|
480
|
-
background-image: url(icon.get-icon('standard--
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.uq-success-message {
|
|
485
|
-
background-color: $form-color-success;
|
|
486
|
-
|
|
487
|
-
&::before {
|
|
488
|
-
background-image: url(icon.get-icon('standard--
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
.uq-inline-help {
|
|
493
|
-
display: block;
|
|
494
|
-
font-size: $form-description-size;
|
|
495
|
-
margin: 0 0 $form-spacing;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
@if $use-encapsulation {
|
|
500
|
-
.uq {
|
|
501
|
-
@include form-styles;
|
|
502
|
-
}
|
|
503
|
-
} @else {
|
|
504
|
-
@include form-styles;
|
|
505
|
-
}
|
|
1
|
+
@use '@uqds/core/src/scss/global' as core;
|
|
2
|
+
@use '@uqds/icon/src/scss/global' as icon;
|
|
3
|
+
@use 'global' as *;
|
|
4
|
+
@use 'icons' as *;
|
|
5
|
+
|
|
6
|
+
$use-encapsulation: false !default;
|
|
7
|
+
|
|
8
|
+
@mixin form-styles {
|
|
9
|
+
form,
|
|
10
|
+
fieldset,
|
|
11
|
+
legend,
|
|
12
|
+
label,
|
|
13
|
+
input,
|
|
14
|
+
select,
|
|
15
|
+
textarea,
|
|
16
|
+
.uq-error-summary,
|
|
17
|
+
.uq-error-message,
|
|
18
|
+
.uq-success-message,
|
|
19
|
+
.uq-inline-help {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
font-family: core.$font-body;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
fieldset,
|
|
25
|
+
legend,
|
|
26
|
+
label,
|
|
27
|
+
input,
|
|
28
|
+
select,
|
|
29
|
+
textarea {
|
|
30
|
+
&::before, &::after,
|
|
31
|
+
*, *::before, *::after {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fieldset {
|
|
37
|
+
border: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
margin: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
label,
|
|
43
|
+
legend {
|
|
44
|
+
color: $form-text-color;
|
|
45
|
+
display: block;
|
|
46
|
+
font-size: $form-label-size;
|
|
47
|
+
font-weight: core.$font-weight-bold;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
legend {
|
|
51
|
+
margin-bottom: $form-spacing;
|
|
52
|
+
line-height: core.$line-height-h;
|
|
53
|
+
padding: 0;
|
|
54
|
+
|
|
55
|
+
&.uq-legend--error {
|
|
56
|
+
color: $form-color-error;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.uq-legend__required {
|
|
60
|
+
color: $form-color-error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
label {
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
line-height: core.$line-height-ui;
|
|
67
|
+
|
|
68
|
+
&.uq-label {
|
|
69
|
+
&--inline {
|
|
70
|
+
align-items: center;
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
font-size: core.$font-size;
|
|
73
|
+
line-height: core.$line-height;
|
|
74
|
+
margin-bottom: core.$space-m;
|
|
75
|
+
|
|
76
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
77
|
+
select,
|
|
78
|
+
textarea,
|
|
79
|
+
+ input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
80
|
+
+ select,
|
|
81
|
+
+ textarea {
|
|
82
|
+
max-width: none;
|
|
83
|
+
min-width: 200px;
|
|
84
|
+
margin-left: core.$space;
|
|
85
|
+
margin-right: core.$space-m;
|
|
86
|
+
width: auto;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
90
|
+
select,
|
|
91
|
+
textarea {
|
|
92
|
+
margin-top: 0;
|
|
93
|
+
margin-bottom: core.$space-none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--disabled,
|
|
98
|
+
&--readonly {
|
|
99
|
+
color: $form-text-disabled-color;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--disabled {
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&--error {
|
|
107
|
+
color: $form-color-error;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--success {
|
|
111
|
+
color: $form-color-success;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
input:not([type="checkbox"]):not([type="radio"]),
|
|
116
|
+
select,
|
|
117
|
+
textarea,
|
|
118
|
+
+ input:not([type="checkbox"]):not([type="radio"]),
|
|
119
|
+
+ select,
|
|
120
|
+
+ textarea {
|
|
121
|
+
margin-top: core.$space-s;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
input[type="radio"],
|
|
125
|
+
input[type="checkbox"] {
|
|
126
|
+
+ *:not(input):not(select):not(textarea) {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
font-size: core.$font-size;
|
|
129
|
+
font-weight: core.$font-weight-normal;
|
|
130
|
+
line-height: $form-checkbox-size;
|
|
131
|
+
margin-bottom: core.$space;
|
|
132
|
+
margin-left: core.$space-s;
|
|
133
|
+
margin-right: $form-spacing;
|
|
134
|
+
padding-top: core.$space-xs;
|
|
135
|
+
padding-left: core.$space-m;
|
|
136
|
+
vertical-align: top;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&[disabled] {
|
|
140
|
+
+ *:not(input):not(select):not(textarea) {
|
|
141
|
+
color: $form-text-disabled-color;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.uq-label__required {
|
|
147
|
+
color: $form-color-error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
input,
|
|
152
|
+
select,
|
|
153
|
+
textarea {
|
|
154
|
+
&[disabled] {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
|
|
160
|
+
select,
|
|
161
|
+
textarea {
|
|
162
|
+
background-color: core.$uq-white;
|
|
163
|
+
max-width: 100%;
|
|
164
|
+
min-width: 100%;
|
|
165
|
+
padding: ($form-spacing - core.$space-xs) $form-spacing;
|
|
166
|
+
border: $form-border-width solid $form-border-color;
|
|
167
|
+
border-radius: $form-border-radius;
|
|
168
|
+
font-size: $form-text-size;
|
|
169
|
+
color: $form-text-color;
|
|
170
|
+
line-height: core.$line-height-ui;
|
|
171
|
+
margin-bottom: core.$space-m;
|
|
172
|
+
|
|
173
|
+
&:focus {
|
|
174
|
+
border-color: $form-border-color-focus;
|
|
175
|
+
box-shadow: 0 0 0 1px $form-border-color-focus inset;
|
|
176
|
+
outline: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&[disabled] {
|
|
180
|
+
color: $form-placeholder-color;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&[readonly] {
|
|
184
|
+
&:focus {
|
|
185
|
+
border-color: $form-border-color;
|
|
186
|
+
box-shadow: 0 0 0 1px $form-border-color inset;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&::placeholder {
|
|
191
|
+
color: $form-placeholder-color;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&.uq-input--error,
|
|
195
|
+
&.uq-input--success {
|
|
196
|
+
border-radius: $form-border-radius;
|
|
197
|
+
|
|
198
|
+
&:focus {
|
|
199
|
+
border-color: $form-border-color-focus;
|
|
200
|
+
box-shadow: 0 2px 0 0 $form-border-color-focus,
|
|
201
|
+
0 0 0 1px $form-border-color-focus inset;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&.uq-input--error {
|
|
206
|
+
border-color: $form-color-error;
|
|
207
|
+
box-shadow: 0 2px 0 0 $form-color-error;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&.uq-input--success {
|
|
211
|
+
border-color: $form-color-success;
|
|
212
|
+
box-shadow: 0 2px 0 0 $form-color-success;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&.uq-input--large {
|
|
216
|
+
padding: 1.15625rem core.$space-m;
|
|
217
|
+
border-radius: core.$space-xs;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
+ .uq-error-message,
|
|
221
|
+
+ .uq-success-message {
|
|
222
|
+
margin-top: -(core.$space-m);
|
|
223
|
+
border-radius: 0 0 $form-border-radius $form-border-radius;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
select {
|
|
228
|
+
appearance: none;
|
|
229
|
+
-webkit-appearance: none;
|
|
230
|
+
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon));
|
|
231
|
+
background-repeat: no-repeat;
|
|
232
|
+
background-position: right core.$space-xs center;
|
|
233
|
+
padding-right: 2.5rem;
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
line-height: 1.2;
|
|
236
|
+
width: 100%;
|
|
237
|
+
|
|
238
|
+
&:focus {
|
|
239
|
+
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-focus-color));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&[multiple] {
|
|
243
|
+
height: auto;
|
|
244
|
+
background-image: none;
|
|
245
|
+
|
|
246
|
+
&:focus {
|
|
247
|
+
background-image: none;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&[disabled] {
|
|
252
|
+
background-image: url(icon.get-icon('standard--chevron-down-sml', $form-select-icon-disabled));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
textarea {
|
|
257
|
+
height: 4 * $form-element-height;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
input[type="radio"],
|
|
261
|
+
input[type="checkbox"] {
|
|
262
|
+
appearance: none;
|
|
263
|
+
-webkit-appearance: none;
|
|
264
|
+
display: inline-block;
|
|
265
|
+
border: $form-checkbox-border-width solid $form-border-color;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
height: $form-checkbox-size;
|
|
268
|
+
width: $form-checkbox-size;
|
|
269
|
+
vertical-align: top;
|
|
270
|
+
position: absolute;
|
|
271
|
+
|
|
272
|
+
&:focus {
|
|
273
|
+
border-color: $form-focus-color;
|
|
274
|
+
box-shadow: 0 0 0 1px $form-focus-color;
|
|
275
|
+
outline: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
+ label {
|
|
279
|
+
display: inline-block;
|
|
280
|
+
font-size: core.$font-size;
|
|
281
|
+
font-weight: core.$font-weight-normal;
|
|
282
|
+
line-height: core.$line-height-h;
|
|
283
|
+
margin-bottom: core.$space;
|
|
284
|
+
margin-left: core.$space-s;
|
|
285
|
+
margin-right: $form-spacing;
|
|
286
|
+
padding-top: core.$space-compressed-xs;
|
|
287
|
+
padding-left: core.$space-m;
|
|
288
|
+
vertical-align: top;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&:checked {
|
|
292
|
+
border-color: core.$link;
|
|
293
|
+
|
|
294
|
+
&:focus {
|
|
295
|
+
border-color: $form-focus-color;
|
|
296
|
+
box-shadow: 0 0 0 1px $form-focus-color;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&.uq-input--error {
|
|
301
|
+
border-color: $form-color-error;
|
|
302
|
+
|
|
303
|
+
&:focus {
|
|
304
|
+
border-color: $form-focus-color;
|
|
305
|
+
box-shadow: 0 0 0 1px $form-focus-color;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&:checked {
|
|
309
|
+
border-color: $form-color-error;
|
|
310
|
+
|
|
311
|
+
&:focus {
|
|
312
|
+
border-color: $form-focus-color;
|
|
313
|
+
box-shadow: 0 0 0 1px $form-focus-color;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
&[disabled] {
|
|
319
|
+
cursor: not-allowed;
|
|
320
|
+
border-color: $form-border-color;
|
|
321
|
+
background-color: core.$uq-neutral-light80;
|
|
322
|
+
|
|
323
|
+
+ label {
|
|
324
|
+
color: $form-text-disabled-color;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&:checked {
|
|
328
|
+
background-color: core.$uq-neutral-light20;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
input[type="checkbox"] {
|
|
334
|
+
border-radius: $form-checkbox-border-radius;
|
|
335
|
+
|
|
336
|
+
&::after {
|
|
337
|
+
content: "";
|
|
338
|
+
display: block;
|
|
339
|
+
position: absolute;
|
|
340
|
+
background-repeat: no-repeat;
|
|
341
|
+
background-position: center center;
|
|
342
|
+
top: 1px;
|
|
343
|
+
left: 1px;
|
|
344
|
+
height: $form-checkbox-check-size;
|
|
345
|
+
width: $form-checkbox-check-size;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
&:checked {
|
|
349
|
+
background-color: core.$link;
|
|
350
|
+
|
|
351
|
+
&::after {
|
|
352
|
+
background-image: url(icon.get-icon('standard--check', $form-checkbox-check-color));
|
|
353
|
+
padding: 0px;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&.uq-input--error {
|
|
358
|
+
&:checked {
|
|
359
|
+
background-color: $form-color-error;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
input[type="radio"] {
|
|
365
|
+
border-radius: 50%;
|
|
366
|
+
|
|
367
|
+
&:checked {
|
|
368
|
+
border-width: 2px;
|
|
369
|
+
|
|
370
|
+
&::after {
|
|
371
|
+
border-radius: 50%;
|
|
372
|
+
background-color: core.$link;
|
|
373
|
+
content: "";
|
|
374
|
+
display: block;
|
|
375
|
+
position: absolute;
|
|
376
|
+
top: 3px;
|
|
377
|
+
left: 3px;
|
|
378
|
+
height: $form-checkbox-size - 10px;
|
|
379
|
+
width: $form-checkbox-size - 10px;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
&[disabled] {
|
|
384
|
+
&:checked {
|
|
385
|
+
background-color: core.$uq-neutral-light80;
|
|
386
|
+
&::after {
|
|
387
|
+
background-color: core.$uq-neutral-light20;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&.uq-input--error {
|
|
393
|
+
&:checked {
|
|
394
|
+
border-color: $form-color-error;
|
|
395
|
+
|
|
396
|
+
&::after {
|
|
397
|
+
background-color: $form-color-error;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
[type="submit"] {
|
|
404
|
+
appearance: none;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.uq-error-summary {
|
|
408
|
+
background-color: lighten(core.$alert-light, 10%);
|
|
409
|
+
border: 1px solid core.$alert;
|
|
410
|
+
border-left-width: core.$space-xs;
|
|
411
|
+
padding: core.$space;
|
|
412
|
+
margin-bottom: core.$space-m;
|
|
413
|
+
|
|
414
|
+
&__title {
|
|
415
|
+
color: core.$text;
|
|
416
|
+
font-size: core.$font-size-m;
|
|
417
|
+
font-weight: core.$font-weight-bold;
|
|
418
|
+
line-height: core.$line-height-h;
|
|
419
|
+
margin: core.$space-none core.$space-none core.$space core.$space-none;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
&_body {
|
|
423
|
+
color: core.$text;
|
|
424
|
+
font-size: core.$space;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
&__list {
|
|
428
|
+
color: core.$text;
|
|
429
|
+
font-size: core.$space;
|
|
430
|
+
margin: core.$space-none;
|
|
431
|
+
|
|
432
|
+
&__item {
|
|
433
|
+
margin-bottom: core.$space-xs;
|
|
434
|
+
line-height: core.$line-height;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
a {
|
|
438
|
+
color: core.$alert;
|
|
439
|
+
text-decoration: underline;
|
|
440
|
+
font-weight: core.$font-weight-normal;
|
|
441
|
+
&:hover, &:focus {
|
|
442
|
+
color: darken(core.$alert, 5%);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.uq-error-message,
|
|
449
|
+
.uq-success-message {
|
|
450
|
+
color: core.$uq-white;
|
|
451
|
+
display: block;
|
|
452
|
+
font-size: core.$font-size;
|
|
453
|
+
font-style: normal;
|
|
454
|
+
font-weight: core.$font-weight-normal;
|
|
455
|
+
line-height: core.$line-height;
|
|
456
|
+
margin-bottom: core.$space-m;
|
|
457
|
+
padding: calc(#{core.$space-s} - 1px) core.$space core.$space-s core.$space-xxl;
|
|
458
|
+
position: relative;
|
|
459
|
+
|
|
460
|
+
&::before {
|
|
461
|
+
content: '';
|
|
462
|
+
display: block;
|
|
463
|
+
background-position: center;
|
|
464
|
+
background-repeat: no-repeat;
|
|
465
|
+
background-size: contain;
|
|
466
|
+
height: core.$space-compressed-xl;
|
|
467
|
+
left: core.$space;
|
|
468
|
+
margin-right: core.$space-s;
|
|
469
|
+
margin-top: calc(#{-(core.$space-compressed-xl) * 0.5} - 1px);
|
|
470
|
+
position: absolute;
|
|
471
|
+
top: 50%;
|
|
472
|
+
width: core.$space-compressed-xl;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.uq-error-message {
|
|
477
|
+
background-color: $form-color-error;
|
|
478
|
+
|
|
479
|
+
&::before {
|
|
480
|
+
background-image: url(icon.get-icon('standard--exclamation-triangle', core.$uq-white));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.uq-success-message {
|
|
485
|
+
background-color: $form-color-success;
|
|
486
|
+
|
|
487
|
+
&::before {
|
|
488
|
+
background-image: url(icon.get-icon('standard--check-circle', core.$uq-white));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.uq-inline-help {
|
|
493
|
+
display: block;
|
|
494
|
+
font-size: $form-description-size;
|
|
495
|
+
margin: 0 0 $form-spacing;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
@if $use-encapsulation {
|
|
500
|
+
.uq {
|
|
501
|
+
@include form-styles;
|
|
502
|
+
}
|
|
503
|
+
} @else {
|
|
504
|
+
@include form-styles;
|
|
505
|
+
}
|
package/src/scss/_global.scss
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
@use '@uqds/core/src/scss/global' as core;
|
|
2
|
-
|
|
3
|
-
$form-border-color-focus: core.$link;
|
|
4
|
-
$form-border-color: core.$uq-neutral-light40;
|
|
5
|
-
$form-border-radius: 2px;
|
|
6
|
-
$form-border-width: 1px;
|
|
7
|
-
$form-color-error: core.$alert;
|
|
8
|
-
$form-color-success: core.$success;
|
|
9
|
-
$form-description-size: core.$font-size-xs;
|
|
10
|
-
$form-element-height: core.$space-xl;
|
|
11
|
-
$form-focus-color: core.$link;
|
|
12
|
-
$form-label-size: core.$font-size-s;
|
|
13
|
-
$form-placeholder-color: core.$uq-neutral-dark40;
|
|
14
|
-
$form-spacing: core.$space;
|
|
15
|
-
$form-text-color: core.$text;
|
|
16
|
-
$form-text-disabled-color: core.$uq-neutral-dark20;
|
|
17
|
-
$form-text-size: core.$font-size;
|
|
18
|
-
|
|
19
|
-
// Select
|
|
20
|
-
$form-select-icon: core.$uq-purple;
|
|
21
|
-
$form-select-icon-disabled: $form-border-color;
|
|
22
|
-
|
|
23
|
-
// Checkbox/Radio buttons
|
|
24
|
-
$form-checkbox-border-radius: 4px;
|
|
25
|
-
$form-checkbox-border-width: 1px;
|
|
26
|
-
$form-checkbox-check-color: core.$uq-white;
|
|
27
|
-
$form-checkbox-size: 20px;
|
|
28
|
-
$form-checkbox-check-size: 16px;
|
|
1
|
+
@use '@uqds/core/src/scss/global' as core;
|
|
2
|
+
|
|
3
|
+
$form-border-color-focus: core.$link;
|
|
4
|
+
$form-border-color: core.$uq-neutral-light40;
|
|
5
|
+
$form-border-radius: 2px;
|
|
6
|
+
$form-border-width: 1px;
|
|
7
|
+
$form-color-error: core.$alert;
|
|
8
|
+
$form-color-success: core.$success;
|
|
9
|
+
$form-description-size: core.$font-size-xs;
|
|
10
|
+
$form-element-height: core.$space-xl;
|
|
11
|
+
$form-focus-color: core.$link;
|
|
12
|
+
$form-label-size: core.$font-size-s;
|
|
13
|
+
$form-placeholder-color: core.$uq-neutral-dark40;
|
|
14
|
+
$form-spacing: core.$space;
|
|
15
|
+
$form-text-color: core.$text;
|
|
16
|
+
$form-text-disabled-color: core.$uq-neutral-dark20;
|
|
17
|
+
$form-text-size: core.$font-size;
|
|
18
|
+
|
|
19
|
+
// Select
|
|
20
|
+
$form-select-icon: core.$uq-purple;
|
|
21
|
+
$form-select-icon-disabled: $form-border-color;
|
|
22
|
+
|
|
23
|
+
// Checkbox/Radio buttons
|
|
24
|
+
$form-checkbox-border-radius: 4px;
|
|
25
|
+
$form-checkbox-border-width: 1px;
|
|
26
|
+
$form-checkbox-check-color: core.$uq-white;
|
|
27
|
+
$form-checkbox-size: 20px;
|
|
28
|
+
$form-checkbox-check-size: 16px;
|
package/src/scss/_icons.scss
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
$-icons: (
|
|
2
|
-
"form-checkbox-check": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='~~COLOR~~'%3e%3cpath d='M5.6 9.6L2.4 6.4 0 8.8l5.6 5.6L16 4l-2.4-2.4z'%3e%3c/path%3e%3c/svg%3e",
|
|
3
|
-
"form-chevron-down": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='~~COLOR~~'%3e%3cpath d='M14.285 5.145l-6 6.167a.41.41 0 01-.598 0L1.715 5.145' fill='none' stroke='~~COLOR~~' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e",
|
|
4
|
-
"form-error": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='140' height='140' fill='~~COLOR~~'%3e%3cpath d='M138.42 118.29l-55-110a15 15 0 00-26.84 0l-55 110A15 15 0 0015 140h110a15 15 0 0013.42-21.71zM62.5 50a7.5 7.5 0 0115 0v30a7.5 7.5 0 01-15 0zm7.5 70a10 10 0 1110-10 10 10 0 01-10 10z'%3e%3c/path%3e%3c/svg%3e",
|
|
5
|
-
"form-success": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='140' height='140' fill='~~COLOR~~'%3e%3cpath d='M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zm36 59L66.24 98.74a10 10 0 01-14.15 0L34 80.68a10.013 10.013 0 0114.18-14.14l11 11 32.64-32.67A10.01 10.01 0 01106 59z'%3e%3c/path%3e%3c/svg%3e",
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
@function -str-replace($string, $search, $replace: '') {
|
|
9
|
-
$index: str-index($string, $search);
|
|
10
|
-
|
|
11
|
-
@if $index {
|
|
12
|
-
@return str-slice( $string, 1, $index - 1 ) + $replace + -str-replace( str-slice( $string, $index + str-length( $search ) ), $search, $replace);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@return $string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@function get-icon($icon, $color: #2b2b2b) {
|
|
19
|
-
@if type-of($color) != 'color' and $color != 'none' {
|
|
20
|
-
@warn 'The requested color - "' + $color + '" - was not recognized as a Sass color value.';
|
|
21
|
-
@return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@if map-has-key($-icons, $icon) {
|
|
25
|
-
$icon: map-get($-icons, $icon);
|
|
26
|
-
$data-uri: -str-replace($icon, '~~COLOR~~', $color);
|
|
27
|
-
|
|
28
|
-
@return -str-replace( $data-uri, '#', '%23' );
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@warn 'The requested icon - "' + $icon + '" - is not defined in the $icons map.';
|
|
32
|
-
@return null;
|
|
33
|
-
}
|
|
1
|
+
$-icons: (
|
|
2
|
+
"form-checkbox-check": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='~~COLOR~~'%3e%3cpath d='M5.6 9.6L2.4 6.4 0 8.8l5.6 5.6L16 4l-2.4-2.4z'%3e%3c/path%3e%3c/svg%3e",
|
|
3
|
+
"form-chevron-down": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='~~COLOR~~'%3e%3cpath d='M14.285 5.145l-6 6.167a.41.41 0 01-.598 0L1.715 5.145' fill='none' stroke='~~COLOR~~' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e",
|
|
4
|
+
"form-error": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='140' height='140' fill='~~COLOR~~'%3e%3cpath d='M138.42 118.29l-55-110a15 15 0 00-26.84 0l-55 110A15 15 0 0015 140h110a15 15 0 0013.42-21.71zM62.5 50a7.5 7.5 0 0115 0v30a7.5 7.5 0 01-15 0zm7.5 70a10 10 0 1110-10 10 10 0 01-10 10z'%3e%3c/path%3e%3c/svg%3e",
|
|
5
|
+
"form-success": "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 140' width='140' height='140' fill='~~COLOR~~'%3e%3cpath d='M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zm36 59L66.24 98.74a10 10 0 01-14.15 0L34 80.68a10.013 10.013 0 0114.18-14.14l11 11 32.64-32.67A10.01 10.01 0 01106 59z'%3e%3c/path%3e%3c/svg%3e",
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
@function -str-replace($string, $search, $replace: '') {
|
|
9
|
+
$index: str-index($string, $search);
|
|
10
|
+
|
|
11
|
+
@if $index {
|
|
12
|
+
@return str-slice( $string, 1, $index - 1 ) + $replace + -str-replace( str-slice( $string, $index + str-length( $search ) ), $search, $replace);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@return $string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@function get-icon($icon, $color: #2b2b2b) {
|
|
19
|
+
@if type-of($color) != 'color' and $color != 'none' {
|
|
20
|
+
@warn 'The requested color - "' + $color + '" - was not recognized as a Sass color value.';
|
|
21
|
+
@return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@if map-has-key($-icons, $icon) {
|
|
25
|
+
$icon: map-get($-icons, $icon);
|
|
26
|
+
$data-uri: -str-replace($icon, '~~COLOR~~', $color);
|
|
27
|
+
|
|
28
|
+
@return -str-replace( $data-uri, '#', '%23' );
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@warn 'The requested icon - "' + $icon + '" - is not defined in the $icons map.';
|
|
32
|
+
@return null;
|
|
33
|
+
}
|