@gitlab/ui 115.9.0 → 115.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/base/avatar_link/avatar_link.js +1 -1
- package/dist/components/base/avatars_inline/avatars_inline.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +10 -10
- package/src/components/base/avatar_link/avatar_link.vue +1 -1
- package/src/components/base/avatars_inline/avatars_inline.vue +1 -1
- package/src/components/base/markdown/markdown_typescale_demo.html +41 -71
- package/src/scss/variables.scss +1 -1
- package/src/components/base/accordion/accordion.md +0 -3
- package/src/components/base/accordion/accordion_item.md +0 -3
- package/src/components/base/alert/alert.md +0 -35
- package/src/components/base/animated_icon/animated_icon.md +0 -4
- package/src/components/base/avatar/avatar.md +0 -1
- package/src/components/base/avatar_labeled/avatar_labeled.md +0 -20
- package/src/components/base/avatar_link/avatar_link.md +0 -33
- package/src/components/base/avatars_inline/avatars_inline.md +0 -38
- package/src/components/base/badge/badge.md +0 -30
- package/src/components/base/banner/banner.md +0 -35
- package/src/components/base/breadcrumb/breadcrumb.md +0 -52
- package/src/components/base/broadcast_message/broadcast_message.md +0 -25
- package/src/components/base/button/button.md +0 -119
- package/src/components/base/button_group/button_group.md +0 -44
- package/src/components/base/card/card.md +0 -4
- package/src/components/base/collapse/collapse.md +0 -64
- package/src/components/base/datepicker/datepicker.md +0 -8
- package/src/components/base/daterange_picker/daterange_picker.md +0 -32
- package/src/components/base/drawer/drawer.md +0 -17
- package/src/components/base/dropdown/dropdown.md +0 -72
- package/src/components/base/dropdown/dropdown_item.md +0 -2
- package/src/components/base/dropdown/dropdown_section_header.md +0 -7
- package/src/components/base/dropdown/dropdown_text.md +0 -7
- package/src/components/base/filtered_search/filtered_search.md +0 -76
- package/src/components/base/filtered_search/filtered_search_suggestion.md +0 -15
- package/src/components/base/filtered_search/filtered_search_suggestion_list.md +0 -13
- package/src/components/base/filtered_search/filtered_search_term.md +0 -7
- package/src/components/base/filtered_search/filtered_search_token.md +0 -23
- package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -14
- package/src/components/base/form/form_checkbox/form_checkbox.md +0 -6
- package/src/components/base/form/form_input/form_input.md +0 -306
- package/src/components/base/form/form_radio/form_radio.md +0 -23
- package/src/components/base/form/form_radio_group/form_radio_group.md +0 -63
- package/src/components/base/form/form_select/form_select.md +0 -1
- package/src/components/base/form/form_textarea/form_textarea.md +0 -3
- package/src/components/base/icon/icon.md +0 -27
- package/src/components/base/infinite_scroll/infinite_scroll.md +0 -104
- package/src/components/base/keyset_pagination/keyset_pagination.md +0 -49
- package/src/components/base/label/label.md +0 -15
- package/src/components/base/link/link.md +0 -187
- package/src/components/base/loading_icon/loading_icon.md +0 -3
- package/src/components/base/modal/modal.md +0 -30
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +0 -184
- package/src/components/base/new_dropdowns/listbox/listbox.md +0 -195
- package/src/components/base/pagination/pagination.md +0 -45
- package/src/components/base/path/path.md +0 -41
- package/src/components/base/progress_bar/progress_bar.md +0 -25
- package/src/components/base/search_box_by_click/search_box_by_click.md +0 -1
- package/src/components/base/search_box_by_type/search_box_by_type.md +0 -1
- package/src/components/base/segmented_control/segmented_control.md +0 -26
- package/src/components/base/skeleton_loader/skeleton_loader.md +0 -70
- package/src/components/base/sorting/sorting.md +0 -80
- package/src/components/base/table/table.md +0 -71
- package/src/components/base/table_lite/table_lite.md +0 -68
- package/src/components/base/tabs/tabs/tabs.md +0 -80
- package/src/components/base/toast/toast.md +0 -48
- package/src/components/base/toggle/toggle.md +0 -4
- package/src/components/base/token/token.md +0 -12
- package/src/components/base/tooltip/tooltip.md +0 -52
- package/src/scss/typescale/typeface_demo.html +0 -70
- package/src/scss/typescale/typescale.md +0 -81
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
The progress bar component can be used to show an amount of progress.
|
|
2
|
-
It comes in 4 variants and supports setting a custom maximum and height.
|
|
3
|
-
|
|
4
|
-
## Value
|
|
5
|
-
|
|
6
|
-
The `value` prop can be a Number or String. If not given, it will default to `0`.
|
|
7
|
-
|
|
8
|
-
## Variants
|
|
9
|
-
|
|
10
|
-
The following variants are available:
|
|
11
|
-
|
|
12
|
-
1. 'primary' (default)
|
|
13
|
-
2. 'success'
|
|
14
|
-
3. 'warning'
|
|
15
|
-
4. 'danger'
|
|
16
|
-
|
|
17
|
-
## Maximum
|
|
18
|
-
|
|
19
|
-
A custom maximum can be set with the `max` prop. If not given, it will default to `100`.
|
|
20
|
-
|
|
21
|
-
## Width and Height
|
|
22
|
-
|
|
23
|
-
The `GlProgressBar` will always expand to the maximum width of its parent container.
|
|
24
|
-
The height can be controlled with the `height` prop. The value should be a standard
|
|
25
|
-
CSS dimension (`px`, `rem`, `em`, etc.) and given as a String, e.g. `'20px'`.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
A customizable button group that displays a set of equal options, where only one
|
|
2
|
-
option can be active at a time. This component includes the ability to disable
|
|
3
|
-
specific options and dynamically modify button content using slots.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Displays a group of selectable buttons.
|
|
8
|
-
- Allows only one active selection at a time.
|
|
9
|
-
- Supports content customization through the button-content slot.
|
|
10
|
-
- Options can be disabled individually.
|
|
11
|
-
|
|
12
|
-
## Props Validation
|
|
13
|
-
|
|
14
|
-
The `options` prop is validated against a specific structure to ensure consistent
|
|
15
|
-
data. Each option must include:
|
|
16
|
-
|
|
17
|
-
- `value`: A `string`, `number`, or `boolean` to identify the option.
|
|
18
|
-
- `disabled`: A `boolean` (or `undefined`) indicating whether the option is disabled.
|
|
19
|
-
|
|
20
|
-
Optionally it can include:
|
|
21
|
-
|
|
22
|
-
- `text`: A `string` which gets displayed in the slot content.
|
|
23
|
-
|
|
24
|
-
## Notes
|
|
25
|
-
|
|
26
|
-
- Ensure each value is unique within the options array for consistent behavior.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
Skeleton loaders are to be used when pages or sections can be progressively populated with content,
|
|
2
|
-
such as text and images, as they become available. Generally speaking the first batch of content
|
|
3
|
-
will be the lightest to load and is followed by secondary and tertiary content batches. Each loading
|
|
4
|
-
step will add in more detail to the page until no skeleton loaders are present anymore. Content
|
|
5
|
-
should replace skeleton objects immediately when the data is available.
|
|
6
|
-
|
|
7
|
-
The skeleton loader component accepts shapes which in return will create a skeleton state with a
|
|
8
|
-
loading animation. Any skeleton state components should be created with
|
|
9
|
-
`<gl-skeleton-loader></gl-skeleton-loader>`. If no shape is passed via the slot the default skeleton
|
|
10
|
-
will be used. See "Default" and "Default With Custom Props" examples.
|
|
11
|
-
|
|
12
|
-
## The `.gl-animate-skeleton-loader` class
|
|
13
|
-
|
|
14
|
-
Skeleton loaders can also be composed with a `.gl-animate-skeleton-loader`
|
|
15
|
-
CSS class. This CSS-based approach is easier to make responsive and match mocked elements.
|
|
16
|
-
Feel free to use this approach if it suits your use case and please leave your
|
|
17
|
-
feedback in this [Feedback for css-based skeleton loading
|
|
18
|
-
indicator](https://gitlab.com/gitlab-org/gitlab-ui/-/issues/2319) issue.
|
|
19
|
-
To improve developer experience and simplify matching Pajamas styles we're considering
|
|
20
|
-
several improvements in the future, including adding more CSS util classes for
|
|
21
|
-
this animation, or creating a dedicated component. Here is an example of how
|
|
22
|
-
you could replicate the default `<gl-skeleton-loader />` behavior with the
|
|
23
|
-
CSS-based approach:
|
|
24
|
-
|
|
25
|
-
```html
|
|
26
|
-
<div>
|
|
27
|
-
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-my-3 !gl-max-w-20"></div>
|
|
28
|
-
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-my-3 !gl-max-w-30"></div>
|
|
29
|
-
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-my-3 !gl-max-w-26"></div>
|
|
30
|
-
</div>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**USAGE NOTES:** if you're using `gl-max-w-xx` you'll need to add
|
|
34
|
-
important (e.g. `!gl-max-w-20`). This is because `.gl-animate-skeleton-loader` already
|
|
35
|
-
has a `max-width` statement, and we need to override it. You can override it
|
|
36
|
-
only with lower numbers. Width rules (`gl-w-xx`) don't need an override, you
|
|
37
|
-
can use them as-is. If you want to "synchronize" two elements next to each
|
|
38
|
-
other, try adding `animation-delay` to offset elements.
|
|
39
|
-
|
|
40
|
-
More complex example (with different shapes and an animation delay for offset elements):
|
|
41
|
-
|
|
42
|
-
```html
|
|
43
|
-
<div class="gl-display-flex gl-flex-direction-column gl-gap-2 gl-w-30">
|
|
44
|
-
<div class="gl-animate-skeleton-loader gl-h-8 gl-rounded-base gl-mb-4"></div>
|
|
45
|
-
<div class="gl-display-flex gl-flex-direction-row gl-gap-2">
|
|
46
|
-
<div class="gl-animate-skeleton-loader gl-h-8 gl-w-8 gl-rounded-full"></div>
|
|
47
|
-
<div class="gl-flex-grow-1" style="animation-delay: 100ms">
|
|
48
|
-
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-my-2"></div>
|
|
49
|
-
<div class="gl-animate-skeleton-loader gl-h-4 gl-rounded-base gl-my-2"></div>
|
|
50
|
-
<div class="gl-animate-skeleton-loader gl-display-inline-block gl-h-4 gl-w-10 gl-rounded-base gl-my-2"></div>
|
|
51
|
-
<div
|
|
52
|
-
class="gl-animate-skeleton-loader gl-display-inline-block gl-h-4 gl-w-10 gl-rounded-base gl-my-2"
|
|
53
|
-
style="animation-delay: 250ms"></div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Progressive Loading
|
|
60
|
-
|
|
61
|
-
Determine if progressive loading is available, if it is break apart the skeleton to load data as it
|
|
62
|
-
becomes readily available. If progessive loading is not available, replace the entire skeleton when
|
|
63
|
-
the data is available.
|
|
64
|
-
|
|
65
|
-
## Under the hood
|
|
66
|
-
|
|
67
|
-
Skeleton Loader is a port of [vue-content-loader](https://github.com/egoist/vue-content-loader).
|
|
68
|
-
Some changes have been made to the code to better suit our codebase, such as removing props and
|
|
69
|
-
refactoring into a SFC. Please take a look at their documentation and a useful [UI tool](http://danilowoz.com/create-vue-content-loader/)
|
|
70
|
-
for seeing the code output for `svg` shapes.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
The sorting component allows the user to select the field on which they would like to sort a list
|
|
2
|
-
and whether to sort in ascending or descending order.
|
|
3
|
-
|
|
4
|
-
Provide a list of sort options via the `sortOptions` prop with this structure:
|
|
5
|
-
|
|
6
|
-
```typescript
|
|
7
|
-
type sortOptionsProp = Array<{
|
|
8
|
-
value: string
|
|
9
|
-
text: string
|
|
10
|
-
}>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
The `value` should be a unique primitive value, and `text` is the user-facing
|
|
14
|
-
string for that option.
|
|
15
|
-
|
|
16
|
-
Set the currently selected sort option by passing a value to the `sortBy` prop.
|
|
17
|
-
This should equal one of the `sortOptions` values. The selected sort option is
|
|
18
|
-
rendered with a check mark next to it in the dropdown menu.
|
|
19
|
-
|
|
20
|
-
When the user changes the selected sort option, a `sortByChange` event is
|
|
21
|
-
emitted, with the `value` of the option as the only payload.
|
|
22
|
-
|
|
23
|
-
The text of the dropdown trigger button is the `text` of the selected sort
|
|
24
|
-
option. Pass a string to the `text` prop to override this behavior.
|
|
25
|
-
|
|
26
|
-
When the user clicks on the sort direction button, a `sortDirectionChange`
|
|
27
|
-
event is emitted, with a boolean value as its only payload. If the payload is
|
|
28
|
-
`true`, the new order is ascending; otherwise it's descending.
|
|
29
|
-
|
|
30
|
-
A complete implementation example might look like:
|
|
31
|
-
|
|
32
|
-
```html
|
|
33
|
-
<template>
|
|
34
|
-
<gl-sorting
|
|
35
|
-
:sort-options="sortOptions"
|
|
36
|
-
:sort-by="sortBy"
|
|
37
|
-
:is-ascending="isAscending"
|
|
38
|
-
@sortByChange="onSortByChange"
|
|
39
|
-
@sortDirectionChange="onDirectionChange"
|
|
40
|
-
/>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script>
|
|
44
|
-
import { GlSorting } from '@gitlab/ui';
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
components: {
|
|
48
|
-
GlSorting,
|
|
49
|
-
},
|
|
50
|
-
data() {
|
|
51
|
-
const sortOptions = [{
|
|
52
|
-
value: 'name',
|
|
53
|
-
text: 'Name',
|
|
54
|
-
}, {
|
|
55
|
-
value: 'date',
|
|
56
|
-
text: 'Date',
|
|
57
|
-
}];
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
isAscending: false,
|
|
61
|
-
sortBy: sortOptions[0].value,
|
|
62
|
-
sortOptions,
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
methods: {
|
|
66
|
-
onSortByChange(value) {
|
|
67
|
-
this.sortBy = value;
|
|
68
|
-
this.sortMyData(this.sortBy, this.isAscending);
|
|
69
|
-
},
|
|
70
|
-
onDirectionChange(isAscending) {
|
|
71
|
-
this.isAscending = isAscending;
|
|
72
|
-
this.sortMyData(this.sortBy, this.isAscending);
|
|
73
|
-
},
|
|
74
|
-
sortMyData(sortBy, isAscending) {
|
|
75
|
-
// Use sortBy and direction to sort your data
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
The `gl-table` component wraps BootstrapVue `b-table` component. `b-table` provides a variety of
|
|
4
|
-
slots for custom data rendering. You can learn more about them in the
|
|
5
|
-
[component documentation](https://bootstrap-vue.org/docs/components/table).
|
|
6
|
-
When using the component, pass in the `fields` prop as part of the `$options`, and give each table
|
|
7
|
-
data and table head its own styles if necessary.
|
|
8
|
-
|
|
9
|
-
## Internationalization
|
|
10
|
-
|
|
11
|
-
To ensure we internationalize field labels, always pass an array of objects for the `fields` prop,
|
|
12
|
-
like mentioned in the implementation example.
|
|
13
|
-
|
|
14
|
-
[Learn more about the `field` prop](https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/2e88af62966265cb725ca3f65f4b175e2494734b/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md#L137).
|
|
15
|
-
|
|
16
|
-
## Header text alignment
|
|
17
|
-
|
|
18
|
-
To align a given `TH` element's text to the right, set the `thAlignRight` property to `true` in
|
|
19
|
-
the fields definition. This will ensure that proper styling is applied, including when the column
|
|
20
|
-
is sortable.
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
const fields = [
|
|
24
|
-
{
|
|
25
|
-
key: "column_one",
|
|
26
|
-
label: __("First column"),
|
|
27
|
-
sortable: true,
|
|
28
|
-
thAlignRight: true,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Use `GlTableLite` when possible
|
|
34
|
-
|
|
35
|
-
If you don't need all the features of `GlTable`, like filtering, sorting, or
|
|
36
|
-
pagination, use `GlTableLite` which offers a subset of `GlTable` features.
|
|
37
|
-
|
|
38
|
-
## Implementation Example
|
|
39
|
-
|
|
40
|
-
```html
|
|
41
|
-
<script>
|
|
42
|
-
export default {
|
|
43
|
-
fields: [
|
|
44
|
-
{
|
|
45
|
-
key: 'column_one',
|
|
46
|
-
label: __('First column'),
|
|
47
|
-
thClass: 'w-60p',
|
|
48
|
-
tdClass: 'table-col d-flex'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: 'col_2',
|
|
52
|
-
label: __('Second column'),
|
|
53
|
-
thClass: 'w-15p',
|
|
54
|
-
tdClass: 'table-col d-flex'
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
<template>
|
|
60
|
-
<gl-table :items="items" :fields="$options.fields">
|
|
61
|
-
<template #head(column_one)>
|
|
62
|
-
<div>First column</div>
|
|
63
|
-
<!-- This is the column head for the first object in `fields` -->
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<template #cell(column_one)>
|
|
67
|
-
This is the template for column data belonging to the first object
|
|
68
|
-
</template>
|
|
69
|
-
</gl-table>
|
|
70
|
-
</template>
|
|
71
|
-
```
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
The `GlTableLite` component wraps BootstrapVue `BTableLite` component.
|
|
4
|
-
`BTableLite` provides a variety of slots for custom data rendering. You can learn
|
|
5
|
-
more about them in the
|
|
6
|
-
[component documentation](https://bootstrap-vue.org/docs/components/table#light-weight-tables).
|
|
7
|
-
|
|
8
|
-
## `GlTable` vs. `GlTableLite`
|
|
9
|
-
|
|
10
|
-
`GlTableLite` adds less payload to the pagebundle than `GlTable`.
|
|
11
|
-
When possible `GlTableLite` should be preferred over `GlTable`.
|
|
12
|
-
|
|
13
|
-
The `GlTableLite` component provides all of the styling and formatting features of
|
|
14
|
-
`GlTable` (including row details and stacked support), while excluding the following features:
|
|
15
|
-
|
|
16
|
-
- Filtering
|
|
17
|
-
- Sorting
|
|
18
|
-
- Pagination
|
|
19
|
-
- Items provider support
|
|
20
|
-
- Selectable rows
|
|
21
|
-
- Busy table state and styling
|
|
22
|
-
- Fixed top and bottom rows
|
|
23
|
-
- Empty row support
|
|
24
|
-
|
|
25
|
-
## Internationalization
|
|
26
|
-
|
|
27
|
-
To ensure we internationalize field labels, always pass an array of objects for the `fields` prop,
|
|
28
|
-
like mentioned in the implementation example.
|
|
29
|
-
|
|
30
|
-
[Learn more about the `field` prop](https://gitlab.com/gitlab-org/gitlab-services/design.gitlab.com/-/blob/2e88af62966265cb725ca3f65f4b175e2494734b/packages/gitlab-ui/src/vendor/bootstrap-vue/src/components/table/README.md#L137).
|
|
31
|
-
|
|
32
|
-
## Implementation example
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<script>
|
|
36
|
-
export default {
|
|
37
|
-
fields: [
|
|
38
|
-
{
|
|
39
|
-
key: 'column_one',
|
|
40
|
-
label: __('First column'),
|
|
41
|
-
thClass: 'w-60p',
|
|
42
|
-
tdClass: 'table-col d-flex'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: 'col_2',
|
|
46
|
-
label: __('Second column'),
|
|
47
|
-
thClass: 'w-15p',
|
|
48
|
-
tdClass: 'table-col d-flex'
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
<template>
|
|
54
|
-
<gl-table-lite
|
|
55
|
-
:items="items"
|
|
56
|
-
:fields="$options.fields"
|
|
57
|
-
>
|
|
58
|
-
<template #head(column_one)>
|
|
59
|
-
<div>First column</div><!-- This is the column head for the first object in `fields` -->
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<template #cell(column_one)>
|
|
63
|
-
This is the template for column data belonging to the first object
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
</gl-table-lite>
|
|
67
|
-
</template>
|
|
68
|
-
```
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one
|
|
2
|
-
specific view at a time while maintaining sight of all the relevant content options available. Each
|
|
3
|
-
tab, when active, will reveal it’s own unique content.
|
|
4
|
-
|
|
5
|
-
## Using the component Vue
|
|
6
|
-
|
|
7
|
-
~~~html
|
|
8
|
-
<gl-tabs>
|
|
9
|
-
<gl-tab title="Tab 1">
|
|
10
|
-
Tab panel 1
|
|
11
|
-
</gl-tab>
|
|
12
|
-
<gl-tab title="Tab 2">
|
|
13
|
-
Tab panel 2
|
|
14
|
-
</gl-tab>
|
|
15
|
-
</gl-tabs>
|
|
16
|
-
~~~
|
|
17
|
-
|
|
18
|
-
## Using the component HTML
|
|
19
|
-
|
|
20
|
-
~~~html
|
|
21
|
-
<div class="tabs gl-tabs">
|
|
22
|
-
<ul role="tablist" class="nav gl-tabs-nav">
|
|
23
|
-
<li role="presentation" class="nav-item">
|
|
24
|
-
<a
|
|
25
|
-
role="tab"
|
|
26
|
-
target="_self"
|
|
27
|
-
href="#"
|
|
28
|
-
class="nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo"
|
|
29
|
-
>Tab 1</a>
|
|
30
|
-
</li>
|
|
31
|
-
<li role="presentation" class="nav-item">
|
|
32
|
-
<a role="tab" target="_self" href="#" class="nav-link gl-tab-nav-item">Tab 2</a>
|
|
33
|
-
</li>
|
|
34
|
-
</ul>
|
|
35
|
-
<div class="tab-content gl-tab-content">
|
|
36
|
-
<div role="tabpanel" class="tab-pane gl-tab-content active">Tab panel 1</div>
|
|
37
|
-
<div role="tabpanel" class="tab-pane gl-tab-content">Tab panel 2</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
~~~
|
|
41
|
-
|
|
42
|
-
## Adding Action Buttons to the Tabs
|
|
43
|
-
|
|
44
|
-
Action buttons are rendered in separate toolbar slots (`#toolbar-start` & `#toolbar-end`) and can
|
|
45
|
-
be populated via props: `action-primary`, `action-secondary` and
|
|
46
|
-
`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will
|
|
47
|
-
behave and look. The props receive an object as such:
|
|
48
|
-
|
|
49
|
-
~~~js
|
|
50
|
-
{
|
|
51
|
-
text: 'Save Changes',
|
|
52
|
-
attributes: {
|
|
53
|
-
variant: 'info',
|
|
54
|
-
disabled: this.someState,
|
|
55
|
-
class: 'some-class',
|
|
56
|
-
...
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
~~~
|
|
60
|
-
|
|
61
|
-
## Scrollable tab buttons
|
|
62
|
-
|
|
63
|
-
By default, `GlTab` will wrap tab buttons when they overflow the container. To
|
|
64
|
-
enable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`
|
|
65
|
-
component. This is a separate Vue component because of some limitations:
|
|
66
|
-
|
|
67
|
-
- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the
|
|
68
|
-
moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.
|
|
69
|
-
|
|
70
|
-
`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above
|
|
71
|
-
exceptions).
|
|
72
|
-
|
|
73
|
-
~~~html
|
|
74
|
-
<gl-scrollable-tabs
|
|
75
|
-
scroll-left-label="Custom scroll left text"
|
|
76
|
-
scroll-right-label="Custom scroll right text"
|
|
77
|
-
>
|
|
78
|
-
<gl-tab v-for="tab in tabs" :key="tab.key" :title="tab.title"> {{ tab.content }} </gl-tab>
|
|
79
|
-
</gl-scrollable-tabs>
|
|
80
|
-
~~~
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Toasts are used to display system messages. The messages are short and straightforward. It may
|
|
3
|
-
contain a dismiss button, and an action button depending on the situation.
|
|
4
|
-
|
|
5
|
-
## Using the plugin
|
|
6
|
-
|
|
7
|
-
In order to use the plugin, it needs to be included in your application with `Vue.use`.
|
|
8
|
-
|
|
9
|
-
```js
|
|
10
|
-
// myApp.js
|
|
11
|
-
|
|
12
|
-
import { GlToast } from '@gitlab/ui';
|
|
13
|
-
|
|
14
|
-
// Note, this has to be done before `Vue.new()`
|
|
15
|
-
Vue.use(GlToast);
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Once included in your application, the toast plugin is globally available.
|
|
19
|
-
|
|
20
|
-
```js
|
|
21
|
-
// myComponent.vue
|
|
22
|
-
|
|
23
|
-
this.$toast.show('Hello GitLab!');
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Below is an example with options
|
|
27
|
-
|
|
28
|
-
```js
|
|
29
|
-
// myComponent.vue
|
|
30
|
-
|
|
31
|
-
this.$toast.show('This is a toast with an option.', {
|
|
32
|
-
action: {
|
|
33
|
-
text: 'Undo',
|
|
34
|
-
onClick: () => { ... },
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Options
|
|
40
|
-
|
|
41
|
-
Below are the options you can pass to create a toast
|
|
42
|
-
|
|
43
|
-
| **Option** | **Type** | **Default** | **Description** |
|
|
44
|
-
| ------------- | ------------- | ----------- | ---------------------------------------- |
|
|
45
|
-
| autoHideDelay | Number | 5000 | Display time of the toast in millisecond |
|
|
46
|
-
| action | Object | close | Add single actions to toast |
|
|
47
|
-
| toastClass | String, Array | 'gl-toast' | Custom css class name of the toast |
|
|
48
|
-
| onComplete | Function | null | Trigger when toast is completed |
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
Tokens are an object that has been created after a user action, like selecting an autocompleted item
|
|
4
|
-
while searching. They have a close action in the form of an 'x'.
|
|
5
|
-
|
|
6
|
-
## Using the component
|
|
7
|
-
|
|
8
|
-
~~~html
|
|
9
|
-
<gl-token>
|
|
10
|
-
Token
|
|
11
|
-
</gl-token>
|
|
12
|
-
~~~
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
Using the tooltip component is recommended if you have HTML content.
|
|
2
|
-
It is also currently required if the tooltip content needs to change while it's visible
|
|
3
|
-
(see [this upstream issue][this upstream issue]). In all other cases, please use the directive.
|
|
4
|
-
|
|
5
|
-
[this upstream issue]: https://github.com/bootstrap-vue/bootstrap-vue/issues/2142
|
|
6
|
-
|
|
7
|
-
## Using the component
|
|
8
|
-
|
|
9
|
-
~~~html
|
|
10
|
-
<gl-button ref="someButton">
|
|
11
|
-
...
|
|
12
|
-
</gl-button>
|
|
13
|
-
|
|
14
|
-
<gl-tooltip :target="() => $refs.someButton">
|
|
15
|
-
some <em>tooltip<em/> text
|
|
16
|
-
</gl-tooltip>
|
|
17
|
-
~~~
|
|
18
|
-
|
|
19
|
-
## Using the directive
|
|
20
|
-
|
|
21
|
-
You will need to import and register `GlTooltipDirective` before you can use it.
|
|
22
|
-
|
|
23
|
-
~~~html
|
|
24
|
-
<script>
|
|
25
|
-
import { GlTooltipDirective } from '@gitlab/ui';
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
directives: {
|
|
29
|
-
GlTooltip: GlTooltipDirective,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<element
|
|
35
|
-
v-gl-tooltip.${modifier}
|
|
36
|
-
title="some tooltip text"
|
|
37
|
-
>
|
|
38
|
-
...
|
|
39
|
-
</element>
|
|
40
|
-
~~~
|
|
41
|
-
|
|
42
|
-
## Directive attributes
|
|
43
|
-
|
|
44
|
-
`v-gl-tooltip` directive uses the same attributes as [`v-b-tooltip`][`v-b-tooltip`].
|
|
45
|
-
|
|
46
|
-
## Under the hood
|
|
47
|
-
|
|
48
|
-
Tooltip uses [`<b-tooltip>`][`<b-tooltip>`] and [`v-b-tooltip`][`v-b-tooltip`] internally.
|
|
49
|
-
|
|
50
|
-
[`<b-tooltip>`]: https://bootstrap-vue.org/docs/components/tooltip
|
|
51
|
-
|
|
52
|
-
[`v-b-tooltip`]: https://bootstrap-vue.org/docs/directives/tooltip
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<table>
|
|
2
|
-
<thead>
|
|
3
|
-
<tr>
|
|
4
|
-
<th class="gl-pb-5 gl-pr-10">
|
|
5
|
-
<h4>Primary typeface</h4>
|
|
6
|
-
<h1>GitLab Sans</h1>
|
|
7
|
-
</th>
|
|
8
|
-
<th class="gl-pb-5 monospace">
|
|
9
|
-
<h4>Monospaced typeface</h4>
|
|
10
|
-
<h1>GitLab Mono</h1>
|
|
11
|
-
</th>
|
|
12
|
-
</tr>
|
|
13
|
-
</thead>
|
|
14
|
-
<tbody>
|
|
15
|
-
<tr>
|
|
16
|
-
<td class="gl-pb-5 gl-pr-10">
|
|
17
|
-
<p class="sm">
|
|
18
|
-
UI Small Paragraph • 0.75rem (12px)<br />
|
|
19
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
20
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
21
|
-
1234567890
|
|
22
|
-
</p>
|
|
23
|
-
</td>
|
|
24
|
-
<td class="gl-pb-5">
|
|
25
|
-
<p class="monospace sm">
|
|
26
|
-
UI Small Monospace • 0.75rem (12px)<br />
|
|
27
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
28
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
29
|
-
1234567890
|
|
30
|
-
</p>
|
|
31
|
-
</td>
|
|
32
|
-
</tr>
|
|
33
|
-
<tr>
|
|
34
|
-
<td class="gl-pb-5 gl-pr-10">
|
|
35
|
-
<p>
|
|
36
|
-
UI Paragraph • 0.875rem (14px)<br />
|
|
37
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
38
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
39
|
-
1234567890
|
|
40
|
-
</p>
|
|
41
|
-
</td>
|
|
42
|
-
<td class="gl-pb-5">
|
|
43
|
-
<p class="monospace">
|
|
44
|
-
UI Monospace • 0.875rem (14px)<br />
|
|
45
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
46
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
47
|
-
1234567890
|
|
48
|
-
</p>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
<tr>
|
|
52
|
-
<td class="gl-pb-5 gl-pr-10">
|
|
53
|
-
<p class="lg">
|
|
54
|
-
UI Large Paragraph • 1rem (16px)<br />
|
|
55
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
56
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
57
|
-
1234567890
|
|
58
|
-
</p>
|
|
59
|
-
</td>
|
|
60
|
-
<td class="gl-pb-5">
|
|
61
|
-
<p class="monospace lg">
|
|
62
|
-
UI Large Monospace • 1rem (16px)<br />
|
|
63
|
-
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br />
|
|
64
|
-
abcdefghijklmnopqrstuvwxyz<br />
|
|
65
|
-
1234567890
|
|
66
|
-
</p>
|
|
67
|
-
</td>
|
|
68
|
-
</tr>
|
|
69
|
-
</tbody>
|
|
70
|
-
</table>
|