Merge branch 'main' into feature-oidc-accounts
This commit is contained in:
23 files changed
+532
-262
No files matched your search
@@ -13,7 +13,7 @@ export default function () {
|
||||
// make this `/api`, for example, if your API is namespaced
|
||||
this.namespace = config.api.namespace;
|
||||
// delay for each request, automatically set to 0 during testing
|
||||
this.timing = 350;
|
||||
this.timing = 1;
|
||||
|
||||
// Allow any configured API host to passthrough, which is useful in
|
||||
// development for testing against a locally running backend.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5832 1.67511L5.68872 7.36908L10.6547 13.3821L13.4227 11.0961L17.298 15.5239L13.8483 18.5432L15.3301 20.2363L18.7798 17.217L20.2352 18.8797L16.7874 21.8973L18.2693 23.5904L23.4101 19.091L15.1582 9.66276L17.5492 7.68814L12.5832 1.67511Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.06114 10.6154C3.9843 10.3626 2.37549 8.59326 2.37549 6.44818C2.37549 4.12959 4.25508 2.25 6.57366 2.25C7.31363 2.25 8.00889 2.44144 8.6126 2.7775L10.4051 1.26126C9.33393 0.468662 8.00853 0 6.57366 0C3.01243 0 0.125488 2.88695 0.125488 6.44818C0.125488 10.0094 3.01243 12.8964 6.57366 12.8964C7.02078 12.8964 7.45727 12.8508 7.87875 12.7642L6.06114 10.6154Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 832 B |
@@ -0,0 +1,9 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4577 1.67511L5.56323 7.36908L10.5292 13.3821L13.2972 11.0961L17.1724 15.5238L13.7226 18.5433L15.2044 20.2364L18.6543 17.2169L20.1097 18.8797L16.662 21.8973L18.1438 23.5904L23.2846 19.091L15.0328 9.66276L17.4237 7.68814L12.4577 1.67511Z" fill="black"/>
|
||||
<mask id="path-2-inside-1" fill="white">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.766 4.35302L5.62911 4.255L5.53249 11.2901L9.12206 11.3394L9.20978 17.2227L4.62573 17.2911L4.6593 19.5409L9.24333 19.4725L9.27627 21.682L4.69506 21.7503L4.7286 24L11.5596 23.8982L11.3728 11.3703L12.6694 11.3882L12.766 4.35302Z"/>
|
||||
</mask>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.766 4.35302L5.62911 4.255L5.53249 11.2901L9.12206 11.3394L9.20978 17.2227L4.62573 17.2911L4.6593 19.5409L9.24333 19.4725L9.27627 21.682L4.69506 21.7503L4.7286 24L11.5596 23.8982L11.3728 11.3703L12.6694 11.3882L12.766 4.35302Z" fill="black"/>
|
||||
<path d="M5.62911 4.255L5.64971 2.75515L4.14985 2.73455L4.12925 4.23441L5.62911 4.255ZM12.766 4.35302L14.2659 4.37362L14.2865 2.87376L12.7866 2.85316L12.766 4.35302ZM5.53249 11.2901L4.03264 11.2695L4.01204 12.7694L5.5119 12.79L5.53249 11.2901ZM9.12206 11.3394L10.6219 11.3171L10.6002 9.85959L9.14265 9.83958L9.12206 11.3394ZM9.20978 17.2227L9.23216 18.7226L10.732 18.7002L10.7096 17.2004L9.20978 17.2227ZM4.62573 17.2911L4.60335 15.7913L3.10352 15.8137L3.1259 17.3135L4.62573 17.2911ZM4.6593 19.5409L3.15947 19.5633L3.18185 21.0631L4.68168 21.0407L4.6593 19.5409ZM9.24333 19.4725L10.7432 19.4501L10.7208 17.9503L9.22095 17.9727L9.24333 19.4725ZM9.27627 21.682L9.29863 23.1818L10.7985 23.1594L10.7761 21.6596L9.27627 21.682ZM4.69506 21.7503L4.6727 20.2504L3.17286 20.2728L3.19522 21.7726L4.69506 21.7503ZM4.7286 24L3.22877 24.0224L3.25113 25.5222L4.75096 25.4998L4.7286 24ZM11.5596 23.8982L11.5819 25.398L13.0818 25.3756L13.0594 23.8758L11.5596 23.8982ZM11.3728 11.3703L11.3934 9.87048L9.84992 9.84929L9.87293 11.3927L11.3728 11.3703ZM12.6694 11.3882L12.6488 12.888L14.1487 12.9086L14.1693 11.4087L12.6694 11.3882ZM5.60851 5.75486L12.7454 5.85288L12.7866 2.85316L5.64971 2.75515L5.60851 5.75486ZM7.03235 11.3107L7.12897 4.2756L4.12925 4.23441L4.03264 11.2695L7.03235 11.3107ZM9.14265 9.83958L5.55309 9.79028L5.5119 12.79L9.10146 12.8393L9.14265 9.83958ZM7.62222 11.3618L7.70995 17.2451L10.7096 17.2004L10.6219 11.3171L7.62222 11.3618ZM9.1874 15.7229L4.60335 15.7913L4.64811 18.791L9.23216 18.7226L9.1874 15.7229ZM3.1259 17.3135L3.15947 19.5633L6.15913 19.5185L6.12557 17.2688L3.1259 17.3135ZM4.68168 21.0407L9.2657 20.9723L9.22095 17.9727L4.63692 18.0411L4.68168 21.0407ZM7.74349 19.4949L7.77644 21.7043L10.7761 21.6596L10.7432 19.4501L7.74349 19.4949ZM9.25391 20.1821L4.6727 20.2504L4.71742 23.2501L9.29863 23.1818L9.25391 20.1821ZM3.19522 21.7726L3.22877 24.0224L6.22843 23.9777L6.19489 21.7279L3.19522 21.7726ZM4.75096 25.4998L11.5819 25.398L11.5372 22.3983L4.70624 22.5002L4.75096 25.4998ZM13.0594 23.8758L12.8726 11.348L9.87293 11.3927L10.0597 23.9205L13.0594 23.8758ZM12.69 9.88829L11.3934 9.87048L11.3522 12.8702L12.6488 12.888L12.69 9.88829ZM11.2662 4.33242L11.1696 11.3676L14.1693 11.4087L14.2659 4.37362L11.2662 4.33242Z" fill="black" mask="url(#path-2-inside-1)"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2796 1.26121C9.20838 0.46864 7.88301 0 6.44818 0C2.88695 0 0 2.88695 0 6.44818C0 9.00798 1.4916 11.2194 3.65306 12.2607L3.68943 9.61275C2.80735 8.84314 2.25 7.71075 2.25 6.44818C2.25 4.12959 4.12959 2.25 6.44818 2.25C7.18811 2.25 7.88333 2.44143 8.48703 2.77746L10.2796 1.26121Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,6 +1,6 @@
|
||||
<details
|
||||
...attributes
|
||||
class="rose-dropdown {{if @dropdownRight "rose-dropdown-right"}}"
|
||||
class="rose-dropdown {{if @dropdownRight "rose-dropdown-right"}} {{if @style (concat "rose-dropdown-" @style)}}"
|
||||
{{on-click-outside this.close}}
|
||||
>
|
||||
|
||||
@@ -22,14 +22,28 @@
|
||||
|
||||
</summary>
|
||||
|
||||
<div class="rose-dropdown-content" {{on-click-inside this.close}}>
|
||||
{{yield (hash
|
||||
link=(component "rose/dropdown/link" style=this.style)
|
||||
button=(component "rose/dropdown/button" style=this.style)
|
||||
item=(component "rose/anonymous" class="rose-dropdown-item")
|
||||
separator=(component "rose/anonymous" tagName="hr" class="rose-dropdown-separator")
|
||||
section=(component "rose/dropdown/section" style=this.style)
|
||||
)}}
|
||||
</div>
|
||||
{{#if @ignoreClickInside}}
|
||||
<div class="rose-dropdown-content">
|
||||
{{yield (hash
|
||||
link=(component "rose/dropdown/link" style=this.style)
|
||||
button=(component "rose/dropdown/button" style=this.style)
|
||||
item=(component "rose/anonymous" class="rose-dropdown-item")
|
||||
separator=(component "rose/anonymous" tagName="hr" class="rose-dropdown-separator")
|
||||
section=(component "rose/dropdown/section" style=this.style)
|
||||
key-value=(component "rose/dropdown/key-value")
|
||||
)}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="rose-dropdown-content" {{on-click-inside this.close}}>
|
||||
{{yield (hash
|
||||
link=(component "rose/dropdown/link" style=this.style)
|
||||
button=(component "rose/dropdown/button" style=this.style)
|
||||
item=(component "rose/anonymous" class="rose-dropdown-item")
|
||||
separator=(component "rose/anonymous" tagName="hr" class="rose-dropdown-separator")
|
||||
section=(component "rose/dropdown/section" style=this.style)
|
||||
key-value=(component "rose/dropdown/key-value")
|
||||
)}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</details>
|
||||
@@ -63,6 +63,24 @@ A simple dropdown component with support for links and buttons.
|
||||
}}</Story>
|
||||
</Preview>
|
||||
|
||||
<Preview>
|
||||
<Story name="Dropdown with Key Value Items" height="13rem">{{
|
||||
template: hbs`
|
||||
<Rose::Dropdown @text="View details" @showCaret={{showCaret}} @ignoreClickInside={{true}} as |dropdown|>
|
||||
<dropdown.key-value>
|
||||
<:key>Name</:key>
|
||||
<:value>Key/Value</:value>
|
||||
</dropdown.key-value>
|
||||
<dropdown.separator />
|
||||
<dropdown.key-value>
|
||||
<:key>Description</:key>
|
||||
<:value>Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda illo ratione libero ducimus magnam, porro sed provident repellat mollitia a, repellendus placeat. Magni consequuntur cumque, debitis obcaecati dolores quasi natus?</:value>
|
||||
</dropdown.key-value>
|
||||
</Rose::Dropdown>
|
||||
`,
|
||||
}}</Story>
|
||||
</Preview>
|
||||
|
||||
|
||||
```html
|
||||
<Rose::Dropdown @text="Choose One…" as |dropdown|>
|
||||
@@ -125,3 +143,14 @@ form field.
|
||||
</form.radioGroup>
|
||||
</Rose::Form>
|
||||
```
|
||||
|
||||
Closing dropdown after clicking inside it's content can be ignored using `ignoreClickInside`. This is useful when dropdown contains keyvalue items that users need to select/copy/interact with.
|
||||
|
||||
```html
|
||||
<Rose::Dropdown @text="View details" @showCaret={{true}} @ignoreClickInside={{true}} as |dropdown|>
|
||||
<dropdown.key-value>
|
||||
<:key>ID</:key>
|
||||
<:value>cl_nbv9375hLHs</:value>
|
||||
</dropdown.key-value>
|
||||
</Rose::Dropdown>
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
<dl class='rose-dropdown-key-value rose-dropdown-item'>
|
||||
<dt class='rose-dropdown-key'>
|
||||
{{yield to='key'}}
|
||||
</dt>
|
||||
|
||||
<dd class='rose-dropdown-value'>
|
||||
{{yield to='value'}}
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -5,6 +5,7 @@ $xs: sizing.rems(xs); // 8
|
||||
$xxs: sizing.rems(xxs); // 4
|
||||
$chevron: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231b1f26' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>");
|
||||
$chevronWhite: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%23ffffff' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>");
|
||||
$chevronGrey: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%23626873' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>");
|
||||
|
||||
.rose-dropdown {
|
||||
--background-image-light: #{$chevron};
|
||||
@@ -121,4 +122,26 @@ $chevronWhite: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%23f
|
||||
border: none;
|
||||
margin: $xxs 0;
|
||||
}
|
||||
|
||||
// Styles for condensed verion. Some are overrides
|
||||
&.rose-dropdown-condensed {
|
||||
--background-image: #{$chevronGrey};
|
||||
border: sizing.rems(xxxxs) solid var(--ui-border);
|
||||
border-radius: sizing.rems(xxs);
|
||||
|
||||
.rose-dropdown-trigger {
|
||||
color: var(--ui-gray-starker-1);
|
||||
padding: 0 sizing.rems(s); // To clear the inherit padding.
|
||||
|
||||
&.show-caret {
|
||||
padding-right: sizing.rems(l) + sizing.rems(xs); // 32
|
||||
background-position: right sizing.rems(xs) center;
|
||||
}
|
||||
}
|
||||
|
||||
.rose-dropdown-content {
|
||||
border: none;
|
||||
border: sizing.rems(xxxxs) solid var(--ui-border);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,3 +3,4 @@
|
||||
@import 'link';
|
||||
@import 'item';
|
||||
@import 'section';
|
||||
@import 'key-value';
|
||||
@@ -7,8 +7,14 @@ $checkmark: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563
|
||||
.rose-dropdown-item {
|
||||
@include type.type(s);
|
||||
min-width: (sizing.rems(m)) * 20;
|
||||
$line-height: math.div(36, 14);
|
||||
line-height: $line-height;
|
||||
$paddingY: math.div(
|
||||
sizing.rems(xl) - (sizing.rems(m) + sizing.rems(xxxs)),
|
||||
2
|
||||
);
|
||||
$paddingX: sizing.rems(s);
|
||||
padding: $paddingY $paddingX;
|
||||
//$line-height: math.div(36, 14);
|
||||
//line-height: $line-height;
|
||||
|
||||
--color: var(--stark);
|
||||
--background-color: transparent;
|
||||
@@ -16,26 +22,22 @@ $checkmark: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563
|
||||
color: var(--color);
|
||||
background-color: var(--background-color);
|
||||
|
||||
&:hover {
|
||||
--background-color: var(--ui-gray-subtler-5);
|
||||
}
|
||||
|
||||
.rose-form-radio {
|
||||
color: currentColor;
|
||||
margin-bottom: 0;
|
||||
|
||||
.rose-form-radio-label {
|
||||
display: block;
|
||||
margin: -#{$paddingY} -#{$paddingX};
|
||||
padding-top: sizing.rems(xs) + sizing.rems(xxxxs);
|
||||
padding-bottom: sizing.rems(xs) + sizing.rems(xxxxs);
|
||||
padding-left: sizing.rems(s);
|
||||
padding-right: sizing.rems(xl);
|
||||
font-weight: normal;
|
||||
|
||||
// &::before,
|
||||
// &::after {
|
||||
// display: none;
|
||||
// }
|
||||
&:hover {
|
||||
background-color: var(--ui-gray-subtler-5);
|
||||
}
|
||||
|
||||
&::after {
|
||||
top: sizing.rems(xxs) + sizing.rems(xxxs);
|
||||
@@ -57,11 +59,6 @@ $checkmark: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563
|
||||
~ .rose-form-radio-label {
|
||||
color: var(--action);
|
||||
background-color: var(--action-subtler-1h);
|
||||
|
||||
// background-image: #{$checkmark};
|
||||
// background-repeat: no-repeat;
|
||||
// background-position: right sizing.rems(m) center;
|
||||
// background-size: sizing.rems(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@use '../../variables/sizing';
|
||||
|
||||
.rose-dropdown-key-value {
|
||||
.rose-dropdown-key {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.rose-dropdown-value {
|
||||
color: var(--ui-gray);
|
||||
padding: sizing.rems(xxs) sizing.rems(s) 0 0;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
.rose-form-fieldset {
|
||||
margin-bottom: sizing.rems(m);
|
||||
|
||||
|
||||
.rose-form-fieldset-title {
|
||||
@include type.type(l, bold);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
.rose-table-row {
|
||||
border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
|
||||
text-align: left;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// This styles are add to stop the input to apply extra margin (default on forms)
|
||||
@@ -39,6 +43,9 @@
|
||||
|
||||
.rose-table-header-cell {
|
||||
@include type.type(s, semibold);
|
||||
}
|
||||
|
||||
.rose-table-header .rose-table-header-cell {
|
||||
color: var(--ui-gray);
|
||||
}
|
||||
|
||||
@@ -67,11 +74,27 @@
|
||||
}
|
||||
|
||||
&.rose-table-condensed {
|
||||
.rose-table-cell {
|
||||
.rose-table-cell,
|
||||
.rose-table-header-cell {
|
||||
@include type.type(s);
|
||||
$lineHeight: math.div(36, 14);
|
||||
line-height: $lineHeight;
|
||||
padding: math.div(sizing.rems(s), 2) sizing.rems(s);
|
||||
padding: sizing.rems(xxs) + sizing.rems(xxxxs) sizing.rems(s);
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
.rose-table-header {
|
||||
.rose-table-header-cell {
|
||||
$lineHeight: math.div(16, 14);
|
||||
line-height: $lineHeight;
|
||||
padding: sizing.rems(xs) sizing.rems(s);
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from 'rose/components/rose/dropdown/key-value';
|
||||
@@ -1,196 +1,82 @@
|
||||
<h2>Condensed Table</h2>
|
||||
<Rose::Table @style="condensed" as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell >Address</row.headerCell>
|
||||
<row.headerCell>Host Set</row.headerCell>
|
||||
<row.headerCell>Name</row.headerCell>
|
||||
<row.headerCell>Description</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>1.1.1.1</row.cell>
|
||||
<row.cell>host-set-1, host-set-2</row.cell>
|
||||
<row.cell>optional name</row.cell>
|
||||
<row.cell>description</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer as |footer|>
|
||||
<footer.row as |row|>
|
||||
<row.cell>Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
<h2>KeyValue Dropdown</h2>
|
||||
<Rose::Dropdown
|
||||
@text="Credential library details"
|
||||
@showCaret={{true}}
|
||||
@ignoreClickInside={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.key-value>
|
||||
<:key>ID</:key>
|
||||
<:value>cl_nbv9375hLHs</:value>
|
||||
</dropdown.key-value>
|
||||
|
||||
<h2>Condensed Table with Shrink Cells</h2>
|
||||
<Rose::Table @style="condensed" as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>Address</row.headerCell>
|
||||
<row.headerCell @shrink={{true}}>Host Set</row.headerCell>
|
||||
<row.headerCell @shrink={{true}}>Name</row.headerCell>
|
||||
<row.headerCell>Description</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>1.1.1.1</row.cell>
|
||||
<row.cell @shrink={{true}}>host-set-1, host-set-2</row.cell>
|
||||
<row.cell @shrink={{true}}>
|
||||
<Rose::Button @style="secondary" @iconOnly="trash" title="Remove">Remove</Rose::Button>
|
||||
</row.cell>
|
||||
<row.cell>description</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer @hidden={{true}} as |footer|>
|
||||
<footer.row as |row|>
|
||||
<row.cell>Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
<dropdown.separator />
|
||||
|
||||
<h2>Condensed Table with Right and Center aligned cells</h2>
|
||||
<Rose::Table @style="condensed" as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>Address</row.headerCell>
|
||||
<row.headerCell @alignCenter={{true}}>Host Set</row.headerCell>
|
||||
<row.headerCell>Name</row.headerCell>
|
||||
<row.headerCell>Description</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>1.1.1.1</row.cell>
|
||||
<row.cell @alignCenter={{true}}>host-set-1, host-set-2</row.cell>
|
||||
<row.cell @alignRight={{true}}>optional name</row.cell>
|
||||
<row.cell @alignCenter={{true}}>description</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer as |footer|>
|
||||
<footer.row as |row|>
|
||||
<row.cell>Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
<dropdown.key-value>
|
||||
<:key>Name</:key>
|
||||
<:value>Key/Value</:value>
|
||||
</dropdown.key-value>
|
||||
|
||||
<h2>Condensed Table Key/Value Lookalike (edit mode)</h2>
|
||||
<Rose::Table @style="condensed" as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell @shrink={{true}}>Key</row.headerCell>
|
||||
<row.headerCell colspan="2">Value</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>Key</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Form::Input @contextual={{true}} as |input|>
|
||||
<input.field />
|
||||
</Rose::Form::Input>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}} @alignRight={{true}}>
|
||||
<Rose::Button @style="secondary" @iconOnly="trash" title="Remove">Remove</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
<body.row as |row|>
|
||||
<row.cell>Key</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Form::Select
|
||||
@name="Test select"
|
||||
as |field|
|
||||
>
|
||||
<field.field as |select|>
|
||||
<select.option>Choose an option</select.option>
|
||||
<select.option @value="value-1">Value 1</select.option>
|
||||
<select.option @value="value-2">Value 2</select.option>
|
||||
<select.option @value="value-3">Value 3</select.option>
|
||||
</field.field>
|
||||
</Rose::Form::Select>
|
||||
</row.cell>
|
||||
<row.cell @shrink={{true}} @alignRight={{true}}>
|
||||
<Rose::Button @style="secondary">Add</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
<body.row as |row|>
|
||||
<row.cell>Key</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Form::Input @contextual={{true}} as |input|>
|
||||
<input.field />
|
||||
</Rose::Form::Input>
|
||||
</row.cell>
|
||||
<row.cell @alignRight={{true}}>
|
||||
<Rose::Button @style="secondary">Add</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
<body.row as |row|>
|
||||
<row.cell>Key</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Form::Textarea
|
||||
@name="field"
|
||||
readonly={{false}}
|
||||
/>
|
||||
</row.cell>
|
||||
<row.cell @alignRight={{true}}>
|
||||
<Rose::Button @style="secondary">Add</Rose::Button>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer @hidden={{true}} as |footer|>
|
||||
<footer.row as |row|>
|
||||
<row.cell colspan="3">Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
<dropdown.separator />
|
||||
|
||||
<h2>Condensed Table With Visually Hidden Header & Footer</h2>
|
||||
<Rose::Table @style="condensed" as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row @hidden={{true}} as |row|>
|
||||
<row.headerCell >Address</row.headerCell>
|
||||
<row.headerCell>Host Set</row.headerCell>
|
||||
<row.headerCell>Name</row.headerCell>
|
||||
<row.headerCell>Description</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>1.1.1.1</row.cell>
|
||||
<row.cell>host-set-1, host-set-2</row.cell>
|
||||
<row.cell>optional name</row.cell>
|
||||
<row.cell>description</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer as |footer|>
|
||||
<footer.row @hidden={{true}} as |row|>
|
||||
<row.cell>Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
<dropdown.key-value>
|
||||
<:key>Description</:key>
|
||||
<:value>Lorem ipsum dolor sit amet consectetur adipisicing elit. Assumenda illo ratione libero ducimus magnam, porro sed provident repellat mollitia a, repellendus placeat. Magni consequuntur cumque, debitis obcaecati dolores quasi natus?</:value>
|
||||
</dropdown.key-value>
|
||||
|
||||
<h2>Table</h2>
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>Address</row.headerCell>
|
||||
<row.headerCell>Host Set</row.headerCell>
|
||||
<row.headerCell>Name</row.headerCell>
|
||||
<row.headerCell>Description</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.cell>1.1.1.1</row.cell>
|
||||
<row.cell>host-set-1, host-set-2</row.cell>
|
||||
<row.cell>optional name</row.cell>
|
||||
<row.cell>description</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
<table.footer as |footer|>
|
||||
<footer.row as |row|>
|
||||
<row.cell>Footer</row.cell>
|
||||
</footer.row>
|
||||
</table.footer>
|
||||
</Rose::Table>
|
||||
</Rose::Dropdown>
|
||||
|
||||
<h2>Condensed dropdown</h2>
|
||||
<Rose::Dropdown
|
||||
@style="condensed"
|
||||
@text="Credential library details"
|
||||
@showCaret={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.section @title="ID">
|
||||
<dropdown.item>cl_nbv9375hLHs</dropdown.item>
|
||||
</dropdown.section>
|
||||
|
||||
<dropdown.separator />
|
||||
|
||||
<dropdown.section @title="Name">
|
||||
<dropdown.item>Key/Value</dropdown.item>
|
||||
</dropdown.section>
|
||||
|
||||
<dropdown.separator />
|
||||
|
||||
<dropdown.section @title="Description">
|
||||
<dropdown.item>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet sem sodales neque ultrices sollicitudin vel sed justo. Vivamus vitae sollicitudin turpis.</dropdown.item>
|
||||
</dropdown.section>
|
||||
</Rose::Dropdown>
|
||||
|
||||
<h2>Normal Dropdown</h2>
|
||||
<Rose::Dropdown
|
||||
@text="Credential library details"
|
||||
@showCaret={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.section @title="ID">
|
||||
<dropdown.item>cl_nbv9375hLHs</dropdown.item>
|
||||
</dropdown.section>
|
||||
<dropdown.separator />
|
||||
|
||||
<dropdown.section @title="Name">
|
||||
<dropdown.item>Key/Value</dropdown.item>
|
||||
</dropdown.section>
|
||||
<dropdown.separator />
|
||||
|
||||
<dropdown.section @title="Description">
|
||||
<dropdown.item>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet sem sodales neque ultrices sollicitudin vel sed justo. Vivamus vitae sollicitudin turpis.</dropdown.item>
|
||||
</dropdown.section>
|
||||
</Rose::Dropdown>
|
||||
|
||||
<h2>Normal Dropdown</h2>
|
||||
<Rose::Dropdown
|
||||
@text="Credential library details"
|
||||
@showCaret={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.link @route="about">Menu item</dropdown.link>
|
||||
<dropdown.link @route="about">Menu item 2</dropdown.link>
|
||||
</Rose::Dropdown>
|
||||
@@ -0,0 +1,20 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | rose/dropdown/key-value', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`
|
||||
<Rose::Dropdown::KeyValue>
|
||||
<:key>key</:key>
|
||||
<:value>value</:value>
|
||||
</Rose::Dropdown::KeyValue>
|
||||
`);
|
||||
|
||||
assert.equal(find('.rose-dropdown-key').textContent.trim(), 'key');
|
||||
assert.equal(find('.rose-dropdown-value').textContent.trim(), 'value');
|
||||
});
|
||||
});
|
||||
@@ -6,6 +6,7 @@
|
||||
"scss/at-extend-no-missing-placeholder": null,
|
||||
"function-parentheses-space-inside": null,
|
||||
"property-no-vendor-prefix": null,
|
||||
"at-rule-no-vendor-prefix": null
|
||||
"at-rule-no-vendor-prefix": null,
|
||||
"order/properties-alphabetical-order": null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<section class='card'>
|
||||
{{#if (if (has-block 'header') true @heading)}}
|
||||
<header class='card-header'>
|
||||
{{#if @heading}}
|
||||
<h2>
|
||||
{{#if @icon}}
|
||||
<Rose::Icon @name={{@icon}} @size='medium' />
|
||||
{{/if}}
|
||||
{{@heading}}
|
||||
</h2>
|
||||
{{/if}}
|
||||
|
||||
{{yield to='header'}}
|
||||
|
||||
</header>
|
||||
{{/if}}
|
||||
|
||||
<div class='card-body'>
|
||||
{{yield to='body'}}
|
||||
</div>
|
||||
|
||||
{{#if (has-block 'footer')}}
|
||||
<footer class='card-footer'>
|
||||
{{yield to='footer'}}
|
||||
</footer>
|
||||
{{/if}}
|
||||
</section>
|
||||
@@ -0,0 +1,14 @@
|
||||
<details ...attributes class='reveal'>
|
||||
<summary class='reveal-trigger'>
|
||||
<span class='reveal-trigger-text-close'>
|
||||
{{@textWhenClose}}
|
||||
</span>
|
||||
<span class='reveal-trigger-text-open'>
|
||||
{{@textWhenOpen}}
|
||||
</span>
|
||||
|
||||
</summary>
|
||||
<content class='reveal-content'>
|
||||
{{yield}}
|
||||
</content>
|
||||
</details>
|
||||
@@ -0,0 +1,3 @@
|
||||
import RoseDropdownComponent from 'rose/components/rose/dropdown';
|
||||
|
||||
export default class RevealComponent extends RoseDropdownComponent {}
|
||||
@@ -346,7 +346,6 @@
|
||||
|
||||
.rose-dialog-footer {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
|
||||
div:nth-child(1) {
|
||||
display: flex;
|
||||
@@ -360,35 +359,90 @@
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
// .credentials-card {
|
||||
// display: flex;
|
||||
// flex-direction: column;
|
||||
// margin-bottom: 12px;
|
||||
|
||||
// &:last-child { margin-bottom: 0; }
|
||||
|
||||
// .credentials-card-header {
|
||||
// display: flex;
|
||||
// flex-direction: row;
|
||||
|
||||
// div {
|
||||
// display: flex;
|
||||
// width: 50%;
|
||||
|
||||
// &:last-child {
|
||||
// justify-content: flex-end;
|
||||
// }
|
||||
// }
|
||||
// // border-bottom: 1px solid grey;
|
||||
// }
|
||||
|
||||
// .credentials-card-body {
|
||||
// // background: yellow;
|
||||
// }
|
||||
|
||||
// .credentials-card-footer {
|
||||
// // background: pink;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// Reveal component (app/components/reveal)
|
||||
$chevron-up: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563FF' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M7.41 16L12 11.42L16.59 16L18 14.59L12 8.59L6 14.59L7.41 16Z' /></svg>");
|
||||
$chevron-down: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563FF' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z' /></svg>");
|
||||
|
||||
.reveal {
|
||||
--trigger-color: var(--action);
|
||||
|
||||
.reveal-trigger {
|
||||
background: url($chevron-down) no-repeat right center;
|
||||
color: var(--trigger-color);
|
||||
cursor: default;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding-right: sizing.rems(l);
|
||||
white-space: nowrap;
|
||||
|
||||
// Hide default twistie triangle
|
||||
// Firefox
|
||||
list-style-type: none;
|
||||
// Webkit / Chromium
|
||||
&::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&::marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
--trigger-color: var(--action-starker-1);
|
||||
}
|
||||
}
|
||||
|
||||
&:not([open]) {
|
||||
.reveal-trigger-text-open {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&[open] {
|
||||
.reveal-trigger {
|
||||
background: url($chevron-up) no-repeat right center;
|
||||
}
|
||||
|
||||
.reveal-trigger-text-close {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Card component (app/components/card)
|
||||
.card {
|
||||
border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: sizing.rems(m);
|
||||
|
||||
.card-header {
|
||||
align-items: center;
|
||||
border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding: sizing.rems(s) sizing.rems(m);
|
||||
|
||||
h2 {
|
||||
@include type.type(s, normal);
|
||||
color: var(--ui-gray-starker-1);
|
||||
margin: 0;
|
||||
padding: sizing.rems(xxs) + sizing.rems(xxxs) 0;
|
||||
}
|
||||
|
||||
.rose-icon {
|
||||
margin-right: sizing.rems(xxxs);
|
||||
}
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: sizing.rems(s);
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
|
||||
padding: sizing.rems(s);
|
||||
}
|
||||
}
|
||||
@@ -20,17 +20,68 @@
|
||||
<:body>
|
||||
<h3>{{t 'resources.target.messages.proxy_url.title'}}
|
||||
(<code>{{t 'resources.target.types.tcp'}}</code>)</h3>
|
||||
<Copyable
|
||||
@text={{session.proxy}}
|
||||
@buttonText={{t 'actions.copy-to-clipboard'}}
|
||||
@acknowledgeText={{t 'states.copied'}}
|
||||
>
|
||||
<code>{{session.proxy_address}}:{{session.proxy_port}}</code>
|
||||
</Copyable>
|
||||
<p>
|
||||
<Copyable
|
||||
@text={{session.proxy}}
|
||||
@buttonText={{t 'actions.copy-to-clipboard'}}
|
||||
@acknowledgeText={{t 'states.copied'}}
|
||||
>
|
||||
<code>{{session.proxy_address}}:{{session.proxy_port}}</code>
|
||||
</Copyable>
|
||||
</p>
|
||||
|
||||
{{! <Rose::Separator />
|
||||
{{!-- <Rose::Separator />
|
||||
|
||||
<h3>Credentials</h3> }}
|
||||
<h3>Credentials</h3>
|
||||
|
||||
<Card @heading="Credentials" @icon='app-icons/credentials'>
|
||||
<:header>
|
||||
<Rose::Dropdown
|
||||
@style="condensed"
|
||||
@text="Credential library details"
|
||||
@showCaret={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
</Rose::Dropdown>
|
||||
</:header>
|
||||
<:body>
|
||||
<Rose::Table @style='condensed' as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>Key</row.headerCell>
|
||||
<row.headerCell colspan='2'>Value</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
<body.row as |row|>
|
||||
<row.headerCell>foo</row.headerCell>
|
||||
<row.cell>Value</row.cell>
|
||||
</body.row>
|
||||
<body.row as |row|>
|
||||
<row.headerCell>ttl</row.headerCell>
|
||||
<row.cell>Test</row.cell>
|
||||
</body.row>
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
</:body>
|
||||
<:footer>
|
||||
<Reveal
|
||||
@textWhenOpen='Hide content'
|
||||
@textWhenClose='View content'
|
||||
>
|
||||
<pre>
|
||||
<code>
|
||||
{
|
||||
"auth": null,
|
||||
"lease_duration": 3600,
|
||||
"lease_id": "",
|
||||
"renewable": false
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</Reveal>
|
||||
</:footer>
|
||||
</Card> --}}
|
||||
|
||||
</:body>
|
||||
<:footer>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | card', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
await render(hbs`<Card />`);
|
||||
assert.ok(find('.card'));
|
||||
});
|
||||
|
||||
test('it renders with content', async function (assert) {
|
||||
await render(hbs`
|
||||
<Card>
|
||||
<:header></:header>
|
||||
<:body></:body>
|
||||
<:footer></:footer>
|
||||
</Card>
|
||||
`);
|
||||
|
||||
assert.ok(find('.card'));
|
||||
assert.ok(find('.card-header'));
|
||||
assert.ok(find('.card-body'));
|
||||
assert.ok(find('.card-footer'));
|
||||
});
|
||||
|
||||
test('header renders an icon when defined', async function (assert) {
|
||||
await render(hbs`
|
||||
<Card
|
||||
@heading='This is a heading test'
|
||||
@icon='key'>
|
||||
<:header></:header>
|
||||
<:body></:body>
|
||||
<:footer></:footer>
|
||||
</Card>
|
||||
`);
|
||||
|
||||
assert.ok(find('.card'));
|
||||
assert.ok(find('.card-header'));
|
||||
assert.ok(find('.card-header .rose-icon'));
|
||||
assert.equal(this.element.textContent.trim(), 'This is a heading test');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find, click } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | reveal', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(hbs`
|
||||
<Reveal
|
||||
@textWhenOpen='Hide content'
|
||||
@textWhenClose='View content'
|
||||
/>
|
||||
`);
|
||||
assert.ok(find('.reveal'));
|
||||
assert.ok(find('.reveal-trigger'));
|
||||
assert.ok(find('.reveal-trigger').textContent.trim(), 'View content');
|
||||
});
|
||||
|
||||
test('it renders with content, opens, show the content, close and hide the content', async function (assert) {
|
||||
assert.expect(3);
|
||||
await render(hbs`
|
||||
<Reveal
|
||||
@textWhenOpen='Hide content'
|
||||
@textWhenClose='View content'
|
||||
>
|
||||
<pre>
|
||||
<code>
|
||||
{
|
||||
"auth": null,
|
||||
"lease_duration": 3600,
|
||||
"lease_id": "",
|
||||
"renewable": false
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</Reveal>
|
||||
`);
|
||||
|
||||
assert.notOk(find('details').open);
|
||||
await click('summary');
|
||||
assert.ok(find('details').open);
|
||||
await click('summary');
|
||||
assert.notOk(find('details').open);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user